[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] Schemas and serials
From:       Scott Marlowe <scott.marlowe () gmail ! com>
Date:       2017-07-31 21:06:57
Message-ID: CAOR=d=2WFZopNR8qZRBWtLBf5pEN-Ann2X6AQz5pfUha+FQJkA () mail ! gmail ! com
[Download RAW message or body]

On Sat, Jul 29, 2017 at 1:17 PM, Melvin Davidson <melvin6925@gmail.com>
wrote:

>
> On Sat, Jul 29, 2017 at 3:38 PM, tel medola <tel.medola@gmail.com> wrote:
>
>> Depends.
>> When you create your tables in new schema, the script was the same from
>> "qa"?
>> Sequences, tables, etc.. belong to the schema where was created.
>>
>> Roberto.
>>
>> Em s=C3=A1b, 29 de jul de 2017 =C3=A0s 16:17, marcelo <marcelo.nicolet@g=
mail.com>
>> escreveu:
>>
>>> Some days ago I asked regarding tables located in different schemas.
>>> Now, my question is
>>> Suppose I have two schemas (other than public): "qa" and "production".
>>> Initially I create all my tables in "qa". All of them have a primary ke=
y
>>> of type serial.
>>> Later, I will copy the tables definitions to production.
>>> It will automatically create the sequences in the new schema, starting
>>> at zero?
>>> TIA
>>> Marcelo
>>>
>>>
>>> --
>>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-general
>>>
>>
>
>
>
>
> *Marcelo,>Initially I create all my tables in "qa". All of them have a
> primary key of type serial. >Later, I will copy the tables definitions to
> production.*
>
> *A word of caution, creating tables in a qa "schema" and then transferrin=
g
> to production is not the normal/correct (or safe) way to do development.*
>
> *The standard procedure is to create a seperate "qa" database (and/or
> server) with the exact same schema(s) as production. Then, after testing =
*
>
> *is completed, the schemas/tables are copied to production.*
>
>
This. Staging should look as much like production as possible for testing
purposes. If you HAVE to use the same server (not a good idea) then make
separate clusters. Separate servers here can save you a LOT of heartache
from someone fat fingering a script meant for staging hitting production.

[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jul 29, 2017 \
at 1:17 PM, Melvin Davidson <span dir="ltr">&lt;<a href="mailto:melvin6925@gmail.com" \
target="_blank">melvin6925@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><div \
class="h5"><br><div class="gmail_quote">On Sat, Jul 29, 2017 at 3:38 PM, tel medola \
<span dir="ltr">&lt;<a href="mailto:tel.medola@gmail.com" \
target="_blank">tel.medola@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div><div dir="auto">Depends.</div><div \
dir="auto">When you create your tables in new schema, the script was the same from \
&quot;qa&quot;?</div><div dir="auto">Sequences, tables, etc.. belong to the schema \
where was created.</div><div dir="auto"><br></div><div \
dir="auto">Roberto.</div><div><div class="m_-7338635796672177752gmail-h5"><br><div \
class="gmail_quote"><div>Em sáb, 29 de jul de 2017 às 16:17, marcelo &lt;<a \
href="mailto:marcelo.nicolet@gmail.com" \
target="_blank">marcelo.nicolet@gmail.com</a>&gt; escreveu:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Some days ago I asked regarding tables located in \
different schemas.<br> Now, my question is<br>
Suppose I have two schemas (other than public): &quot;qa&quot; and \
&quot;production&quot;.<br> Initially I create all my tables in &quot;qa&quot;. All \
of them have a primary key<br> of type serial.<br>
Later, I will copy the tables definitions to production.<br>
It will automatically create the sequences in the new schema, starting<br>
at zero?<br>
TIA<br>
Marcelo<br>
<br>
<br>
--<br>
Sent via pgsql-general mailing list (<a href="mailto:pgsql-general@postgresql.org" \
target="_blank">pgsql-general@postgresql.org</a>)<br> To make changes to your \
subscription:<br> <a href="http://www.postgresql.org/mailpref/pgsql-general" \
rel="noreferrer" target="_blank">http://www.postgresql.org/mail<wbr>pref/pgsql-general</a><br>
 </blockquote></div></div></div></div>
</blockquote></div><br></div></div><b>Marcelo,<span class=""><br>&gt;Initially I \
create all my tables in &quot;qa&quot;. All of them have a primary key of type \
serial.<br> &gt;Later, I will copy the tables definitions to \
production.<br><br></span></b></div><div class="gmail_extra"><b>A word of caution, \
creating tables in a qa &quot;schema&quot; and then transferring to production is not \
the normal/correct (or safe) way to do development.<br clear="all"></b></div><div \
class="gmail_extra"><b>The standard procedure is to create a seperate &quot;qa&quot; \
database (and/or server) with the exact same schema(s) as production. Then, after \
testing <br></b></div><div class="gmail_extra"><b>is completed, the schemas/tables \
are copied to production.<span class="HOEnZb"><font \
color="#888888"><br></font></span></b></div><div \
class="gmail_extra"><b><br></b></div></div></blockquote><div><br></div><div>This. \
Staging should look as much like production as possible for testing purposes. If you \
HAVE to use the same server (not a good idea) then make separate clusters. Separate \
servers here can save you a LOT of heartache from someone fat fingering a script \
meant for staging hitting production.  </div></div> </div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic