Обсуждение: Table A-1. PostgreSQL Error Codes (WITH constants)

Поиск
Список
Период
Сортировка

Table A-1. PostgreSQL Error Codes (WITH constants)

От
kdio@uenf.br
Дата:
For easy COPY/PASTE, here goes (attached) a revisised "Table A-1. PostgreSQL
Error Codes" with a new column "Constant".

Best Regards.



----------------------------------------------------------------
Mensagem enviada pelo Webmail UENF: http://www.grc.uenf.br/webmail


Вложения

Re: Table A-1. PostgreSQL Error Codes (WITH constants)

От
Bruce Momjian
Дата:
kdio@uenf.br wrote:
> For easy COPY/PASTE, here goes (attached) a revisised "Table A-1. PostgreSQL
> Error Codes" with a new column "Constant".

Uh, our documentation is in SGML, particularly
doc/src/sgml/errcodes.sgml.  Can you send a patch to that file or should
I merge your HTML into there?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Table A-1. PostgreSQL Error Codes (WITH constants)

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> kdio@uenf.br wrote:
>> For easy COPY/PASTE, here goes (attached) a revisised "Table A-1. PostgreSQL
>> Error Codes" with a new column "Constant".

> Uh, our documentation is in SGML, particularly
> doc/src/sgml/errcodes.sgml.  Can you send a patch to that file or should
> I merge your HTML into there?

What exactly is the point of the change at all?

            regards, tom lane

Re: Table A-1. PostgreSQL Error Codes (WITH constants)

От
philip@utiba.com
Дата:
> What exactly is the point of the change at all?

Take a typical line in the table:

Error Code | Meaning
23502      | NOT NULL VIOLATION

Now assume I want to catch this exception in a plpgsql function:

CREATE OR REPLACE FUNCTION foo()
/* boilerplate omitted */

EXCEPTION
    WHEN NOT_NULL_VIOLATION THEN
       RAISE WARNING 'Crikey!';
    WHEN OTHERS THEN
       RAISE NOTICE 'Oh well, [%,%]', SQLSTATE, SQLERRM;

Making the "Meaning" column almost-usable as the exception name is
frustrating. This patch would allow people writing functions to copy and
paste the exception names directly.

It's not a big deal, but it would save some re-typing for people writing a
lot of functions (me, for example).



-----------------
Utiba Pty Ltd
This message has been scanned for viruses and
dangerous content by Utiba mail server and is
believed to be clean.


Re: Table A-1. PostgreSQL Error Codes (WITH constants)

От
kdio@uenf.br
Дата:
> Uh, our documentation is in SGML, particularly
> doc/src/sgml/errcodes.sgml.  Can you send a patch to that file or should
> I merge your HTML into there?


Doing it right now ... sorry my mistake

Regards

Kdio


----------------------------------------------------------------
Mensagem enviada pelo Webmail UENF: http://www.grc.uenf.br/webmail


Re: Table A-1. PostgreSQL Error Codes (WITH constants)

От
kdio@uenf.br
Дата:
(correct format)

For easy COPY/PASTE, here goes (attached) a revisised "Table A-1. PostgreSQL
Error Codes" with a new column "Constant".

Best Regards.


----------------------------------------------------------------
Mensagem enviada pelo Webmail UENF: http://www.grc.uenf.br/webmail


Вложения

Re: Table A-1. PostgreSQL Error Codes (WITH constants)

От
Bruce Momjian
Дата:
Patch applied.  I also added section markings so it isn't one long list
with no highlighting:

    http://candle.pha.pa.us/main/writings/pgsql/sgml/errcodes-appendix.html


---------------------------------------------------------------------------

kdio@uenf.br wrote:
> (correct format)
>
> For easy COPY/PASTE, here goes (attached) a revisised "Table A-1. PostgreSQL
> Error Codes" with a new column "Constant".
>
> Best Regards.
>
>
> ----------------------------------------------------------------
> Mensagem enviada pelo Webmail UENF: http://www.grc.uenf.br/webmail
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073