Re: A different approach to extension NO USER DATA feature

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
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 15:22:01
Message-ID: 15843.1297092121@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Huxton <dev(at)archonet(dot)com> writes:
> 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 is kind of problematic because it requires those tables to be
created before the extension is created. One difficulty with that is it
would break parallel pg_restore. Another is that it's not unusual for
the config tables to not be populatable at all before the extension's
been loaded. For example, IIRC how the old contrib/tsearch2 config
tables worked, there were regproc columns that contained references to
functions created by tsearch2.

It is true that the extension author may sometimes need to run some code
when the user-provided data is loaded into the config table, but in the
design I suggested, that could be handled by attaching triggers to the
config table.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Cédric Villemain 2011-02-07 15:22:15 Re: Spread checkpoint sync
Previous Message Tom Lane 2011-02-07 15:15:14 Re: A different approach to extension NO USER DATA feature