am Wed, dem 23.07.2008, um 10:32:58 +0200 mailte Maximilian Tyrtania folgendes: > Hi there, just a quickie: Is there a way to select all default values of a > given table? Something like "Select Default values from sometable" ? > Unfortunately this syntax doesn't seem to be supported. I know i can select > the default values for each column, but being able to select them in one go > would be handy...
test=# create table t_with_defaults( s1 int default 1, s2 int default 2); CREATE TABLE test=*# select ordinal_position, column_name, column_default from information_schema.columns where table_name='t_with_defaults' order by 1; ordinal_position | column_name | column_default ------------------+-------------+---------------- 1 | s1 | 1 2 | s2 | 2 (2 rows) HTH, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql