[SQL] Table definition

2004-11-16 Thread Bruno Prévost
Title: Les consultants Interaction | stationery Hi, Anybody know how to obtain the table definition in text. Something like "select definition from pg_catalog.pg_views where viewname = 'xxx'" but fora table. Thanks Bruno

Re: [SQL] Table definition

2004-11-16 Thread Peter Eisentraut
Am Dienstag, 16. November 2004 15:04 schrieb Bruno Prévost: Anybody know how to obtain the table definition in text. Use pg_dump. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 6: Have you searched our

Re: [SQL] Table definition

2004-11-16 Thread Goutam Paruchuri
out. -Goutam From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno PrévostSent: Tuesday, November 16, 2004 9:04 AMTo: [EMAIL PROTECTED]Subject: [SQL] Table definition Hi, Anybody know how to obtain the table definition in text. Something like "s

Re: [SQL] Table definition

2004-11-16 Thread Sam Mason
Bruno Prévost wrote: Anybody know how to obtain the table definition in text. Not quite sure if this is quite what you're after, but would: $ pg_dump -st foo help at all? It gives out the SQL that you would need to enter to re-create the table. Sam ---(end of

Re: [SQL] Table definition

2004-11-16 Thread Bruno Prévost
I need to use it in sql. Thk Bruno - Original Message - From: Peter Eisentraut [EMAIL PROTECTED] To: Bruno Prévost [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 10:16 AM Subject: Re: [SQL] Table definition Am Dienstag, 16. November 2004 15:04 schrieb Bruno

Re: [SQL] Table definition

2004-11-16 Thread Peter Eisentraut
Am Dienstag, 16. November 2004 16:40 schrieb Bruno Prévost: I need to use it in sql. There is no direct way to do this in SQL, but I can offer you the following alternative: CREATE FUNCTION get_table_definition(text) RETURNS text AS ' #!/bin/sh pg_dump -t $1 ' LANGUAGE plsh; :) -- Peter

Re: [SQL] Table definition

2004-11-16 Thread Bruno Prévost
, November 16, 2004 11:13 AM Subject: Re: [SQL] Table definition Am Dienstag, 16. November 2004 16:40 schrieb Bruno Prévost: I need to use it in sql. There is no direct way to do this in SQL, but I can offer you the following alternative: CREATE FUNCTION get_table_definition(text) RETURNS text