pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Prévost <bp@interaction.ws>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Table definition
Date: Tue, 16 Nov 2004 11:49:11 -0500
Message-ID: <044a01c4cbfc$330306d0$5d00a8c0@BRUNO2500> (raw)
References: <02ac01c4cbe5$2effc580$5d00a8c0@BRUNO2500>
	<200411161616.48196.peter_e@gmx.net>
	<03bd01c4cbf2$8a8babf0$5d00a8c0@BRUNO2500>
	<200411161713.34830.peter_e@gmx.net>

It could help me, but pg_dump give all foreigns key and index creation.
I'm not sure if it's not better to write a custom function in plpgsql.
Bruno

----- Original Message ----- 
From: "Peter Eisentraut" <peter_e@gmx.net>
To: "Bruno Prévost" <bp@interaction.ws>
Cc: <pgsql-sql@postgresql.org>
Sent: Tuesday, 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 AS '
> #!/bin/sh
> pg_dump -t $1
> ' LANGUAGE plsh;
>
> :)
>
> -- 
> Peter Eisentraut
> http://developer.postgresql.org/~petere/
> 




view thread (7+ messages)

Message-ID: <044a01c4cbfc$330306d0$5d00a8c0@BRUNO2500>
Permalink:  ../044a01c4cbfc$330306d0$5d00a8c0@BRUNO2500/
Also on:    postgresql.org/message-id/044a01c4cbfc$330306d0$5d00a8c0@BRUNO2500

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bp@interaction.ws, peter_e@gmx.net
  Subject: Re: Table definition
  In-Reply-To: <044a01c4cbfc$330306d0$5d00a8c0@BRUNO2500>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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