pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Bryn Llewellyn <bryn@yugabyte.com>
To: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Two questions about "pg_constraint"
Date: Wed, 24 Aug 2022 13:17:20 -0700
Message-ID: <18c9f65f-2487-e3ff-fefb-2133805e0d42@aklaver.com> (raw)
In-Reply-To: <496793CE-A048-434B-ABC0-6BFC0C65C3EC@yugabyte.com>
References: <496793CE-A048-434B-ABC0-6BFC0C65C3EC@yugabyte.com>

On 8/24/22 13:11, Bryn Llewellyn wrote:
> *Question 1: why does "pg_constraint" have a "connamespace" column?*
> 

> What do you think?
> 
> *Question 2: what happened to the column "consrc"?*
> 
> The PG 11 account of "pg_constraint"
> https://www.postgresql.org/docs/11/catalog-pg-constraint.html 
> <https://www.postgresql.org/docs/11/catalog-pg-constraint.html;
> 
> describes "consrc" (text) thus:
> 
> « If a check constraint, a human-readable representation of the expression »
> 
> Ad hoc queries in my PG 11.9 env show results like « (v = lower(v)) » in 
> this column for my tables. This is useful information. But the PG 14 
> version of "pg_constraint" has no such column (and nor does the doc 
> mention it). Is this information now exposed somewhere else?
> 

It was in 11 but not later, so lets look at release notes from 12 --> 14

Here in 12:

"

Remove obsolete pg_constraint.consrc column (Peter Eisentraut)

This column has been deprecated for a long time, because it did not 
update in response to other catalog changes (such as column renamings). 
The recommended way to get a text version of a check constraint's 
expression from pg_constraint is pg_get_expr(conbin, conrelid). 
pg_get_constraintdef() is also a useful alternative.
"

-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (16+ messages)  latest in thread

Message-ID: <18c9f65f-2487-e3ff-fefb-2133805e0d42@aklaver.com>
Permalink:  ../18c9f65f-2487-e3ff-fefb-2133805e0d42@aklaver.com/
Also on:    postgresql.org/message-id/18c9f65f-2487-e3ff-fefb-2133805e0d42@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, bryn@yugabyte.com
  Subject: Re: Two questions about "pg_constraint"
  In-Reply-To: <18c9f65f-2487-e3ff-fefb-2133805e0d42@aklaver.com>
  References: <496793CE-A048-434B-ABC0-6BFC0C65C3EC@yugabyte.com> <18c9f65f-2487-e3ff-fefb-2133805e0d42@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox