[OPEN-ILS-DEV] PATCH: Drop Schemas

Mike Rylander mrylander at gmail.com
Fri May 21 12:56:37 EDT 2010


On Thu, May 20, 2010 at 4:23 PM, Jason Stephenson <jstephenson at mvlc.org> wrote:
> Hi,
>
> The attached patch (with DCO) adds "IF EXISTS" after all DROP SCHEMA
> statements where it is currently missing in the scripts in
> Open-ILS/src/sql/Pg directory. The patch is generated against trunk/r16465.
>
> A similar change could be made to 1.6 or earlier releases by running
> something like:
>

Since support for older Postgres releases is going away in 2.0 (trunk)
and older Postgres' don't support IF EXISTS (8.1 for sure, don't
recall on 8.2), I'm only going to apply it there.

Thanks, Jason!

--miker

> sed -r -e 's/(DROP SCHEMA) ([^[:upper:]])/\1 IF EXISTS \2/' -i *.sql
>
> NOTE: Use -E instead of -r if using a BSD sed. The above is for GNU sed.
>
> I thought of creating/submitting this patch after a new user noticed
> messages about non-existent schemas while running eg_db_config.pl.
>
> I am all about getting rid of spurious warnings that don't serve any real
> purpose.
>
> Cheers,
> Jason Stephenson
> Merrimack Valley Library Consortium
>



-- 
Mike Rylander
 | VP, Research and Design
 | Equinox Software, Inc. / The Evergreen Experts
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  miker at esilibrary.com
 | web:  http://www.esilibrary.com


More information about the Open-ils-dev mailing list