Re: A different approach to extension NO USER DATA feature

From: Richard Huxton <dev(at)archonet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: A different approach to extension NO USER DATA feature
Date: 2011-02-07 09:59:32
Message-ID: 4D4FC284.4040704@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06/02/11 18:23, Tom Lane wrote:
> After a bit of thought I believe that we can fix this if we are willing
> to teach pg_dump explicitly about extension configuration tables.
> The behavior we want for those is for the table schema definition to
> never be dumped (the table should always be created by CREATE EXTENSION),
> but for some subset of the table data to get dumped, excluding any
> system-provided rows.
[snip]
> pg_extension_partial_dump (table_name regclass, where_condition text)

Possible alternative approach?

1. Extension provides list of config tables/views/set-returning
functions to be dumped via e.g. my_config_tables()
2. They get dumped, but each as a TEMP TABLE (need unique names for
multiple extensions though).
3. On restore, tables are created and populated, then
read_your_config(<ARRAY-OF-TABLE-NAMES>) is called in the extension.

This separates the configuration-for-user from
configuration-for-extension. It allows the extension to decide whether
to load the new config or reject it. It lets you test/demonstrate
multiple configurations fairly simply.

The "system_data" column scenario can then be a default implementation
of read_your_config().

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-02-07 11:10:10 Re: SSI patch version 14
Previous Message Dimitri Fontaine 2011-02-07 09:37:54 Re: Foreign servers and user mappings versus the extensions patch