public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v5 3/5] Test ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION
7+ messages / 5 participants
[nested] [flat]

* [PATCH v5 3/5] Test ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION
@ 2021-02-13 05:49 Japin Li <[email protected]>
  0 siblings, 0 replies; 7+ messages in thread

From: Japin Li @ 2021-02-13 05:49 UTC (permalink / raw)

---
 src/test/regress/expected/subscription.out | 36 ++++++++++++++++++++++
 src/test/regress/sql/subscription.sql      | 28 +++++++++++++++++
 2 files changed, 64 insertions(+)

diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out
index 14a430221d..eaffe1351f 100644
--- a/src/test/regress/expected/subscription.out
+++ b/src/test/regress/expected/subscription.out
@@ -200,6 +200,42 @@ ALTER SUBSCRIPTION regress_testsub SET (slot_name = NONE);
  regress_testsub | regress_subscription_user | f       | {testpub}   | f      | f         | off                | dbname=regress_doesnotexist
 (1 row)
 
+-- fail - publication already exists
+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub WITH (refresh = false);
+ERROR:  publication name "testpub" is already in subscription
+-- ok - add two publications into subscription
+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub1, testpub2 WITH (refresh = false);
+-- fail - publications already exist
+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub1, testpub2 WITH (refresh = false);
+ERROR:  publication names "testpub1, testpub2" are already in subscription
+\dRs+
+                                                                    List of subscriptions
+      Name       |           Owner           | Enabled |         Publication         | Binary | Streaming | Synchronous commit |          Conninfo           
+-----------------+---------------------------+---------+-----------------------------+--------+-----------+--------------------+-----------------------------
+ regress_testsub | regress_subscription_user | f       | {testpub,testpub1,testpub2} | f      | f         | off                | dbname=regress_doesnotexist
+(1 row)
+
+-- fail - all publications are deleted
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub, testpub1, testpub2 WITH (refresh = false);
+ERROR:  subscription must contain at least one publication
+-- fail - the deleted publication does not in subscription
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub3 WITH (refresh = false);
+ERROR:  publication name "testpub3" does no exist in subscription
+-- fail - the deleted publications do not in subscription
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub3, testpub4 WITH (refresh = false);
+ERROR:  publication names "testpub3, testpub4" do no exist in subscription
+-- fail - do not support copy_data option
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub1 WITH (refresh = false, copy_data = true);
+ERROR:  unrecognized subscription parameter: "copy_data"
+-- ok - delete publications
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub1, testpub2 WITH (refresh = false);
+\dRs+
+                                                            List of subscriptions
+      Name       |           Owner           | Enabled | Publication | Binary | Streaming | Synchronous commit |          Conninfo           
+-----------------+---------------------------+---------+-------------+--------+-----------+--------------------+-----------------------------
+ regress_testsub | regress_subscription_user | f       | {testpub}   | f      | f         | off                | dbname=regress_doesnotexist
+(1 row)
+
 DROP SUBSCRIPTION regress_testsub;
 CREATE SUBSCRIPTION regress_testsub CONNECTION 'dbname=regress_doesnotexist' PUBLICATION mypub
        WITH (connect = false, create_slot = false, copy_data = false);
diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql
index 81e65e5e64..746a589a8e 100644
--- a/src/test/regress/sql/subscription.sql
+++ b/src/test/regress/sql/subscription.sql
@@ -145,6 +145,34 @@ ALTER SUBSCRIPTION regress_testsub SET (slot_name = NONE);
 
 \dRs+
 
+-- fail - publication already exists
+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub WITH (refresh = false);
+
+-- ok - add two publications into subscription
+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub1, testpub2 WITH (refresh = false);
+
+-- fail - publications already exist
+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub1, testpub2 WITH (refresh = false);
+
+\dRs+
+
+-- fail - all publications are deleted
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub, testpub1, testpub2 WITH (refresh = false);
+
+-- fail - the deleted publication does not in subscription
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub3 WITH (refresh = false);
+
+-- fail - the deleted publications do not in subscription
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub3, testpub4 WITH (refresh = false);
+
+-- fail - do not support copy_data option
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub1 WITH (refresh = false, copy_data = true);
+
+-- ok - delete publications
+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub1, testpub2 WITH (refresh = false);
+
+\dRs+
+
 DROP SUBSCRIPTION regress_testsub;
 
 CREATE SUBSCRIPTION regress_testsub CONNECTION 'dbname=regress_doesnotexist' PUBLICATION mypub
