[GENERAL] HOWTO: Get a table or database definition

2004-09-10 Thread Google Mike
I guess it would be great if Pgsql had a way to find a database definition via a system stored procedure like other database platforms have. There are two ways I've found so far: SELECT attname as name, typname as type, atttypmod - 4 as size, relhaspkey as is_primary_key, * FROM pg_class

Re: [GENERAL] HOWTO: Get a table or database definition

2004-09-10 Thread Google Mike
One other option, which I had forgotten for a long time, was: \d object name ...which can describe many things, although this doesn't give you the CREATE syntax like a pg_dump can do. Please also note that a pg_dump can dump output to the screen if you don't specify a file, so if you're only

Re: [GENERAL] HOWTO: Get a table or database definition

2004-09-07 Thread Jeff Boes
Google Mike wrote: I guess it would be great if Pgsql had a way to find a database definition via a system stored procedure like other database platforms have. There are a few: nexcerpt=# \df pg_get*def List of functions Result data type | Schema | Name