From: Tom Lane <tgl@sss.pgh.pa.us>
To: Saul, Jean Paolo <paolo.saul@verizonconnect.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: [BUG?] Missing OID column from pl/pgsql record
Date: Mon, 15 Jul 2019 22:50:28 -0400
Message-ID: <505.1563245428@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+73ANes0gK9vgmq4=-fD5OzCEGxK2c4iAQjwwo3CP0uK0XbOg@mail.gmail.com>
References: <CA+73ANes0gK9vgmq4=-fD5OzCEGxK2c4iAQjwwo3CP0uK0XbOg@mail.gmail.com>
"Saul, Jean Paolo" <paolo.saul@verizonconnect.com> writes:
> We recently upgraded to PostgreSQL 11. We have discovered an undocumented
> (or well-hidden) new behavior in pl/pgSQL.
> SELECT * INTO record variable does not include the OID column any more. All
> other system columns are still stored in the record variable.
Hmmm. TBH I think it's quite an accidental implementation artifact that
any of the underlying table's system columns get transmitted into the
record variable. It seems to happen only if you write exactly "select *",
or the table's exact column list, which probably means that it's tied
to the "physical tlist" optimization that the planner applies in such
cases. And that likely means it'll stop happening if there are any
dropped columns, to mention just one non-obvious problem case.
Between that and the fact that OID system columns are going away
entirely in v12, it's hard to muster any enthusiasm to mess with this.
I'd suggest explicitly selecting the OID, as you did in your non-failing
example.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, paolo.saul@verizonconnect.com
Subject: Re: [BUG?] Missing OID column from pl/pgsql record
In-Reply-To: <505.1563245428@sss.pgh.pa.us>
References: <CA+73ANes0gK9vgmq4=-fD5OzCEGxK2c4iAQjwwo3CP0uK0XbOg@mail.gmail.com> <505.1563245428@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