-- 
2.25.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=v5-0004-Add-documentation-for-ALTER-SUBSCRIPTION.ADD-DROP.patch



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Remove support for old realpath() API
@ 2024-08-05 07:41 Heikki Linnakangas <[email protected]>
  2024-08-05 14:08 ` Re: Remove support for old realpath() API Tom Lane <[email protected]>
  2024-08-12 06:17 ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
  0 siblings, 2 replies; 7+ messages in thread

From: Heikki Linnakangas @ 2024-08-05 07:41 UTC (permalink / raw)
  To: Peter Eisentraut <[email protected]>; pgsql-hackers

On 05/08/2024 09:12, Peter Eisentraut wrote:
> The now preferred way to call realpath() is by passing NULL as the
> second argument and get a malloc'ed result.  We still supported the
> old way of providing our own buffer as a second argument, for some
> platforms that didn't support the new way yet.  Those were only
> Solaris less than version 11 and some older AIX versions (7.1 and
> newer appear to support the new variant).  We don't support those
> platforms versions anymore, so we can remove this extra code.

+1

We don't seem to have any mentions of POSIX or SuS in docs, in the 
installation sections. There are a few mentions of POSIX-1.2008 and 
POSIX-1.2001 it in the commit log, though, where we require features 
specified by those. Can we rely on everything from POSIX-1-2008 
nowadays, or is it more on a case-by-case basis, depending on which 
parts of POSIX are supported by various platforms?

-- 
Heikki Linnakangas
Neon (https://neon.tech)







^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Remove support for old realpath() API
  2024-08-05 07:41 Re: Remove support for old realpath() API Heikki Linnakangas <[email protected]>
@ 2024-08-05 14:08 ` Tom Lane <[email protected]>
  1 sibling, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-08-05 14:08 UTC (permalink / raw)
  To: Heikki Linnakangas <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; pgsql-hackers

Heikki Linnakangas <[email protected]> writes:
> We don't seem to have any mentions of POSIX or SuS in docs, in the 
> installation sections. There are a few mentions of POSIX-1.2008 and 
> POSIX-1.2001 it in the commit log, though, where we require features 
> specified by those. Can we rely on everything from POSIX-1-2008 
> nowadays, or is it more on a case-by-case basis, depending on which 
> parts of POSIX are supported by various platforms?

I'd say it's still case-by-case.  Perhaps everything in POSIX-1.2008
is supported now on every platform we care about, but perhaps not.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Remove support for old realpath() API
  2024-08-05 07:41 Re: Remove support for old realpath() API Heikki Linnakangas <[email protected]>
@ 2024-08-12 06:17 ` Peter Eisentraut <[email protected]>
  2024-08-12 06:47   ` Re: Remove support for old realpath() API Thomas Munro <[email protected]>
  1 sibling, 1 reply; 7+ messages in thread

From: Peter Eisentraut @ 2024-08-12 06:17 UTC (permalink / raw)
  To: Heikki Linnakangas <[email protected]>; pgsql-hackers

On 05.08.24 09:41, Heikki Linnakangas wrote:
> On 05/08/2024 09:12, Peter Eisentraut wrote:
>> The now preferred way to call realpath() is by passing NULL as the
>> second argument and get a malloc'ed result.  We still supported the
>> old way of providing our own buffer as a second argument, for some
>> platforms that didn't support the new way yet.  Those were only
>> Solaris less than version 11 and some older AIX versions (7.1 and
>> newer appear to support the new variant).  We don't support those
>> platforms versions anymore, so we can remove this extra code.
> 
> +1

committed







^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Remove support for old realpath() API
  2024-08-05 07:41 Re: Remove support for old realpath() API Heikki Linnakangas <[email protected]>
  2024-08-12 06:17 ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
@ 2024-08-12 06:47   ` Thomas Munro <[email protected]>
  2024-08-12 07:04     ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Thomas Munro @ 2024-08-12 06:47 UTC (permalink / raw)
  To: Peter Eisentraut <[email protected]>; +Cc: Heikki Linnakangas <[email protected]>; pgsql-hackers

On Mon, Aug 12, 2024 at 6:18 PM Peter Eisentraut <[email protected]> wrote:
> On 05.08.24 09:41, Heikki Linnakangas wrote:
> > On 05/08/2024 09:12, Peter Eisentraut wrote:
> >> The now preferred way to call realpath() is by passing NULL as the
> >> second argument and get a malloc'ed result.  We still supported the
> >> old way of providing our own buffer as a second argument, for some
> >> platforms that didn't support the new way yet.  Those were only
> >> Solaris less than version 11 and some older AIX versions (7.1 and
> >> newer appear to support the new variant).  We don't support those
> >> platforms versions anymore, so we can remove this extra code.

I checked this in the AIX 7.3 manual and the POSIX 2008 way does not
appear to be mentioned there:

https://www.ibm.com/docs/en/aix/7.3?topic=r-realpath-subroutine

That's a bit confusing, or maybe there are just too many versioning
systems to keep track of and I've made a mistake, because it looks
like AIX 7.2.5+ has actual certification for Unix V7 AKA SUSv4 AKA
POSIX 2008...  Or maybe the documentation is wrong and it does
actually work.  I guess the IBM crew will be forced to look into this
as they continue to work on their PostgreSQL/AIX patch, if it doesn't
work...






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Remove support for old realpath() API
  2024-08-05 07:41 Re: Remove support for old realpath() API Heikki Linnakangas <[email protected]>
  2024-08-12 06:17 ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
  2024-08-12 06:47   ` Re: Remove support for old realpath() API Thomas Munro <[email protected]>
