pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix plpgsql to re-look-up composite type names at need.
Date: Fri, 16 Aug 2019 11:06:42 -0400
Message-ID: <20624.1565968002@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFj8pRDri7xNi6uN4aEvSedEuwKTQJid3=Zh3n9EU-AaPq7NjQ@mail.gmail.com>
References: <E1hyLK3-0003xy-VJ@gemulon.postgresql.org>
	<CAFj8pRDri7xNi6uN4aEvSedEuwKTQJid3=Zh3n9EU-AaPq7NjQ@mail.gmail.com>

Pavel Stehule <pavel.stehule@gmail.com> writes:
> čt 15. 8. 2019 v 21:22 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
>> I'm slightly hesitant to back-patch this into v11, because it changes
>> the contents of struct PLpgSQL_type as well as the signature of
>> plpgsql_build_datatype(), so in principle it could break code that is
>> poking into the innards of plpgsql.  However, the only popular extension
>> of that ilk is pldebugger, and it doesn't seem to be affected.  Since
>> this is a regression for people who were relying on the old behavior,
>> it seems worth taking the small risk of causing compatibility issues.

> this change breaks compilation plpgsql_check extension.

plpgsql_check?  Why would that need to call plpgsql_build_datatype?

> Backpatching changed plpgsql_build_datatype was not good idea. Now, I have
> not a idea how to ensure compilation on 11 and higher
> Can you add some symbol to source code, so four parameters of
> plpgsql_build_datatype should be used?

That wouldn't help you much, because it would only tell you which
version you were compiling against, not what you were executing in.

You might be best off to put your own copy of the new version of
plpgsql_build_datatype into the v11 extension, and call that all
the time.  When executing in an older server, it would generate
structs with some extra fields that plpgsql wouldn't use, but
that shouldn't hurt anything.  (You could likely get away with
setting the new fields to nulls/zeroes even for composite types,
shortening your extra code a bit.  They'd only matter for
compiled trees that survive across queries, which I imagine
plpgsql_check doesn't need to deal with.)

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <20624.1565968002@sss.pgh.pa.us>
Permalink:  ../20624.1565968002@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20624.1565968002@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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com
  Subject: Re: pgsql: Fix plpgsql to re-look-up composite type names at need.
  In-Reply-To: <20624.1565968002@sss.pgh.pa.us>
  References: <E1hyLK3-0003xy-VJ@gemulon.postgresql.org> <CAFj8pRDri7xNi6uN4aEvSedEuwKTQJid3=Zh3n9EU-AaPq7NjQ@mail.gmail.com> <20624.1565968002@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