Skip site navigation (1) Skip section navigation (2)

Some wayfor checking/updating database/table structure?

From: Libor Vanek <libor(at)conet(dot)cz>
To: pgsql-novice(at)postgresql(dot)org
Subject: Some wayfor checking/updating database/table structure?
Date: 2003-11-26 00:03:14
Message-ID: 3FC3EDC2.9060400@conet.cz (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,
I'm looking for some way which could enable me to say:
- I have database DB_foo
- in this database is table T_bar
- table T_bar has got columns desc with text type and num with integer 
type and default value 10

And if there is for example in T_bar only column "desc" I want to add 
column "num".

Is there some simple way of doing this or must I always list 
tables/columns and manualy check it? I imagine something like:

ALTER TABLE T_bar ADD COLUMN desc text IF NOT EXISTS;



Thanks for comments,
Libor






pgsql-novice by date

Next:From: Markus WallnDate: 2003-11-26 10:05:32
Subject: Collate
Previous:From: Ireneusz KramarzDate: 2003-11-25 20:54:57
Subject: how to create such a function??

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group