Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: Desc Commna...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3421 of 3799
Post > Topic >>

Re: Desc Commnad in pgsql?

by tjo@[EMAIL PROTECTED] ("TJ O'Donnell") Apr 20, 2008 at 05:14 PM

I like the table and other info from psql
and find I sometimes need that info in my client programs.
Are there any SQL/plpgsql functions that are analogous
to the psql \dt, \ds, etc. commands?
For example
create function d_table(table_name text) returns setof record
that could be used in SQL commands in client programs?
I am not concerned whether these are compatible with other
RDBMS.

TJ O'Donnell
http://www.gnova.com

> 
> If you're looking for ways to "describe" a table, there are two
> mechanisms:
> 
>   1.  SQL standard (probably SQL:1993) describes an
>   "information_schema" which contains tables or views that allow
>   querying database metadata in a fairly standard fa****on.
> 
>   PostgreSQL sup****ts that.
> 
>   2.  Probably easier and friendlier, albeit non****table, is to use
>   the psql "\d" command.
> 
 > >>
>> For instance:
>> \dt will list all tables
>> \ds will list all sequences
>> \dv will list all views
>> and there's a further cast of ~20 variants for various different sorts
>> of objects.


-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 2 Posts in Topic:
Re: Desc Commnad in pgsql?
tjo@[EMAIL PROTECTED] (&  2008-04-20 17:14:03 
Re: Desc Commnad in pgsql?
alvherre@[EMAIL PROTECTED  2008-04-21 09:36:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 22:14:26 CST 2008.