Re: Add CREATE EXTENSION Support

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Add CREATE EXTENSION Support
Date: 2014-01-17 18:50:15
Message-ID: 3E7C2845-C74D-4C18-9652-F26B5C3BAC5B@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Jan 16, 2014, at 5:39 PM, David E. Wheeler <david(at)justatheory(dot)com> wrote:

> I hope to finish it up tomorrow. One quick question now, though: Do end users ever add records to pga_jobclass? Or are those five records supposed to be set in stone?

I changed it to exclude the five default classes by name rather than ID, which should be cleaner.

Attached is a patch implementing $subject. It's also viewable here:

https://github.com/theory/pgagent/compare/extension

I've also attached a patch to the pgAdminIII docs, viewable here:

https://github.com/theory/pgadmin3/compare/pgagent-extension

Please let me know how these look, of if you’d like any changes. The approach I took, BTW, was:

* Move the *.sql files to a sql/ directory. This is so that upgrade scripts can be created there in the future, too, without cluttering up the root of the distribution.

* Add a cmake script to copy sql/pgagent.sql to pgagent--${VERSION}.sql, remove the BEGIN, COMMIT, and CREATE schema lines, and uncomment lines that call pg_catalog.pg_extension_config_dump() to allow pgAgent table rows to be dumped. The script also replaces ${VERSION} in the control file.

* If Postgres supports extensions, add a target to call that script, and install commands for pgagent--${VERSION}.sql, pgagent.control, and sql/*--*.sql in the server share/extensions directory.

* I also added sql/pgagent--unpackaged--3.3.0.sql so one can create the extension from unpackaged, which is useful for existing installations. This file should be renamed to whatever the release version is that ships with this patch.

I think this is a relatively clean way to go. I'm wondering, though, whether the extension will be needed on PostgreSQL servers where pgAgent itself isn't installed. Might it be worthwhile to also release an extension that just contains the SQL stuff and not pgAgent, so that it can be deployed to any server on which one might need to run CREATE EXTENSION pgagent?

Best,

David

Attachment Content-Type Size
pgagent-extension-docs.patch application/octet-stream 1.5 KB
pgagent-extension.patch application/octet-stream 67.6 KB
unknown_filename text/plain 2 bytes

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Neel Patel 2014-01-20 13:09:53 wxWidgets 3.0 support in pgAdmin
Previous Message David E. Wheeler 2014-01-17 01:39:54 Re: Add CREATE EXTENSION Support