Stored Function EXCEPTION detection by Perl using DBI
От | Rich Hall |
---|---|
Тема | Stored Function EXCEPTION detection by Perl using DBI |
Дата | |
Msg-id | 4061C50F.7030600@micropat.com обсуждение исходный текст |
Список | pgsql-general |
Thisa is probably the wrong forum for this question. But perhaps I could be pointed to the correct forum. I am in the final stages of converting an Oracle database to PostgreSQL. I have just received the Perl script which will drive the application and call my stored functions. When the stored functions succeed, everythng runs well. My issue is with having the Perl script react appropriately to problems with the stored functions. When my functions encounter a non-recoveralbe error they should not commit, so they fire off a RAISE EXCEPTION. But the Perl script gets more than what my stored function sent by RAISE EXCEPTION. As a test I created this function: (this is the operative code for the function, not the DDL) BEGIN RAISE EXCEPTION 'IMMEDIATE FALSE FAILURE'; END; Upon encountering an error, the Perl script dumps the string returned by the DBI function errstr. ( print( $sth->errstr() . "\n"; ) This is what gets "print"ed: ERROR: IMMEDIATE FALSE FAILURE (SQL-HY000) ERROR: IMMEDIATE FALSE FAILURE (SQL-08S01)(DBD: st_execute/SQLExecute err=-1) What is contributed by PostgreSQL besides my error string? e.g. "IMMEDIATE FALSE FAILURE" Is the rest, as I suspect, a DBI/DBD issue? Can I be pointed to documentation specific to the PostgreSQL DBD driver Rick
В списке pgsql-general по дате отправления: