Re: Implement IF NOT EXISTS for CREATE PUBLICATION AND CREATE SUBSCRIPTION - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Implement IF NOT EXISTS for CREATE PUBLICATION AND CREATE SUBSCRIPTION
Date
Msg-id 1461574.1678642075@sss.pgh.pa.us
Whole thread Raw
In response to Implement IF NOT EXISTS for CREATE PUBLICATION AND CREATE SUBSCRIPTION  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
vignesh C <vignesh21@gmail.com> writes:
> Currently we don't support "IF NOT EXISTS" for Create publication and
> Create subscription, I felt it would be useful to add this "IF NOT
> EXISTS" which will create publication/subscription only if the object
> does not exist.
> Attached patch for handling the same.
> Thoughts?

I generally dislike IF NOT EXISTS options, because they are so
semantically squishy: when the command is over, you cannot make any
assumptions whatsoever about the properties of the object, beyond
the bare fact that it exists.  I do not think we should implement
such options without a pretty compelling argument that there is a
use-case for them.  "I felt it would be useful" doesn't meet the
bar IMO.

CREATE OR REPLACE doesn't have this semantic problem, but I'm not
sure whether it's a useful approach for these types of objects.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: POC: Lock updated tuples in tuple_update() and tuple_delete()
Next
From: Bharath Rupireddy
Date:
Subject: Re: Improve WALRead() to suck data directly from WAL buffers when possible