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

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

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

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

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. --

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)

Re: [HACKERS] creating extension including dependencies

2015-09-18 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

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 >>>

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:

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

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

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-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

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 >>

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

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

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

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

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 > > >

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

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

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

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 >

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

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

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 to the

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 p...@2ndquadrant.com wrote: On 2015-07-22 07:12, Michael Paquier wrote: On Tue, Jul 21, 2015 at 11:20 PM, Tom Lane t...@sss.pgh.pa.us wrote: Petr Jelinek p...@2ndquadrant.com writes: ... My main

Re: [HACKERS] creating extension including dependencies

2015-07-25 Thread Michael Paquier
On Sat, Jul 25, 2015 at 12:59 AM, Petr Jelinek p...@2ndquadrant.com wrote: On 2015-07-22 07:12, Michael Paquier wrote: On Tue, Jul 21, 2015 at 11:20 PM, Tom Lane t...@sss.pgh.pa.us wrote: Petr Jelinek p...@2ndquadrant.com writes: ... My main question is if we are ok with SCHEMA having

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 t...@sss.pgh.pa.us wrote: Petr Jelinek p...@2ndquadrant.com 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

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Michael Paquier
On Tue, Jul 21, 2015 at 11:20 PM, Tom Lane t...@sss.pgh.pa.us wrote: Petr Jelinek p...@2ndquadrant.com 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

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Jul 20, 2015 at 10:29 PM, Michael Paquier michael.paqu...@gmail.com 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

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Robert Haas
On Mon, Jul 20, 2015 at 10:29 PM, Michael Paquier michael.paqu...@gmail.com 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

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Petr Jelinek
On 2015-07-21 15:48, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Mon, Jul 20, 2015 at 10:29 PM, Michael Paquier michael.paqu...@gmail.com 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

Re: [HACKERS] creating extension including dependencies

2015-07-21 Thread Tom Lane
Petr Jelinek p...@2ndquadrant.com 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

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 p...@2ndquadrant.com wrote: On 2015-07-15 06:07, Michael Paquier wrote: On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: On July 10, 2015

Re: [HACKERS] creating extension including dependencies

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

Re: [HACKERS] creating extension including dependencies

2015-07-19 Thread Michael Paquier
On Sat, Jul 18, 2015 at 8:00 AM, Petr Jelinek p...@2ndquadrant.com wrote: On 2015-07-15 06:07, Michael Paquier wrote: On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane

Re: [HACKERS] creating extension including dependencies

2015-07-14 Thread Michael Paquier
On Fri, Jul 10, 2015 at 11:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane t...@sss.pgh.pa.us wrote: Would that propagate down through multiple levels of CASCADE? (Although I'm not sure it would be sensible for

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 and...@anarazel.de 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

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 p...@2ndquadrant.com wrote: Hi, I am getting tired installing manually required extensions manually. I was

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Tom Lane
Andres Freund and...@anarazel.de writes: On July 10, 2015 4:16:59 PM GMT+02:00, Tom Lane t...@sss.pgh.pa.us 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

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Tom Lane
Michael Paquier michael.paqu...@gmail.com writes: On Fri, Jul 10, 2015 at 10:09 PM, Heikki Linnakangas hlinn...@iki.fi 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

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 t...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de 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

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; +

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Vladimir Borodin
10 июля 2015 г., в 16:09, Heikki Linnakangas hlinn...@iki.fi написал(а): 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 p...@2ndquadrant.com wrote: Hi,

Re: [HACKERS] creating extension including dependencies

2015-07-10 Thread Tom Lane
Andres Freund and...@anarazel.de 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?

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 p...@2ndquadrant.com wrote: Hi, I am getting tired installing manually required extensions manually. I was wondering if we might want to add option to

Re: [HACKERS] creating extension including dependencies

2015-07-07 Thread David E. Wheeler
On Jul 7, 2015, at 6:41 AM, Andres Freund and...@anarazel.de 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

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 p...@2ndquadrant.com 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

Re: [HACKERS] creating extension including dependencies

2015-07-07 Thread Fujii Masao
On Mon, Jun 15, 2015 at 7:50 AM, Petr Jelinek p...@2ndquadrant.com 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

[HACKERS] creating extension including dependencies

2015-06-14 Thread 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 by the extension that is being installed by the user. I also wrote some prototype patch

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 p...@2ndquadrant.com: 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