On Wed, Jun 12, 2013 at 4:00 PM, Peter Eisentraut <pete...@gmx.net> wrote: > > > I'm wondering where "IF NOT EXISTS" and "OR REPLACE" will meet. > > For example, why doesn't your list include CREATE FUNCTION? > > I have on my personal todo list to add "OR REPLACE" support to CREATE > AGGREGATE and CREATE OPERATOR. They are kind of like functions, after > all, and CREATE OR REPLACE FUNCTION is clearly widely useful. > > I suppose both could be useful, but if we're going to make sweeping > changes, perhaps that should be clarified. >
I did not include "CREATE FUNCTION" precisely because I had the same doubts. IMO the "IF NOT EXISTS" and "OR REPLACE" are differents, and can coexists in the same statements but not used at the same time: CREATE [ OF REPLACE | IF NOT EXISTS ] FUNCTION ... I can use "IF NOT EXISTS" to "CREATE" a {FUNCTION | AGGREGATE | OPERATOR} without replace (OR REPLACE) its definition to just create missing objects and don't raise an exception if already exists. > Btw., I also want REPLACE BUT DO NOT CREATE. Can you explain more about it? Regards, -- 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