pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRetrieving Definition for Composite Type
4+ messages / 3 participants
[nested] [flat]
* Retrieving Definition for Composite Type
@ 2003-03-12 22:01 Jordan S. Jones <list@racistnames.com>
0 siblings, 0 replies; 4+ messages in thread
From: Jordan S. Jones @ 2003-03-12 22:01 UTC (permalink / raw)
To: pgsql-sql
^ permalink raw reply [nested|flat] 4+ messages in thread
* Retrieving Definition for Composite Type
@ 2003-03-13 19:32 Jordan S. Jones <list@racistnames.com>
0 siblings, 2 replies; 4+ messages in thread
From: Jordan S. Jones @ 2003-03-13 19:32 UTC (permalink / raw)
To: pgsql-sql
Hey...
Basically, I need the SQL equivalent of psql's "\d composite_type"
Any help would be greatly appreciated..
Jordan S. Jones
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Retrieving Definition for Composite Type
@ 2003-03-13 22:20 jasiek@klaster.net
parent: Jordan S. Jones <list@racistnames.com>
1 sibling, 0 replies; 4+ messages in thread
From: jasiek@klaster.net @ 2003-03-13 22:20 UTC (permalink / raw)
To: Jordan S. Jones <list@racistnames.com>; +Cc: pgsql-sql
On Thu, Mar 13, 2003 at 12:32:10PM -0700, Jordan S. Jones wrote:
> Hey...
>
> Basically, I need the SQL equivalent of psql's "\d composite_type"
>
> Any help would be greatly appreciated..
>
> Jordan S. Jones
man psql
Use psql to find all SQL equivalents.
If you run psql with -E, you will be able to read all of SQL queries
psql executes.
Regards,
Tomasz Myrta
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Retrieving Definition for Composite Type
@ 2003-03-13 22:37 Joe Conway <mail@joeconway.com>
parent: Jordan S. Jones <list@racistnames.com>
1 sibling, 0 replies; 4+ messages in thread
From: Joe Conway @ 2003-03-13 22:37 UTC (permalink / raw)
To: list@racistnames.com; +Cc: pgsql-sql
Jordan S. Jones wrote:
> Basically, I need the SQL equivalent of psql's "\d composite_type"
Start psql with the -E option, and you can see all the internally
generated queries. E.g (ex1_tup is a composite type):
psql -E regression
[snipped all the startup stuff]
regression=# \d ex1_tup
********* QUERY **********
SELECT c.oid,
n.nspname,
c.relname
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE pg_catalog.pg_table_is_visible(c.oid)
AND c.relname ~ '^ex1_tup$'
ORDER BY 2, 3;
**************************
********* QUERY **********
SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules
FROM pg_catalog.pg_class WHERE oid = '1336877'
**************************
********* QUERY **********
SELECT a.attname,
pg_catalog.format_type(a.atttypid, a.atttypmod),
(SELECT substring(d.adsrc for 128) FROM pg_catalog.pg_attrdef d
WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef),
a.attnotnull, a.attnum
FROM pg_catalog.pg_attribute a
WHERE a.attrelid = '1336877' AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
**************************
Composite type "public.ex1_tup"
Column | Type
---------+------
relname | name
colname | name
HTH,
Joe
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2003-03-13 22:37 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-12 22:01 Retrieving Definition for Composite Type Jordan S. Jones <list@racistnames.com>
2003-03-13 19:32 Retrieving Definition for Composite Type Jordan S. Jones <list@racistnames.com>
2003-03-13 22:20 ` jasiek@klaster.net
2003-03-13 22:37 ` Joe Conway <mail@joeconway.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox