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

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 (view raw or flat)
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

pgsql-general by date

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

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