pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Abhijit Menon-Sen <ams@2ndQuadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: dealing with extension dependencies that aren't quite 'e'
Date: Mon, 21 Mar 2016 12:24:32 -0300
Message-ID: <20160321152432.GA358168@alvherre.pgsql> (raw)
In-Reply-To: <20160321135331.GA14725@toroid.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Abhijit Menon-Sen wrote:

> +	else if (strcmp(defel->defname, "extdepend") == 0)
> +	{
> +		if (*extdepend_item)
> +			goto duplicate_error;
> +
> +		*extdepend_item = defel;
> +	}
>  	else
>  		return false;
>  

I'm not sure I agree with this implementation.  I mentioned ALTER ..
SET SCHEMA and ALTER .. OWNER TO as examples because, since other object
types were mentioned as possible targets for this command, then this
should presumably object-type-agnostic, like those ALTER forms are.  So
IMO we shouldn't shoehorn this into AlterFunctionStmt but rather have
its own node AlterObjectDepends or similar.

The other point is that if we're doing it in ALTER FUNCTION which allows
multiple subcommands in one go, why do we not allow to run this command
for multiple extensions?  After all, it's not completely stupid to think
that one function could depend on multiple extensions, and so if you
agree with that then it's not completely stupid that it should be
possible to declare such in one command, i.e.

ALTER FUNCTION .. DEPENDS ON EXTENSION one, two;
  or perhaps
ALTER FUNCTION .. DEPENDS ON EXTENSION one, DEPENDS ON EXTENSION two;

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (40+ messages)  latest in thread

Message-ID: <20160321152432.GA358168@alvherre.pgsql>
Permalink:  ../20160321152432.GA358168@alvherre.pgsql/
Also on:    postgresql.org/message-id/20160321152432.GA358168@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, ams@2ndQuadrant.com
  Subject: Re: dealing with extension dependencies that aren't quite 'e'
  In-Reply-To: <20160321152432.GA358168@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox