pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thom Brown <thom@linux.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: Can't read oprcode from remote pg_operator
Date: Tue, 05 Sep 2017 07:57:39 -0400
Message-ID: <19131.1504612659@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA-aLv4y3ixwu2znpa6dNHbf7zNbwa9DGnQiWsLusN7remySRw@mail.gmail.com>
References: <CAA-aLv4y3ixwu2znpa6dNHbf7zNbwa9DGnQiWsLusN7remySRw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Thom Brown <thom@linux.com> writes:
> It seems that, if you have a foreign table pointing to pg_operator in
> another cluster, you cannot return the oprcode column for certain
> rows.  I'm getting this on 10 beta 3.

I don't think that has anything to do with remoteness or not, nor which
PG version you try.  The regproc representation is inherently ambiguous,
so even locally you will get:

regression=# select oprcode::text::regproc from pg_operator;
ERROR:  more than one function named "pg_catalog.tsquery_phrase"

Likewise for, eg, pg_aggregate.aggfnoid.

> I have imported pg_operator using IMPORT FOREIGN SCHEMA,

If that seemed like a widely useful thing to do, I might be more
worried.  But if you want to do this, I'd suggest making a view
over pg_operator that casts the regproc columns to regprocedure,
and then importing that.  Even then, it will fail if the remote
catalog contains references to any functions that don't exist
locally.

We've talked in the past about deprecating regproc/regoper and
converting those columns to the fully qualified types; that
would help the ambiguity part of your issue, though not the
nonexistence part.  But that's blocked on teaching genbki.pl
to do the equivalent of regprocedurein and fill those columns
with numeric OIDs in the BKI file.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (3+ messages)  latest in thread

Message-ID: <19131.1504612659@sss.pgh.pa.us>
Permalink:  ../19131.1504612659@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19131.1504612659@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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thom@linux.com
  Subject: Re: Can't read oprcode from remote pg_operator
  In-Reply-To: <19131.1504612659@sss.pgh.pa.us>
  References: <CAA-aLv4y3ixwu2znpa6dNHbf7zNbwa9DGnQiWsLusN7remySRw@mail.gmail.com> <19131.1504612659@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