From: | ncm(at)zembu(dot)com (Nathan Myers) |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Truncation of char, varchar types |
Date: | 2001-04-09 20:30:26 |
Message-ID: | 20010409133026.X3797@store.zembu.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Apr 09, 2001 at 09:20:42PM +0200, Peter Eisentraut wrote:
> Excessively long values are currently silently truncated when they are
> inserted into char or varchar fields. This makes the entire notion of
> specifying a length limit for these types kind of useless, IMO. Needless
> to say, it's also not in compliance with SQL.
>
> How do people feel about changing this to raise an error in this
> situation? Does anybody rely on silent truncation? Should this be
> user-settable, or can those people resort to using triggers?
Yes, detecting and reporting errors early is a Good Thing. You don't
do anybody any favors by pretending to save data, but really throwing
it away.
We have noticed here also that object (e.g. table) names get truncated
in some places and not others. If you create a table with a long name,
PG truncates the name and creates a table with the shorter name; but
if you refer to the table by the same long name, PG reports an error.
(Very long names may show up in machine- generated schemas.) Would
patches for this, e.g. to refuse to create a table with an impossible
name, be welcome?
Nathan Myers
ncm(at)zembu(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | John Coers | 2001-04-09 20:58:39 | libpq PQexec call of COPY |
Previous Message | The Hermit Hacker | 2001-04-09 19:27:37 | Re: Truncation of char, varchar types |