Re: Script terminates even though ON_ERROR_STOP not set
От | Bradley Kieser |
---|---|
Тема | Re: Script terminates even though ON_ERROR_STOP not set |
Дата | |
Msg-id | 41E80B4F.9040701@kieser.net обсуждение исходный текст |
Ответ на | Re: Script terminates even though ON_ERROR_STOP not set (Michael Fuhr <mike@fuhr.org>) |
Ответы |
Re: Script terminates even though ON_ERROR_STOP not set
|
Список | pgsql-admin |
Okay, Michael gets that trophy! Thanks Michael, it needed a commit. However, this is odd. I get a "No transaction in progress" error coming out on the commit, but at least it works, so I am happy! Thank you! This works: psql -U$dba $db << END drop schema $repschema cascade; commit; create schema $repschema authorization $repuser; END Tis doesn't: psql -U$dba $db << END drop schema $repschema cascade; create schema $repschema authorization $repuser; END Brad Michael Fuhr wrote: >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? > > >
В списке pgsql-admin по дате отправления: