Search Postgresql Archives

psql swallowed my "BEGIN;" on reset... user beware?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After restarting the server in another window, I was surprised that my command did not run in a transaction:

spc_test_scratch=# BEGIN; DROP VIEW IF EXISTS ptest_mip ; DROP VIEW rent_info; \i create.view.rent_info.sql
FATAL:  terminating connection due to administrator command
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
NOTICE:  view "ptest_mip" does not exist, skipping
DROP VIEW
DROP VIEW
CREATE VIEW
spc_test_scratch=# commit;
WARNING:  there is no transaction in progress
COMMIT

It looks like the behavior makes perfect sense--the "BEGIN;" failed, the server reset, psql continued processing commands.  It seems a little dangerous, though.  In my case I could/should have known, but a user could easily have no way of knowing if their server was reset by an admin.  And of course "BEGIN;" is an unusually likely candidate for first command in a series.

Is this the desired behavior, or would it be better to abort the commands at this point?

Ken



--
AGENCY Software  
A data system that puts you in control
100% Free Software
http://agency-software.org/
ken.tanzer@xxxxxxxxxxxxxxxxxxx
(253) 245-3801

Subscribe to the mailing list to
learn more about AGENCY or
follow the discussion.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux