Re: Looking for "proper" escape string syntax from pg_get_constraintdef

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marc(at)bloodnok(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for "proper" escape string syntax from pg_get_constraintdef
Date: 2009-08-31 15:40:40
Message-ID: 2538.1251733240@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marc Munro <marc(at)bloodnok(dot)com> writes:
> but retrieving the constraint definition using pg_get_constraintdef(oid)
> gives me this:

> CHECK (((VALUE ~ '^\\d{4}$'::text) OR (VALUE ~ '^\\d{5}-\\d{4}$'::text)))

> How can I get the constraint definition with proper escaping from the
> catalog? Is there another function I should be using?

pg_dump just turns off that warning. The string is correct for the
prevailing value of standard_conforming_strings; the warning is useless
noise as long as you're careful about maintaining that setting.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Kerr 2009-08-31 15:48:24 Re: Audit Trigger puzzler
Previous Message Marc Munro 2009-08-31 15:31:55 Looking for "proper" escape string syntax from pg_get_constraintdef