Re: Can I User @@error of MS SQL in postgresql
От | Ian Harding |
---|---|
Тема | Re: Can I User @@error of MS SQL in postgresql |
Дата | |
Msg-id | sdf0496a.083@mail.tpchd.org обсуждение исходный текст |
Ответ на | Can I User @@error of MS SQL in postgresql ("annachau" <annachau@hongkong.com>) |
Ответы |
Re: Can I User @@error of MS SQL in postgresql
|
Список | pgsql-general |
PostgreSQL is much more strict about error handling. MSSQLServer will continue merrily along without interrupting the procedureor affecting the in-progress transaction if errors occur. It is up to you to catch them and decide how to handlethem. PGSQL will ignore all further queries and roll back the transaction automatically if any errors are returnedfrom a query. In other words, you don't have to worry about it. If there are cases where the action failing wouldbe OK, you need to test for those cases (i.e. duplicate key already exists) before the action. Keep in mind that thosechecks will not always be valid given the status of other transactions and your isolation level. Isn't this fun? Ian Harding Programmer/Analyst II Tacoma-Pierce County Health Department iharding@tpchd.org (253) 798-3549 >>> "annachau" <annachau@hongkong.com> 12/05/02 11:13PM >>> I have a plpgsql function to insert a record into a table. In MS SQL, I can user @@error to check the insert action is completedor not. What can I do in postgresql? Thanks a lot. ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
В списке pgsql-general по дате отправления: