pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Abhijit Menon-Sen <ams@2ndQuadrant.com>
To: pgsql-hackers@postgresql.org
Subject: Re: dealing with extension dependencies that aren't quite 'e'
Date: Mon, 29 Feb 2016 19:56:07 -0600
Message-ID: <56D4F6B7.8010200@BlueTreble.com> (raw)
In-Reply-To: <20160301012745.GA11489@toroid.org>
References: <CAKFQuwYH=Z2EfahWez+qb=RCwCSoOtV7s75To+ysaKpeMwQkpw@mail.gmail.com>
	<18108.1452869354@sss.pgh.pa.us>
	<20160115170826.GA28307@toroid.org>
	<20160116144818.GA17401@toroid.org>
	<58C7A345-193B-4813-A7AA-4B78358313D6@gmail.com>
	<20160118053819.GA18576@toroid.org>
	<20160301012745.GA11489@toroid.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 2/29/16 7:27 PM, Abhijit Menon-Sen wrote:
> 1. This adds the 'x'/DEPENDENCY_AUTO_EXTENSION type.
> 2. This adds an 'ALTER FUNCTION … ADD DEPENDENT FUNCTION …' command.
>
> I split up the two because we may want the new dependency type without
> going to the trouble of adding a new command. Maybe extension authors
> should just insert an 'x' row into pg_depend directly?

I don't see why this would be limited to just functions. I could 
certainly see an extension that creates ease-of-use views that depend on 
the extension, or tables that have triggers that .... Am I missing 
something?

> I was inclined to implement it using ALTER FUNCTION, but AlterFunction()
> is focused on altering the pg_proc entry for a function, so the new code
> didn't fit. Ultimately, ExecAlterExtensionContentsStmt() was the closest
> match, so that's where I did it.

Maybe the better way to handle this would be through ALTER EXTENSION?

Given the audience for this, I think it'd probably be OK to just provide 
a function that does this, instead of DDL. I'd be concerned about asking 
users to do raw inserts though. pg_depends isn't the easiest thing to 
grok so I suspect there'd be a lot of problems with that, resulting in 
more raw DML to try and fix things, resulting in pg_depend getting 
completely screwed up...
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


-- 
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: <56D4F6B7.8010200@BlueTreble.com>
Permalink:  ../56D4F6B7.8010200@BlueTreble.com/
Also on:    postgresql.org/message-id/56D4F6B7.8010200@BlueTreble.com

 · 

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: Jim.Nasby@BlueTreble.com, ams@2ndQuadrant.com
  Subject: Re: dealing with extension dependencies that aren't quite 'e'
  In-Reply-To: <56D4F6B7.8010200@BlueTreble.com>

* 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