Re: [HACKERS] creating extension including dependencies

2015-10-03 Thread Michael Paquier
On Sun, Oct 4, 2015 at 12:15 AM, Andres Freund wrote: > On 2015-09-20 16:38:58 +0200, Petr Jelinek wrote: > Michael: Why did you exclude test_extensions in Mkvcbuild.pm? test_extensions contains nothing that should be compiled, only things that should be installed. -- Michael -- Sent via pgsq

Re: [HACKERS] creating extension including dependencies

2015-10-03 Thread Andres Freund
On 2015-10-03 17:56:07 +0200, Petr Jelinek wrote: > On 2015-10-03 17:16, Andres Freund wrote: > >On 2015-10-03 17:15:54 +0200, Andres Freund wrote: > >>Here's an updated patch. Petr, could you please expand the test to > >>handle a bit more complex cascading setups? > > > > Okay, I changed the tes

Re: [HACKERS] creating extension including dependencies

2015-10-03 Thread Petr Jelinek
On 2015-10-03 17:16, Andres Freund wrote: On 2015-10-03 17:15:54 +0200, Andres Freund wrote: Here's an updated patch. Petr, could you please expand the test to handle a bit more complex cascading setups? Okay, I changed the test to make the dependencies bit more complex - more than one depe

Re: [HACKERS] creating extension including dependencies

2015-10-03 Thread Andres Freund
On 2015-10-03 17:15:54 +0200, Andres Freund wrote: > Here's an updated patch. Petr, could you please expand the test to > handle a bit more complex cascading setups? ... >From fa11dc75500eb91b68baeeb07a00a789ed0050b3 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Sat, 3 Oct 2015 17:01:32 +020

Re: [HACKERS] creating extension including dependencies

2015-10-03 Thread Andres Freund
On 2015-09-20 16:38:58 +0200, Petr Jelinek wrote: > Here it is. I went over the patch, trying to commit it. Changed a bunch of stylistic issues (comments, NOTICE location, ...) . But also found a bug: Namely cascade_parent was set wrongly in a bunch of situations: When an extension has multiple de

Re: [HACKERS] creating extension including dependencies

2015-09-20 Thread Petr Jelinek
On 2015-09-18 04:52, Petr Jelinek wrote: On 2015-09-17 17:31, Jeff Janes wrote: If I fail to specify CASCADE and get an ERROR, I think there should be a HINT which suggests the use of CASCADE. create extension earthdistance ; ERROR: required extension "cube" is not installed (no hint) Ther

Re: [HACKERS] creating extension including dependencies

2015-09-17 Thread Jeff Janes
On Sep 17, 2015 7:52 PM, "Petr Jelinek" wrote: > > On 2015-09-17 17:31, Jeff Janes wrote: >> >> >> Also, It would be nice to have psql tab complete the word CASCADE. >> > > Hmm, it already does? Indeed it does. Oops. I need to run the program I just compiled, and not some other version that hap

Re: [HACKERS] creating extension including dependencies

2015-09-17 Thread Petr Jelinek
On 2015-09-17 17:31, Jeff Janes wrote: If I fail to specify CASCADE and get an ERROR, I think there should be a HINT which suggests the use of CASCADE. create extension earthdistance ; ERROR: required extension "cube" is not installed (no hint) There is a HINT on the reverse operation: drop

Re: [HACKERS] creating extension including dependencies

2015-09-17 Thread Jeff Janes
On Tue, Sep 15, 2015 at 8:44 PM, Petr Jelinek wrote: > On 2015-09-08 04:06, Michael Paquier wrote: > >> On Tue, Sep 8, 2015 at 10:44 AM, Michael Paquier >> wrote: >> >>> >>> Attached are as well changes for the documentation that I spotted in >>> earlier reviews but were not included in the last

Re: [HACKERS] creating extension including dependencies

2015-09-16 Thread Andres Freund
On 2015-09-16 19:46:10 -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > > > @@ -91,8 +92,38 @@ CREATE EXTENSION [ IF NOT EXISTS ] > > class="parameter">extension_name > > > The name of the schema in which to install the extension's > > > objects, given that the extension

Re: [HACKERS] creating extension including dependencies

