Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
Date: 2013-06-19 03:45:36
Message-ID: CAFcNs+pQrD+oBkEarfRUNNbfWAnUtSCJT6r6tT9mthT=yPweVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 17, 2013 at 11:33 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>
> Replace/alter the object if it already exists, but fail if it does not
> exist.
>
> The complete set of variants is:
>
> - object does not exist:
>
> - proceed (normal CREATE)
> - error (my above description)
>
> - object exists:
>
> - replace (CREATE OR REPLACE)
> - skip (CREATE IF NOT EXISTS)
> - error (normal CREATE)
>

I understood.

The syntax can be like that?
- CREATE [ OR REPLACE | IF NOT EXISTS ] AGGREGATE ...
- CREATE [ OR REPLACE | IF NOT EXISTS ] OPERATOR ...
- CREATE [ OR REPLACE | IF NOT EXISTS ] FUNCTION ...

I can add this features too, but IMHO it is more prudent at this CF we just
implement the IF NOT EXISTS according the initial proposal.

I'm planning another patch do next CF to add support to "IF NOT EXISTS" to
others "CREATE" statements. See my planning [1].

Regards,

[1]
https://docs.google.com/spreadsheet/ccc?key=0Ai7oCVcVQiKFdEctQUxNNlR1R2xRTUpJNFNDcFo4MUE&usp=sharing

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2013-06-19 04:12:04 Re: How do we track backpatches?
Previous Message Peter Geoghegan 2013-06-19 03:21:24 Re: Vacuum, Freeze and Analyze: the big picture