Re: Weird constraint output - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: Weird constraint output
Date
Msg-id 3F4F0E09.1000004@pse-consulting.de
Whole thread Raw
In response to Re: Weird constraint output  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne wrote:

>I have changed psql to use pg_get_viewdef(oid, true).  I agree with Tom for
>not using it in dumps just yet though.
>
While there still might be a pg_dump option to do this.

>Is there a function for getting nice constraint defs?
>
Of course there is, use pg_get_constraintdef(text, bool) for this.
pg_get_constraintdef(text, bool)
pg_get_expr(text, oid, bool)
pg_get_indexdef(text, int4, bool)
pg_get_ruledef(text, bool)
pg_get_viewdef(text, bool)
all have the pretty-print bool. Note that pg_get_indexdef's second 
parameter selects if the complete definition is returned (=0) or only 
that column's definition.

Regards,
Andreas





pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: ALTER TABLE
Next
From: Giuseppe Tanzilli - CSF
Date:
Subject: pgsql 7.4b2 bug on column defaults?