2015-09-16 Thread Alvaro Herrera
Andres Freund wrote: > > @@ -91,8 +92,38 @@ CREATE EXTENSION [ IF NOT EXISTS ] > class="parameter">extension_name > > The name of the schema in which to install the extension's > > objects, given that the extension allows its contents to be > > relocated. The named sch

Re: [HACKERS] creating extension including dependencies

2015-09-16 Thread Andres Freund
On 2015-09-16 05:44:22 +0200, Petr Jelinek wrote: > On 2015-09-08 04:06, Michael Paquier wrote: > >On Tue, Sep 8, 2015 at 10:44 AM, Michael Paquier > > wrote: > >> > >>Attached are as well changes for the documentation that I spotted in > >>earlier reviews but were not included in the last version

Re: [HACKERS] creating extension including dependencies

2015-09-15 Thread Petr Jelinek
On 2015-09-08 04:06, Michael Paquier wrote: On Tue, Sep 8, 2015 at 10:44 AM, Michael Paquier wrote: Attached are as well changes for the documentation that I spotted in earlier reviews but were not included in the last version sent by Petr yesterday. Feel free to discard them if you think they

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Michael Paquier
On Tue, Sep 8, 2015 at 10:44 AM, Michael Paquier wrote: > On Tue, Sep 8, 2015 at 6:14 AM, Petr Jelinek wrote: >> Attached patch uses just boolean in cascade DefElem and splits the >> CreateExtension into two functions, the cascade code now calls the >> CreateExtensionInternal. One thing though - I

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Michael Paquier
On Tue, Sep 8, 2015 at 6:14 AM, Petr Jelinek wrote: > Attached patch uses just boolean in cascade DefElem and splits the > CreateExtension into two functions, the cascade code now calls the > CreateExtensionInternal. One thing though - I am passing the DefElems > directly to the cascaded CreateExte

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Petr Jelinek
On 2015-09-07 21:28, Petr Jelinek wrote: On 2015-09-07 21:09, Alvaro Herrera wrote: Andres Freund wrote: On 2015-09-07 20:56:50 +0200, Petr Jelinek wrote: Yes that sounds cleaner. Just as a side note, List is a Node and does have copy support (and we pass List as DefElem->arg from gram.y in se

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Petr Jelinek
On 2015-09-07 21:09, Alvaro Herrera wrote: Andres Freund wrote: On 2015-09-07 20:56:50 +0200, Petr Jelinek wrote: Yes that sounds cleaner. Just as a side note, List is a Node and does have copy support (and we pass List as DefElem->arg from gram.y in several places). I know - but the list ele

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Andres Freund
On 2015-09-07 16:09:27 -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > On 2015-09-07 20:56:50 +0200, Petr Jelinek wrote: > > > Yes that sounds cleaner. Just as a side note, List is a Node and does have > > > copy support (and we pass List as DefElem->arg from gram.y in several > > > places)

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Alvaro Herrera
Andres Freund wrote: > On 2015-09-07 20:56:50 +0200, Petr Jelinek wrote: > > Yes that sounds cleaner. Just as a side note, List is a Node and does have > > copy support (and we pass List as DefElem->arg from gram.y in several > > places). > > I know - but the list element in this case don't have c

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Andres Freund
On 2015-09-07 20:56:50 +0200, Petr Jelinek wrote: > Yes that sounds cleaner. Just as a side note, List is a Node and does have > copy support (and we pass List as DefElem->arg from gram.y in several > places). I know - but the list element in this case don't have copy support, no? You seem to have

Re: [HACKERS] creating extension including dependencies

2015-09-07 Thread Petr Jelinek
On 2015-09-02 17:31, Andres Freund wrote: On 2015-09-02 17:27:38 +0200, Andres Freund wrote: 1) Passing the list of parents through the cascade DefElem strikes me as incredibly ugly. For one the cascade option really should take a true/false type option on the C level (so you can do defGetBoole

Re: [HACKERS] creating extension including dependencies

2015-09-02 Thread Andres Freund
On 2015-09-02 17:27:38 +0200, Andres Freund wrote: > 1) Passing the list of parents through the cascade DefElem strikes me as > incredibly ugly. > > For one the cascade option really should take a true/false type option > on the C level (so you can do defGetBoolean()), for another passing > throug

