Re: dealing with extension dependencies that aren't quite 'e'

From: Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: dealing with extension dependencies that aren't quite 'e'
Date: 2016-03-01 01:27:45
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

At 2016-01-18 11:08:19 +0530, ams(at)2ndQuadrant(dot)com wrote:
> I'm proposing to address a part of that problem by allowing extension
> dependencies to be explicitly declared for functions and objects
> created either by a user or dynamically by the extension itself—things
> that need the extension to function, but aren't a part of it.

I didn't hear any further suggestions, so here's a patch for discussion.

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

Comments welcome. I'll add this patch to the CF.

-- Abhijit

Attachment Content-Type Size
0001-Add-a-DEPENDENCY_AUTO_EXTENSION-dependency-type.patch text/x-diff 2.9 KB
0002-Add-experimental-ALTER-EXTENSION-ADD-DEPENDENT-FUNCT.patch text/x-diff 11.4 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-03-01 01:46:03 Re: Proposal: "Causal reads" mode for load balancing reads without stale data
Previous Message Tom Lane 2016-03-01 01:06:59 Re: create opclass documentation outdated