A safe way to upgrade table definitions by using ALTER's

From: Sergey Samokhin <prikrutil(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: A safe way to upgrade table definitions by using ALTER's
Date: 2009-08-27 20:42:59
Message-ID: e42595410908271342g53c7350fva922794827e079a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

As I know upgrading database structure from one version to another is
usually done by applying some sql-script with a set of ALTER's that do
all the work.

But how do programmers guarantee that ALTER's they have wrote will
always be applied by administrators to the corresponding version of
the database?

Is there a standard way to store some kind of metainformation in DB
(like version of the current definitions of tables) and then check if
it is too old for being upgraded by a given script?

By "database structure" I mean definition of tables an application
uses (data types, constraints, modificators etc), stored procedures
etc.

Thanks.

--
Sergey Samokhin

P.S. If there is other convinient way to do upgrades which I've missed
- please let me know. I'm still a novice in the PostgreSQL/SQL world.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sean Foreman 2009-08-27 20:48:34 Re: query that worked in 8.1 not working in 8.4
Previous Message Tom Lane 2009-08-27 20:37:04 Re: query that worked in 8.1 not working in 8.4