Re: [HACKERS] creating extension including dependencies

2015-09-02 Thread Andres Freund
Hi, I'm looking at committing this patch. I found some nitpick-level things that I can easily fixup. But I dislike two things: 1) Passing the list of parents through the cascade DefElem strikes me as incredibly ugly. For one the cascade option really should take a true/false type option on the C

Re: [HACKERS] creating extension including dependencies

2015-07-31 Thread Petr Jelinek
On 2015-07-31 03:03, Michael Paquier wrote: On Thu, Jul 30, 2015 at 10:58 PM, Petr Jelinek wrote: On 2015-07-27 15:18, Michael Paquier wrote: Something also has not been discussed yet: what to do with new_version and old_version (the options of CreateExtensionStmt)? As of now if those options a

Re: [HACKERS] creating extension including dependencies

2015-07-30 Thread Michael Paquier
On Thu, Jul 30, 2015 at 10:58 PM, Petr Jelinek wrote: > On 2015-07-27 15:18, Michael Paquier wrote: >> Something also has not been discussed yet: what to do with new_version >> and old_version (the options of CreateExtensionStmt)? As of now if >> those options are defined they are not passed down t

Re: [HACKERS] creating extension including dependencies

2015-07-30 Thread Petr Jelinek
On 2015-07-27 15:18, Michael Paquier wrote: On Sun, Jul 26, 2015 at 1:01 AM, Petr Jelinek wrote: Yes that's what I meant by the change of checking order in the explanation above. I did that because I thought code would be more complicated otherwise, but apparently I was stupid... +In c

Re: [HACKERS] creating extension including dependencies

2015-07-27 Thread Michael Paquier
On Sun, Jul 26, 2015 at 1:01 AM, Petr Jelinek wrote: > Yes that's what I meant by the change of checking order in the explanation > above. I did that because I thought code would be more complicated > otherwise, but apparently I was stupid... +In case the extension specifies schema in its

Re: [HACKERS] creating extension including dependencies

2015-07-25 Thread Petr Jelinek
On 2015-07-25 14:37, Michael Paquier wrote: On Sat, Jul 25, 2015 at 12:59 AM, Petr Jelinek wrote: On 2015-07-22 07:12, Michael Paquier wrote: On Tue, Jul 21, 2015 at 11:20 PM, Tom Lane wrote: Petr Jelinek writes: ... My main question is if we are ok with SCHEMA having different behavior

Re: [HACKERS] creating extension including dependencies

2015-07-25 Thread Michael Paquier
On Sat, Jul 25, 2015 at 12:59 AM, Petr Jelinek wrote: > On 2015-07-22 07:12, Michael Paquier wrote: >> >> On Tue, Jul 21, 2015 at 11:20 PM, Tom Lane wrote: >>> >>> Petr Jelinek writes: ... My main question is if we are ok with SCHEMA having different behavior with CASCADE vs witho

Re: [HACKERS] creating extension including dependencies

2015-07-24 Thread Petr Jelinek
On 2015-07-22 07:12, Michael Paquier wrote: On Tue, Jul 21, 2015 at 11:20 PM, Tom Lane wrote: Petr Jelinek writes: ... My main question is if we are ok with SCHEMA having different behavior with CASCADE vs without CASCADE. I went originally with "no" and added the DEFAULT flag to SCHEMA. If t

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Michael Paquier
On Tue, Jul 21, 2015 at 11:20 PM, Tom Lane wrote: > Petr Jelinek writes: >> ... My main question is if we are >> ok with SCHEMA having different behavior with CASCADE vs without >> CASCADE. I went originally with "no" and added the DEFAULT flag to >> SCHEMA. If the answer is "yes" then we don't n

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Tom Lane
Petr Jelinek writes: > ... My main question is if we are > ok with SCHEMA having different behavior with CASCADE vs without > CASCADE. I went originally with "no" and added the DEFAULT flag to > SCHEMA. If the answer is "yes" then we don't need the flag (in that case > CASCADE acts as the flag

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Petr Jelinek
On 2015-07-21 15:48, Tom Lane wrote: Robert Haas writes: On Mon, Jul 20, 2015 at 10:29 PM, Michael Paquier wrote:> In short I would give up on the DEFAULT SCHEMA business, and add a new flag in the control file to decide if a given extension passes down the schema name of its child when creat

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Tom Lane
Robert Haas writes: > On Mon, Jul 20, 2015 at 10:29 PM, Michael Paquier > wrote:> >> In short I would give up on the DEFAULT SCHEMA business, and >> add a new flag in the control file to decide if a given extension >> passes down the schema name of its child when created in cascade, >> default be

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Robert Haas
On Mon, Jul 20, 2015 at 10:29 PM, Michael Paquier wrote:> In > short I would give up on the DEFAULT SCHEMA business, and > add a new flag in the control file to decide if a given extension > passes down the schema name of its child when created in cascade, > default being true for the potential is

