Re: [HACKERS] If subscription to foreign table valid ? - Mailing list pgsql-hackers

From Neha Khatri
Subject Re: [HACKERS] If subscription to foreign table valid ?
Date
Msg-id CAFO0U+-XxEjQp2m27kY7rey2gKSqxFdtm+LZVuT3NQasRuaDWQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] If subscription to foreign table valid ?  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Responses Re: [HACKERS] If subscription to foreign table valid ?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers


On Fri, May 12, 2017 at 11:58 PM, Petr Jelinek <petr.jelinek@2ndquadrant.com> wrote:
On 11/05/17 15:43, Petr Jelinek wrote:
> Hi,

>
> We do check for this, but only during replication which we have to do
> because the fact that relation 't' was foreign table during ALTER
> SUBSCRIPTION does not mean that it won't be something else half hour later.
>
> I think it does make sense to add check for this into CREATE/ALTER
> SUBSCRIBER though so that user is informed immediately about the mistake
> rather than by errors in the logs later.
>
> I'll look into writing patch for this. I don't think it's beta blocker
> though.
>

So I moved the relkind check to single function and call it from all the
necessary places. See the attached


With this patch the error will be like this:

  logical replication target relation public.t is not a table

But it is possible that the referred table is Foreign Table of Partitioned table (so actually the referred object is indeed a table).
Would it make sense to specify in the message that the table is not a normal table or something in that line? 

Regards,
Neha

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: [HACKERS] [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Next
From: Noah Misch
Date:
Subject: Re: [HACKERS] Removal of plaintext password type references