Re: Support EXCEPT for TABLES IN SCHEMA publications - Mailing list pgsql-hackers

From Zsolt Parragi
Subject Re: Support EXCEPT for TABLES IN SCHEMA publications
Date
Msg-id CAN4CZFM9xXkw8FvHOTan+m4rASSoxbJTWXMbZ_-v2M-84w5Wzg@mail.gmail.com
Whole thread
In response to Re: Support EXCEPT for TABLES IN SCHEMA publications  (Nisha Moond <nisha.moond412@gmail.com>)
Responses Re: Support EXCEPT for TABLES IN SCHEMA publications
List pgsql-hackers
Hello

In this simple script:

CREATE SCHEMA s;
CREATE TABLE s.a(i int);
CREATE TABLE s.b(i int);
CREATE PUBLICATION p FOR TABLES IN SCHEMA s EXCEPT (TABLE s.b);

SELECT * FROM pg_publication_tables WHERE pubname = 'p';
SELECT * FROM pg_get_publication_tables(ARRAY['p'], 's.b'::regclass);

Shouldn't the second select return an empty list? Currently it returns
one row for s.b.

And I think there's also a bug with CREATE PUBLICATION with IN SCHEMA
CURRENT_SCHEMA:

CREATE SCHEMA s1;
CREATE TABLE s1.a(i int);
CREATE TABLE public.x(i int);
CREATE TABLE public.onlypub(i int);   -- exists only in public, not in s1

CREATE PUBLICATION pn FOR TABLES IN SCHEMA s1 EXCEPT (TABLE public.x);
-- error out, good
SET search_path = s1, public;
CREATE PUBLICATION pn2 FOR TABLES IN SCHEMA s1 EXCEPT (TABLE onlypub);
-- error out, good
SET search_path = s1, public;
SELECT current_schema(); -- s1
CREATE PUBLICATION pc FOR TABLES IN SCHEMA CURRENT_SCHEMA EXCEPT
(TABLE public.x); -- doesn't error out
CREATE PUBLICATION pc4 FOR TABLES IN SCHEMA CURRENT_SCHEMA EXCEPT
(TABLE onlypub); -- also doesn't error out



pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: Vacuumlo improvements
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Fix libxml leaks in contrib/xml2 XPath functions