Re: [PATCH] Add pretty formatting to pg_get_triggerdef - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Add pretty formatting to pg_get_triggerdef
Date
Msg-id 876011.1762370969@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Add pretty formatting to pg_get_triggerdef  (Philip Alger <paalger0@gmail.com>)
List pgsql-hackers
Philip Alger <paalger0@gmail.com> writes:
> I am attaching v3.

This patch will cause psql's \d to fail hard against any pre-v19
server.  That's not acceptable.  Note the comment at the top of
describe.c:

 * Support for the various \d ("describe") commands.  Note that the current
 * expectation is that all functions in this file will succeed when working
 * with servers of versions 9.2 and up.  It's okay to omit irrelevant
 * information for an old server, but not to fail outright.  (But failing
 * against a pre-9.2 server is allowed.)

You could get around that with a conditional on the server version,
as is done elsewhere in describe.c.  But I kind of wonder why we
need this new function at all.  Isn't "pg_get_triggerdef(oid, false)"
close enough?

An alternative suggestion is to keep "pg_get_triggerdef(oid, true)"
doing exactly what it does today and have the newly-introduced
function be the one that has new behavior.  This might be a smarter
plan anyway to avoid side-swiping other clients that are expecting
the current behavior.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Matheus Alcantara"
Date:
Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Next
From: Masahiko Sawada
Date:
Subject: Re: inconsistent tableoid handling in COPY WHERE clause