Re: [HACKERS] Should cast to CHAR or NUMERIC enforce default length limit?

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Should cast to CHAR or NUMERIC enforce default length limit?
Date: 2000-01-19 16:24:40
Message-ID: 3885E548.69CE8FA1@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kurt Seel 2000-01-19 16:24:59 running two servers on one machine
Previous Message Tom Lane 2000-01-19 15:50:20 Re: [HACKERS] Daily regression testing via vmware - useful?