Fix syntax errors in contrib uninstall scripts

Lists: pgsql-patches
From: Michael Fuhr <mike(at)fuhr(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: Fix syntax errors in contrib uninstall scripts
Date: 2006-03-13 06:24:10
Message-ID: 20060313062410.GA62866@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Fix a number of syntax errors in contrib modules' uninstall scripts.
Most of the changes add the mandatory USING clause to DROP OPERATOR
CLASS statements. DROP TYPE is now DROP TYPE CASCADE; without
CASCADE a DROP TYPE fails due to the circular dependency on the
type's I/O functions. The DROP FUNCTION statements for the I/O
functions have been removed, as DROP TYPE CASCADE removes them
automatically.

To test the uninstall scripts I did the following:

1. Create a database.
2. Run pg_dump to get a "before" dump.
3. Run a module's install script.
4. Run a module's uninstall script. Look for errors and drops
that cascade to anything other than types' I/O functions.
5. Run pg_dump to get an "after" dump.
6. Diff the "before" and "after" dumps; they should be identical.

For past discussion see the following thread:

http://archives.postgresql.org/pgsql-hackers/2006-02/msg01265.php
http://archives.postgresql.org/pgsql-hackers/2006-03/msg00096.php

Absent much feedback I chose option (2) in the following message:

http://archives.postgresql.org/pgsql-hackers/2006-03/msg00354.php

It might be desirable to wrap the drops in a transaction as option
(3) discusses. pg_trgm's uninstall script is currently the only
one that does so; it was already like that so I didn't change it.

--
Michael Fuhr

Attachment Content-Type Size
contrib.patch text/plain 18.8 KB

From: Neil Conway <neilc(at)samurai(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix syntax errors in contrib uninstall scripts
Date: 2006-03-13 07:26:31
Message-ID: 1142234791.8847.81.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Sun, 2006-03-12 at 23:24 -0700, Michael Fuhr wrote:
> Fix a number of syntax errors in contrib modules' uninstall scripts.

I'll apply this tomorrow, barring any objections.

-Neil


From: Neil Conway <neilc(at)samurai(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix syntax errors in contrib uninstall scripts
Date: 2006-03-13 18:05:19
Message-ID: 1142273119.8847.83.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Sun, 2006-03-12 at 23:24 -0700, Michael Fuhr wrote:
> Fix a number of syntax errors in contrib modules' uninstall scripts.

Applied, thanks for the patch.

-Neil