pgsql: Implement two new special variables in PL/PgSQL: SQLSTATE and

Поиск
Список
Период
Сортировка
От neilc@svr1.postgresql.org (Neil Conway)
Тема pgsql: Implement two new special variables in PL/PgSQL: SQLSTATE and
Дата
Msg-id 20050610162312.54B3752875@svr1.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Implement two new special variables in PL/PgSQL: SQLSTATE and SQLERRM.
These contain the SQLSTATE and error message of the current exception,
respectively. They are scope-local variables that are only defined
in exception handlers (so attempting to reference them outside an
exception handler is an error). Update the regression tests and the
documentation.

Also, do some minor related cleanup: export an unpack_sql_state()
function from the backend and use it to unpack a SQLSTATE into a
string, and add a free_var() function to pl_exec.c

Original patch from Pavel Stehule, review by Neil Conway.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        plpgsql.sgml (r1.70 -> r1.71)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/plpgsql.sgml.diff?r1=1.70&r2=1.71)
    pgsql/src/backend/utils/error:
        elog.c (r1.159 -> r1.160)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/elog.c.diff?r1=1.159&r2=1.160)
    pgsql/src/include/utils:
        elog.h (r1.78 -> r1.79)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/elog.h.diff?r1=1.78&r2=1.79)
    pgsql/src/pl/plpgsql/src:
        gram.y (r1.74 -> r1.75)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/gram.y.diff?r1=1.74&r2=1.75)
        pl_comp.c (r1.90 -> r1.91)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_comp.c.diff?r1=1.90&r2=1.91)
        pl_exec.c (r1.142 -> r1.143)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c.diff?r1=1.142&r2=1.143)
        pl_funcs.c (r1.40 -> r1.41)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_funcs.c.diff?r1=1.40&r2=1.41)
        plpgsql.h (r1.61 -> r1.62)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/plpgsql.h.diff?r1=1.61&r2=1.62)
    pgsql/src/test/regress/expected:
        plpgsql.out (r1.32 -> r1.33)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/plpgsql.out.diff?r1=1.32&r2=1.33)
    pgsql/src/test/regress/sql:
        plpgsql.sql (r1.27 -> r1.28)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/plpgsql.sql.diff?r1=1.27&r2=1.28)

В списке pgsql-committers по дате отправления:

Предыдущее
От: momjian@svr1.postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Use saveHistory so we get a nice error message on failure.
Следующее
От: neilc@svr1.postgresql.org (Neil Conway)
Дата:
Сообщение: pgsql: Minor cleanup of documentation for recently-added HISTFILE psql