Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements - Mailing list pgsql-hackers

From Abhijit Menon-Sen
Subject Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
Date
Msg-id 20130727023132.GA8383@toroid.org
Whole thread Raw
In response to Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements  (Karol Trzcionka <karlikt@gmail.com>)
Responses Re: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
List pgsql-hackers
At 2013-07-26 10:39:00 +0200, karlikt@gmail.com wrote:
>
> Hello, as I can see there are more inconsistent places.

Right. This is what I was referring to in my original review. All of the
relevant sites (pre-patch) that currently do:
   if (already exists)       ereport(ERROR …)

should instead be made to do:
   if (already exists)   {       if (ifNotExists)       {           ereport(NOTICE …)           return       }
       ereport(ERROR …)   }

or even (very slightly easier to review):
   if (already exists && ifNotExists)   {       ereport(ERROR …)       return   }
   if (already exists)       ereport(ERROR …)

I don't care much which of the two is used, so long as it's (a) the same
everywhere, and (b) there's no "if (!ifNot" anywhere.

-- Abhijit



pgsql-hackers by date:

Previous
From: Lonni J Friedman
Date:
Subject: Re: [GENERAL] postgres FDW cost estimation options unrecognized in 9.3-beta1
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements