Re: Schemas and serials

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: tel medola <tel(dot)medola(at)gmail(dot)com>, marcelo <marcelo(dot)nicolet(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Schemas and serials
Date: 2017-07-31 21:06:57
Message-ID: CAOR=d=2WFZopNR8qZRBWtLBf5pEN-Ann2X6AQz5pfUha+FQJkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jul 29, 2017 at 1:17 PM, Melvin Davidson <melvin6925(at)gmail(dot)com>
wrote:

>
> On Sat, Jul 29, 2017 at 3:38 PM, tel medola <tel(dot)medola(at)gmail(dot)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áb, 29 de jul de 2017 às 16:17, marcelo <marcelo(dot)nicolet(at)gmail(dot)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 key
>>> 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(at)postgresql(dot)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 transferring
> 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Seong Son (US) 2017-07-31 21:15:18 standby database crash
Previous Message Scott Marlowe 2017-07-31 21:04:11 Re: partitioning question