Re: Current enums patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: Current enums patch
Date
Msg-id 28858.1175549250@sss.pgh.pa.us
Whole thread Raw
In response to Re: Current enums patch  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> Why not put the create-time length test into EnumValuesCreate's loop,
>> which has to grovel through the list already?

> My idea was to do the error check before calling TypeCreate. If that
> doesn't matter I can move it - it just seemed a bit cleaner to do it
> that way than to have to roll back a change to pg_type.

Well, if this were a performance-critical case then yes, but it isn't.
I'd just as soon keep the code compact.  Besides, typecmds.c isn't
really directly aware of this issue: the reason it's EnumValuesCreate's
bailiwick is that the latter is what's truncating the strings.  If we
ever wanted to change the behavior, it'd be better to keep the
knowledge more localized.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgbench transaction timestamps
Next
From: Bruce Momjian
Date:
Subject: Re: Warning about LISTEN names