Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-11-06 Thread Fabrízio de Royes Mello
On Thu, Nov 6, 2014 at 7:49 AM, Fujii Masao wrote: > > On Sat, Nov 1, 2014 at 1:56 AM, Fabrízio de Royes Mello > wrote: > > > > On Fri, Oct 31, 2014 at 2:46 PM, Adam Brightwell > > wrote: > >> > >> All, > >> > >> FWIW, I've cleanly applied v8 of this patch to master (252e652) and > >> check-worl

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-11-06 Thread Fujii Masao
On Sat, Nov 1, 2014 at 1:56 AM, Fabrízio de Royes Mello wrote: > > On Fri, Oct 31, 2014 at 2:46 PM, Adam Brightwell > wrote: >> >> All, >> >> FWIW, I've cleanly applied v8 of this patch to master (252e652) and >> check-world was successful. I also successfully ran through a few manual >> test ca

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-31 Thread Fabrízio de Royes Mello
On Fri, Oct 31, 2014 at 2:46 PM, Adam Brightwell < adam.brightw...@crunchydatasolutions.com> wrote: > > All, > > FWIW, I've cleanly applied v8 of this patch to master (252e652) and check-world was successful. I also successfully ran through a few manual test cases. > Thanks for your review! Rega

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-31 Thread Adam Brightwell
All, FWIW, I've cleanly applied v8 of this patch to master (252e652) and check-world was successful. I also successfully ran through a few manual test cases. -Adam -- Adam Brightwell - adam.brightw...@crunchydatasolutions.com Database Engineer - www.crunchydatasolutions.com

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-30 Thread Fabrízio de Royes Mello
On Thu, Oct 30, 2014 at 12:11 PM, Fujii Masao wrote: > > On Tue, Oct 7, 2014 at 2:42 AM, Fabrízio de Royes Mello > wrote: > > On Mon, Oct 6, 2014 at 11:13 AM, Marti Raudsepp wrote: > >> > >> On Mon, Oct 6, 2014 at 4:27 PM, Fabrízio de Royes Mello > >> wrote: > >> > create_index_if_not_exists_v7

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-30 Thread Fujii Masao
On Tue, Oct 7, 2014 at 2:42 AM, Fabrízio de Royes Mello wrote: > On Mon, Oct 6, 2014 at 11:13 AM, Marti Raudsepp wrote: >> >> On Mon, Oct 6, 2014 at 4:27 PM, Fabrízio de Royes Mello >> wrote: >> > create_index_if_not_exists_v7.patch >> >> Looks good to me. Marking ready for committer. >> > > Tha

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-06 Thread Fabrízio de Royes Mello
On Mon, Oct 6, 2014 at 11:13 AM, Marti Raudsepp wrote: > > On Mon, Oct 6, 2014 at 4:27 PM, Fabrízio de Royes Mello > wrote: > > create_index_if_not_exists_v7.patch > > Looks good to me. Marking ready for committer. > Thanks. > If you have any feedback about my reviews, I would gladly hear it.

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-06 Thread Marti Raudsepp
On Mon, Oct 6, 2014 at 4:27 PM, Fabrízio de Royes Mello wrote: > create_index_if_not_exists_v7.patch Looks good to me. Marking ready for committer. If you have any feedback about my reviews, I would gladly hear it. I'm quite new to this. PS: You seem to be submitting many patches, but have you

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-06 Thread Fabrízio de Royes Mello
On Mon, Oct 6, 2014 at 4:49 AM, Marti Raudsepp wrote: > > On Mon, Oct 6, 2014 at 5:12 AM, Marti Raudsepp wrote: > > On Mon, Oct 6, 2014 at 4:17 AM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > >> CREATE INDEX ... [ IF NOT EXISTS [ name ] ] ON ... > > > I think this one is wrong now

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-06 Thread Marti Raudsepp
On Mon, Oct 6, 2014 at 5:12 AM, Marti Raudsepp wrote: > On Mon, Oct 6, 2014 at 4:17 AM, Fabrízio de Royes Mello > wrote: >> CREATE INDEX ... [ IF NOT EXISTS [ name ] ] ON ... > I think this one is wrong now. I see now, I think you meant: CREATE INDEX ... [ [ IF NOT EXISTS ] name ] ON ... If

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-05 Thread Marti Raudsepp
On Mon, Oct 6, 2014 at 4:17 AM, Fabrízio de Royes Mello wrote: > On Sun, Oct 5, 2014 at 9:52 AM, Marti Raudsepp wrote: >> CREATE INDEX ... [ IF NOT EXISTS name | name ] ON ... >> >> Maybe I'm just slow, but it took me a few minutes to understand what >> this means. :) > > Well, I try to show that

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-05 Thread Fabrízio de Royes Mello
On Sun, Oct 5, 2014 at 9:52 AM, Marti Raudsepp wrote: > > > The version 5 (attached) contains all discussed until now. > > From documentation: > > CREATE INDEX ... [ IF NOT EXISTS name | name ] ON ... > > Maybe I'm just slow, but it took me a few minutes to understand what > this means. :) > Well

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-05 Thread Marti Raudsepp
On Fri, Oct 3, 2014 at 7:25 PM, Fabrízio de Royes Mello wrote: > I agree with your grammar change. Cool. > The version 5 (attached) contains all discussed until now. From documentation: CREATE INDEX ... [ IF NOT EXISTS name | name ] ON ... Maybe I'm just slow, but it took me a few minutes to

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-03 Thread Fabrízio de Royes Mello
On Fri, Oct 3, 2014 at 5:26 AM, Marti Raudsepp wrote: > > "On Fri, Oct 3, 2014 at 6:25 AM, Fabrízio de Royes Mello > wrote: > >> Documentation: I would prefer if the explanation were consistent with > > > "Do not throw an error if the index already exists. A notice is issued in > > this case." >

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-03 Thread Marti Raudsepp
"On Fri, Oct 3, 2014 at 6:25 AM, Fabrízio de Royes Mello wrote: >> Documentation: I would prefer if the explanation were consistent with > "Do not throw an error if the index already exists. A notice is issued in > this case." > Fixed in that way. Ok? And also "Note that there is no guarantee th

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-02 Thread Fabrízio de Royes Mello
On Fri, Oct 3, 2014 at 12:29 AM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > > > > On Thu, Oct 2, 2014 at 9:55 PM, Marti Raudsepp wrote: > > > > On Fri, Oct 3, 2014 at 2:15 AM, Marti Raudsepp wrote: > > > + ereport(NOTICE, > > > + (errcode(ERRCODE_DUPLICATE_TABLE),

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-02 Thread Fabrízio de Royes Mello
On Thu, Oct 2, 2014 at 9:55 PM, Marti Raudsepp wrote: > > On Fri, Oct 3, 2014 at 2:15 AM, Marti Raudsepp wrote: > > + ereport(NOTICE, > > + (errcode(ERRCODE_DUPLICATE_TABLE), > > + errmsg("relation \"%s\" already exists, skipping", > > +

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-02 Thread Fabrízio de Royes Mello
On Thu, Oct 2, 2014 at 8:15 PM, Marti Raudsepp wrote: > > On Wed, Oct 1, 2014 at 2:42 PM, Fabrízio de Royes Mello > wrote: > > So, what's the correct/best grammar? > > CREATE [ IF NOT EXISTS ] [ UNIQUE ] INDEX index_name > > or > > CREATE [ UNIQUE ] INDEX [ IF NOT EXISTS ] index_name > > I've ele

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-02 Thread Marti Raudsepp
On Fri, Oct 3, 2014 at 2:15 AM, Marti Raudsepp wrote: > + ereport(NOTICE, > + (errcode(ERRCODE_DUPLICATE_TABLE), > + errmsg("relation \"%s\" already exists, skipping", > + indexRelationName))); > > 1. Clearly "relation" should be "in

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-02 Thread Marti Raudsepp
On Wed, Oct 1, 2014 at 2:42 PM, Fabrízio de Royes Mello wrote: > So, what's the correct/best grammar? > CREATE [ IF NOT EXISTS ] [ UNIQUE ] INDEX index_name > or > CREATE [ UNIQUE ] INDEX [ IF NOT EXISTS ] index_name I've elected myself as the reviewer for this patch. Here are some preliminary co

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-10-01 Thread Fabrízio de Royes Mello
On Wed, Oct 1, 2014 at 7:57 AM, José Luis Tallón wrote: > > [snip] > > Please excuse my jumping in, but the EXPECTED syntax is: > > CREATE INDEX IF NOT EXISTS . > > whereas your current patch implements: > > CREATE [IF NOT EXISTS] INDEX > > > if I'm reading the grammar correctly. > I thi

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Fabrízio de Royes Mello
On Tue, Sep 30, 2014 at 10:22 PM, Michael Paquier wrote: > > On Wed, Oct 1, 2014 at 10:03 AM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: >> >> Done. > > You should consider adding that to the next commit fest. > Sure. Added [1] Regards, [1] https://commitfest.postgresql.org/actio

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Michael Paquier
On Wed, Oct 1, 2014 at 10:03 AM, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > Done. > You should consider adding that to the next commit fest. -- Michael

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Fabrízio de Royes Mello
On Tue, Sep 30, 2014 at 9:12 PM, Josh Berkus wrote: > > On 09/30/2014 04:58 PM, Fabrízio de Royes Mello wrote: > > On Tue, Sep 30, 2014 at 8:47 PM, Josh Berkus wrote: > >> > >> On 09/30/2014 04:16 PM, Andres Freund wrote: > >>> On 2014-09-30 16:03:01 -0700, Josh Berkus wrote: > On 09/30/2014

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Josh Berkus
On 09/30/2014 04:58 PM, Fabrízio de Royes Mello wrote: > On Tue, Sep 30, 2014 at 8:47 PM, Josh Berkus wrote: >> >> On 09/30/2014 04:16 PM, Andres Freund wrote: >>> On 2014-09-30 16:03:01 -0700, Josh Berkus wrote: On 09/30/2014 03:53 PM, Andres Freund wrote: > Good point. I think it's fair

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Fabrízio de Royes Mello
On Tue, Sep 30, 2014 at 8:47 PM, Josh Berkus wrote: > > On 09/30/2014 04:16 PM, Andres Freund wrote: > > On 2014-09-30 16:03:01 -0700, Josh Berkus wrote: > >> On 09/30/2014 03:53 PM, Andres Freund wrote: > >>> Good point. I think it's fair enough to only allow CINE on named > >>> indexes. > >> > >

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Josh Berkus
On 09/30/2014 04:16 PM, Andres Freund wrote: > On 2014-09-30 16:03:01 -0700, Josh Berkus wrote: >> On 09/30/2014 03:53 PM, Andres Freund wrote: >>> Good point. I think it's fair enough to only allow CINE on named >>> indexes. >> >> On the other hand, the way we form system-generated names is predic

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Andres Freund
On 2014-09-30 16:03:01 -0700, Josh Berkus wrote: > On 09/30/2014 03:53 PM, Andres Freund wrote: > > On 2014-09-30 18:47:24 -0400, Tom Lane wrote: > >> Josh Berkus writes: > >>> On 09/30/2014 02:43 PM, Tom Lane wrote: > =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= > writes: > > What's y

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Josh Berkus
On 09/30/2014 03:53 PM, Andres Freund wrote: > On 2014-09-30 18:47:24 -0400, Tom Lane wrote: >> Josh Berkus writes: >>> On 09/30/2014 02:43 PM, Tom Lane wrote: =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? >> >>

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Andres Freund
On 2014-09-30 18:47:24 -0400, Tom Lane wrote: > Josh Berkus writes: > > On 09/30/2014 02:43 PM, Tom Lane wrote: > >> =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > >>> What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? > > >> It's got the same semantic problems as every

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Tom Lane
Josh Berkus writes: > On 09/30/2014 02:43 PM, Tom Lane wrote: >> =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: >>> What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? >> It's got the same semantic problems as every other variant of CINE. > I do think it should be name-bas

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Fabrízio de Royes Mello
On Tue, Sep 30, 2014 at 7:01 PM, Josh Berkus wrote: > > On 09/30/2014 02:43 PM, Tom Lane wrote: > > =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > >> What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? > > > > It's got the same semantic problems as every other variant of C

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Kirk Roybal
On 2014-09-30 17:01, Josh Berkus wrote: > On 09/30/2014 02:43 PM, Tom Lane wrote: > =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? It's > got the same semantic problems as every other variant of CINE. If there were

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Josh Berkus
On 09/30/2014 02:43 PM, Tom Lane wrote: > =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: >> What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? > > It's got the same semantic problems as every other variant of CINE. > > If there were a huge groundswell of demand for it, may

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Kirk Roybal
Since PostgreSQL started down that road for so many other relations, I think many people just expect this to happen as a logical extension. It certainly makes life a lot easier in combination with build management systems. /kirk On 2014-09-30 16:43, Tom Lane wrote: > =?UTF-8?Q?Fabr=C3=AD

Re: [HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Tom Lane
=?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? It's got the same semantic problems as every other variant of CINE. If there were a huge groundswell of demand for it, maybe we'd hold our noses and do it anyway. But I'm a

[HACKERS] CREATE IF NOT EXISTS INDEX

2014-09-30 Thread Fabrízio de Royes Mello
Hi all, What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX? As it holds data (like sequences and tables) I think we can do that. Regards, -- Fabrízio de Royes Mello Consultoria/Coaching PostgreSQL >> Timbira: http://www.timbira.com.br >> Blog: http://fabriziomello.github.io