pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ivan Sergio Borgonovo <mail@webthatworks.it>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: porting horde to Postgresql 12, dropped pg_attrdef
Date: Fri, 15 Nov 2019 10:16:59 -0500
Message-ID: <26370.1573831019@sss.pgh.pa.us> (raw)
In-Reply-To: <a6359855-2a5e-a56c-ebba-4ea46a1f0ebe@webthatworks.it>
References: <a6359855-2a5e-a56c-ebba-4ea46a1f0ebe@webthatworks.it>

Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> Horde (webmail and more) is not anymore compatible with postgresql 12 
> after pg_attrdef was dropped.

We didn't drop the whole catalog, just the adsrc column, which has been
deprecated for ages (because it didn't update to track, eg, column
renamings).  The correct substitute for adsrc is

pg_get_expr(adbin,adrelid)

which reconstructs an up-to-date text form from the authoritative
data.

I see that the v12 release notes fail to suggest this replacement,
which seems unhelpful ... I'll go add that.

Having said that, it looks like query (1) should never have been
written like this in the first place --- trying to pull bits out
of the text representation of a default expression seems horribly
fragile.  I think what it's trying to do is identify serial columns?
The right way to do that is to look for pg_depend entries that link
a serial sequence to its owning column.  I don't have an example
right to hand, but I'm sure there is an instance in pg_dump, and
probably elsewhere.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <26370.1573831019@sss.pgh.pa.us>
Permalink:  ../26370.1573831019@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26370.1573831019@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, mail@webthatworks.it
  Subject: Re: porting horde to Postgresql 12, dropped pg_attrdef
  In-Reply-To: <26370.1573831019@sss.pgh.pa.us>
  References: <a6359855-2a5e-a56c-ebba-4ea46a1f0ebe@webthatworks.it> <26370.1573831019@sss.pgh.pa.us>

* 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