From: | Philip Warner <pjw(at)rhyme(dot)com(dot)au> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: More on elog and error codes |
Date: | 2001-03-22 06:40:22 |
Message-ID: | 3.0.5.32.20010322174022.00b4fe60@mail.rhyme.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
At 00:35 22/03/01 -0500, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>> This is a problem, I agree - but a procedural one. We need to make
>> registering messages easy. To do this, rather than having a central message
>> file, perhaps do the following:
>
>> - allow multiple message files (which can be processed to produce .h
>> files). eg. pg_dump would have it's own pg_dump_messages.xxx file.
>
>However, a system that uses multiple message files is also not going to
>discourage near-duplicates very effectively. I don't think you can have
>it both ways: if you are discouraging near-duplicates, then you are
>making it harder to for people to create new messages, whether
>duplicates or not.
Many of the near duplicates are in the same, or related, code so with local
message files there should be a good chance of reduced duplicates.
Other advantages of a separate definition include:
- Extra fields (eg. description, resolution) which could be used by client
programs.
- Message IDs which can be checked by clients to detect specific errors,
independent of locale.
- SQLCODE set in one place, rather than developers having to code it in
multiple places.
The original proposal also included a 'class' field:
elogc(ERROR, PGERR_TYPE, "type %s cannot be created because it already
ISTM that we will have a similar allocation problem with these. But, more
recent example have exluded them, so I am not sure about their status is
Peter's plans.
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Lockhart | 2001-03-22 06:44:16 | Re: Strange results of CURRENT_TIMESTAMP |
Previous Message | Bruce Momjian | 2001-03-22 06:29:50 | run of pgindent |