Re: Use %u to print user mapping's umid and userid

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use %u to print user mapping's umid and userid
Date: 2016-05-10 07:56:50
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2016/05/02 22:06, Robert Haas wrote:
> On Thu, Apr 28, 2016 at 7:59 AM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> On 2016/03/14 17:56, Ashutosh Bapat wrote:
>>> On Mon, Mar 14, 2016 at 1:29 PM, Etsuro Fujita
>>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp <mailto:fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>> wrote:

>>> /*
>>> * Build the fdw_private list that will be available to the
>>> executor.
>>> * Items in the list must match order in enum
>>> FdwScanPrivateIndex.
>>> */
>>> fdw_private = list_make4(makeString(,
>>> retrieved_attrs,
>>> makeInteger(fpinfo->fetch_size),
>>> makeInteger(foreignrel->umid));
>>> I don't think it's correct to use makeInteger for the foreignrel's
>>> umid.

>>> As long as we are using makeInteger() and inVal() pair to set and
>>> extract the values, it should be fine.

>> Yeah, but my concern about this is eg, print plan if debugging (ie,
>> debug_print_plan=on); the umid OID will be printed with the %ld specifier,
>> so in some platform, the OID might be printed wrongly. Maybe I'm missing
>> something, though.

> That seems like a legitimate, if minor, complaint.

Here is a patch to fix this. That is basically the same as in [1], but
I rebased the patch against HEAD and removed list_make5 and its friends,
which were added just for the postgres_fdw DML pushdown.

Sorry for the delay. I was on vacation.

Best regards,
Etsuro Fujita


Attachment Content-Type Size
postgres-fdw-umid-v2.patch text/x-diff 5.8 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2016-05-10 08:29:15 Re: what to revert
Previous Message Andres Freund 2016-05-10 07:05:40 Re: HeapTupleSatisfiesToast() busted? (was atomic pin/unpin causing errors)