@ 2024-08-12 07:04     ` Peter Eisentraut <[email protected]>
  2024-08-12 14:05       ` Re: Remove support for old realpath() API Tom Lane <[email protected]>
  0 siblings, 1 reply; 7+ messages in thread

From: Peter Eisentraut @ 2024-08-12 07:04 UTC (permalink / raw)
  To: Thomas Munro <[email protected]>; +Cc: Heikki Linnakangas <[email protected]>; pgsql-hackers

On 12.08.24 08:47, Thomas Munro wrote:
> On Mon, Aug 12, 2024 at 6:18 PM Peter Eisentraut <[email protected]> wrote:
>> On 05.08.24 09:41, Heikki Linnakangas wrote:
>>> On 05/08/2024 09:12, Peter Eisentraut wrote:
>>>> The now preferred way to call realpath() is by passing NULL as the
>>>> second argument and get a malloc'ed result.  We still supported the
>>>> old way of providing our own buffer as a second argument, for some
>>>> platforms that didn't support the new way yet.  Those were only
>>>> Solaris less than version 11 and some older AIX versions (7.1 and
>>>> newer appear to support the new variant).  We don't support those
>>>> platforms versions anymore, so we can remove this extra code.
> 
> I checked this in the AIX 7.3 manual and the POSIX 2008 way does not
> appear to be mentioned there:
> 
> https://www.ibm.com/docs/en/aix/7.3?topic=r-realpath-subroutine
> 
> That's a bit confusing, or maybe there are just too many versioning
> systems to keep track of and I've made a mistake, because it looks
> like AIX 7.2.5+ has actual certification for Unix V7 AKA SUSv4 AKA
> POSIX 2008...  Or maybe the documentation is wrong and it does
> actually work.  I guess the IBM crew will be forced to look into this
> as they continue to work on their PostgreSQL/AIX patch, if it doesn't
> work...

Tom had tested this on and found that it does actually work on AIX 7.1 
and 7.3 but the documentation is wrong.







^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Remove support for old realpath() API
  2024-08-05 07:41 Re: Remove support for old realpath() API Heikki Linnakangas <[email protected]>
  2024-08-12 06:17 ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
  2024-08-12 06:47   ` Re: Remove support for old realpath() API Thomas Munro <[email protected]>
  2024-08-12 07:04     ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
@ 2024-08-12 14:05       ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-08-12 14:05 UTC (permalink / raw)
  To: Peter Eisentraut <[email protected]>; +Cc: Thomas Munro <[email protected]>; Heikki Linnakangas <[email protected]>; pgsql-hackers

Peter Eisentraut <[email protected]> writes:
> On 12.08.24 08:47, Thomas Munro wrote:
>> I checked this in the AIX 7.3 manual and the POSIX 2008 way does not
>> appear to be mentioned there:
>> https://www.ibm.com/docs/en/aix/7.3?topic=r-realpath-subroutine

> Tom had tested this on and found that it does actually work on AIX 7.1 
> and 7.3 but the documentation is wrong.

I too have a distinct recollection of having tested this (using the
gcc compile farm machines), but I cannot find anything saying so in
the mailing list archives.  I can go check it again, I guess.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2024-08-12 14:05 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-13 05:49 [PATCH v5 3/5] Test ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION Japin Li <[email protected]>
2024-08-05 07:41 Re: Remove support for old realpath() API Heikki Linnakangas <[email protected]>
2024-08-05 14:08 ` Re: Remove support for old realpath() API Tom Lane <[email protected]>
2024-08-12 06:17 ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
2024-08-12 06:47   ` Re: Remove support for old realpath() API Thomas Munro <[email protected]>
2024-08-12 07:04     ` Re: Remove support for old realpath() API Peter Eisentraut <[email protected]>
2024-08-12 14:05       ` Re: Remove support for old realpath() API Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox