Re: [HACKERS] Should cast to CHAR or NUMERIC enforce default length limit?
От | Thomas Lockhart |
---|---|
Тема | Re: [HACKERS] Should cast to CHAR or NUMERIC enforce default length limit? |
Дата | |
Msg-id | 3885E548.69CE8FA1@alumni.caltech.edu обсуждение исходный текст |
Ответ на | Should cast to CHAR or NUMERIC enforce default length limit? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [HACKERS] Should cast to CHAR or NUMERIC enforce default length limit?
|
Список | pgsql-hackers |
> I think this could be done by having gram.y insert -1 as the default > typmod for a "char" or "numeric" Typename. The rest of the system > already interprets such a typmod as specifying no particular length > constraint. Then, to preserve the rule that > create table foo (bar char); > creates a char(1) field, analyze.c would have to be responsible for > inserting the appropriate default length in place of -1 when processing > a column definition. Sounds good. My first inclination was to work this out in gram.y, which you could do pretty easily for TYPECAST rules, but perhaps it would be better to isolate *all* of the default size settings to a separate routine called from the appropriate place. Eventually, this could even be a tunable parameter settable during the session (e.g. "SET DEFAULT PRECISION NUMERIC ..."). - Thomas -- Thomas Lockhart lockhart@alumni.caltech.edu South Pasadena, California
В списке pgsql-hackers по дате отправления: