Testing extension upgrade scripts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Testing extension upgrade scripts
Дата
Msg-id 12813.1299095914@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Testing extension upgrade scripts  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
It occurred to me that it might be a good idea to describe how
I've been testing extension upgrade scripts.  So:

1. Install the 9.0 version of the module in an empty 9.0 database.
pg_dump this database.

2. Load the pg_dump script into an empty 9.1 database, with the
underlying shared library (if any) available in $libdir but not
installed as SQL.  (If this fails, probably you removed a C
function from the library.)

3. Execute "CREATE EXTENSION whatever FROM unpackaged;".  (If this
fails, obviously you have work to do.)

4. pg_dump --binary-upgrade from the 9.1 database.  (You need
--binary-upgrade or pg_dump won't show the member objects of the
extension.)

5. Install the 9.1 version of the extension in another empty
database, using plain "CREATE EXTENSION whatever".  Then
pg_dump --binary-upgrade from that.

6. Diff the two 9.1 dump scripts.  They should be the same except
for OID and frozenxid numbers.  If not, the upgrade script has
missed something it needs to do to update the catalog entries.


Of course, a similar approach will be useful for testing scripts
that are meant to update from one extension version to another,
once we arrive at the point of needing to do that.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Sync Rep v17
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Sync Rep v17