Re: [HACKERS] creating extension including dependencies

2015-07-20 Thread Michael Paquier
On Mon, Jul 20, 2015 at 10:20 PM, Petr Jelinek wrote: > On 2015-07-19 17:16, Michael Paquier wrote: >> >> On Sat, Jul 18, 2015 at 8:00 AM, Petr Jelinek >> wrote: >>> >>> On 2015-07-15 06:07, Michael Paquier wrote: On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane wrote: > > >

Re: [HACKERS] creating extension including dependencies

2015-07-20 Thread Petr Jelinek
On 2015-07-19 17:16, Michael Paquier wrote: On Sat, Jul 18, 2015 at 8:00 AM, Petr Jelinek wrote: On 2015-07-15 06:07, Michael Paquier wrote: On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane wrote: Andres Freund writes: On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane wrote: Would that propa

Re: [HACKERS] creating extension including dependencies

2015-07-19 Thread Michael Paquier
On Sat, Jul 18, 2015 at 8:00 AM, Petr Jelinek wrote: > On 2015-07-15 06:07, Michael Paquier wrote: >> >> On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane wrote: >>> >>> Andres Freund writes: On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane wrote: > > Would that propagate down th

Re: [HACKERS] creating extension including dependencies

2015-07-17 Thread Petr Jelinek
On 2015-07-15 06:07, Michael Paquier wrote: On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane wrote: Andres Freund writes: On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane wrote: Would that propagate down through multiple levels of CASCADE? (Although I'm not sure it would be sensible for a non-rel

Re: [HACKERS] creating extension including dependencies

2015-07-14 Thread Michael Paquier
On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane wrote: > Andres Freund writes: >> On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane wrote: >>> Would that propagate down through multiple levels of CASCADE? (Although >>> I'm not sure it would be sensible for a non-relocatable extension to >>> depend on

Re: [HACKERS] creating extension including dependencies

2015-07-12 Thread David Fetter
On Tue, Jul 07, 2015 at 10:14:49AM -0700, David E. Wheeler wrote: > On Jul 7, 2015, at 6:41 AM, Andres Freund wrote: > > > At the minimum I'd like to see that CREATE EXTENSION foo; would > > install install extension 'bar' if foo dependended on 'bar' if > > CASCADE is specified. Right now we alwa

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Tom Lane
Andres Freund writes: > On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane wrote: >> Would that propagate down through multiple levels of CASCADE? (Although >> I'm not sure it would be sensible for a non-relocatable extension to >> depend on a relocatable one, so maybe the need doesn't arise in >>

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Andres Freund
On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane wrote: >Andres Freund writes: >> I think we should copy the SCHEMA option here and document that we >use >> the same schema. But it needs to be done in a way that doesn't error >out >> if the extension is not relocatable... > >Would that propagate d

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Tom Lane
Andres Freund writes: > I think we should copy the SCHEMA option here and document that we use > the same schema. But it needs to be done in a way that doesn't error out > if the extension is not relocatable... Would that propagate down through multiple levels of CASCADE? (Although I'm not sure

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Andres Freund
On 2015-06-15 00:50:08 +0200, Petr Jelinek wrote: > + /* Create and execute new CREATE EXTENSION > statement. */ > + ces = makeNode(CreateExtensionStmt); > + ces->extname = curreq; > + c

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Tom Lane
Michael Paquier writes: > On Fri, Jul 10, 2015 at 10:09 PM, Heikki Linnakangas >> This seems quite reasonable, but I have to ask: How many extensions are >> there out there that depend on another extension? Off the top of my head, I >> can't think of any.. > With transforms there are such depend

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Vladimir Borodin
> 10 июля 2015 г., в 16:09, Heikki Linnakangas написал(а): > > On 07/09/2015 07:05 PM, Petr Jelinek wrote: >> On 2015-07-07 15:41, Andres Freund wrote: >>> On 2015-07-07 22:36:29 +0900, Fujii Masao wrote: On Mon, Jun 15, 2015 at 7:50 AM, Petr Jelinek wrote: > Hi, > > I am gett

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Andres Freund
On 2015-07-10 16:09:48 +0300, Heikki Linnakangas wrote: > This seems quite reasonable, but I have to ask: How many extensions are > there out there that depend on another extension? Off the top of my head, I > can't think of any.. BDR/UDR is one (or two depending on your POV). I think a part of w

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Michael Paquier
On Fri, Jul 10, 2015 at 10:09 PM, Heikki Linnakangas wrote: > On 07/09/2015 07:05 PM, Petr Jelinek wrote: > >> On 2015-07-07 15:41, Andres Freund wrote: >> >>> On 2015-07-07 22:36:29 +0900, Fujii Masao wrote: >>> On Mon, Jun 15, 2015 at 7:50 AM, Petr Jelinek wrote: > Hi, >

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Heikki Linnakangas
On 07/09/2015 07:05 PM, Petr Jelinek wrote: On 2015-07-07 15:41, Andres Freund wrote: On 2015-07-07 22:36:29 +0900, Fujii Masao wrote: On Mon, Jun 15, 2015 at 7:50 AM, Petr Jelinek wrote: Hi, I am getting tired installing manually required extensions manually. I was wondering if we might wan

Re: [HACKERS] creating extension including dependencies

2015-07-09 Thread Petr Jelinek
On 2015-07-07 15:41, Andres Freund wrote: On 2015-07-07 22:36:29 +0900, Fujii Masao wrote: On Mon, Jun 15, 2015 at 7:50 AM, Petr Jelinek wrote: Hi, I am getting tired installing manually required extensions manually. I was wondering if we might want to add option to CREATE SEQUENCE that would

Re: [HACKERS] creating extension including dependencies

2015-07-07 Thread David E. Wheeler
On Jul 7, 2015, at 6:41 AM, Andres Freund wrote: > At the minimum I'd like to see that CREATE EXTENSION foo; would install > install extension 'bar' if foo dependended on 'bar' if CASCADE is > specified. Right now we always error out saying that the dependency on > 'bar' is not fullfilled - not p

Re: [HACKERS] creating extension including dependencies

2015-07-07 Thread Andres Freund
On 2015-07-07 22:36:29 +0900, Fujii Masao wrote: > On Mon, Jun 15, 2015 at 7:50 AM, Petr Jelinek wrote: > > Hi, > > > > I am getting tired installing manually required extensions manually. I was > > wondering if we might want to add option to CREATE SEQUENCE that would allow > > automatic creation

Re: [HACKERS] creating extension including dependencies

2015-07-07 Thread Fujii Masao
On Mon, Jun 15, 2015 at 7:50 AM, Petr Jelinek wrote: > Hi, > > I am getting tired installing manually required extensions manually. I was > wondering if we might want to add option to CREATE SEQUENCE that would allow > automatic creation of the extensions required by the extension that is being >

Re: [HACKERS] creating extension including dependencies

2015-06-15 Thread Vik Fearing
On 06/15/2015 12:50 AM, Petr Jelinek wrote: > Hi, > > I am getting tired installing manually required extensions manually. I > was wondering if we might want to add option to CREATE SEQUENCE that > would allow automatic creation of the extensions required by the > extension that is being installed

Re: [HACKERS] creating extension including dependencies

2015-06-14 Thread Pavel Stehule
+1 Is it working in runtime too? Dne 15.6.2015 0:51 napsal uživatel "Petr Jelinek" : > Hi, > > I am getting tired installing manually required extensions manually. I was > wondering if we might want to add option to CREATE SEQUENCE that would > allow automatic creation of the extensions required