Skip site navigation (1) Skip section navigation (2)

Re: Table definition

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruno Prévost <bp(at)interaction(dot)ws>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Table definition
Date: 2004-11-16 16:13:34
Message-ID: 200411161713.34830.peter_e@gmx.net (view raw or flat)
Thread:
Lists: pgsql-sql
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/

In response to

Responses

pgsql-sql by date

Next:From: Bruno PrévostDate: 2004-11-16 16:49:11
Subject: Re: Table definition
Previous:From: Bruno PrévostDate: 2004-11-16 15:40:03
Subject: Re: Table definition

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group