Skip site navigation (1) Skip section navigation (2)

Re: Script terminates even though ON_ERROR_STOP not set

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Bradley Kieser <brad(at)kieser(dot)net>
Cc: PgSQL ADMIN <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Script terminates even though ON_ERROR_STOP not set
Date: 2005-01-14 17:54:22
Message-ID: 20050114175422.GA18434@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-admin
On Fri, Jan 14, 2005 at 12:03:02PM +0000, Bradley Kieser wrote:

> I have an admin script that drops a schema and then recreates it (quick 
> way to refresh from backup). However, if the schema doesn't exist, the 
> drop errors, as you would expect. The next SQL command, the schema 
> create, is never executed.

How do you know the create is never executed?  Are you looking for
the schema and not finding it?  How are you looking?  Or is there
an error message?  What is it?

Are you doing the drop and create in the same transaction?  If so,
then the drop statement's failure is preventing subsequent statements
in that transaction from executing.  If that's not the problem then
please post a self-contained test case so we can see exactly what
you're doing.

> I do not have ON_ERROR_STOP set so why is this happening?

How do you know ON_ERROR_STOP isn't set?  Could it be set in
a .psqlrc file?  What does \set show?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

pgsql-admin by date

Next:From: Bradley KieserDate: 2005-01-14 18:06:16
Subject: Re: Script terminates even though ON_ERROR_STOP not set
Previous:From: Tom LaneDate: 2005-01-14 16:45:20
Subject: Re: Cron DB Bounce causes index problems && Help rotating logs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group