At 00:35 22/03/01 -0500, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.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 |/