Re: Looking for "proper" escape string syntax from pg_get_constraintdef - Mailing list pgsql-general

From Tom Lane
Subject Re: Looking for "proper" escape string syntax from pg_get_constraintdef
Date
Msg-id 2538.1251733240@sss.pgh.pa.us
Whole thread Raw
In response to Looking for "proper" escape string syntax from pg_get_constraintdef  (Marc Munro <marc@bloodnok.com>)
List pgsql-general
Marc Munro <marc@bloodnok.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

pgsql-general by date:

Previous
From: Marc Munro
Date:
Subject: Looking for "proper" escape string syntax from pg_get_constraintdef
Next
From: David Kerr
Date:
Subject: Re: Audit Trigger puzzler