From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Clift <aa2@bigpond.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Bad (null) varchar() external representation
Date: Thu, 11 Jan 2001 13:53:14 -0500
Message-ID: <12169.979239194@sss.pgh.pa.us> (raw)
In-Reply-To: <3A5CA5FA.CBDF0513@bigpond.net.au>
References: <3A5CA5FA.CBDF0513@bigpond.net.au>
Justin Clift <aa2@bigpond.net.au> writes:
> "Bad (null) varchar() external representation"
This is a known stupidity in 7.0.* and before: length(varchar) doesn't
like NULLs:
play=> select length(null::varchar);
ERROR: Bad (null) varchar() external representation
It's fixed for 7.1. If it's really bothering you in 7.0.*, find that
error string in src/backend/utils/adt/varchar.c and change the code to
return 0 instead of raising an error for NULL input.
But, as someone else pointed out, the constraint expressions you are
using are redundant anyway, given the declared column length limits.
Getting rid of the constraints might be your easiest workaround for now.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, aa2@bigpond.net.au
Subject: Re: Bad (null) varchar() external representation
In-Reply-To: <12169.979239194@sss.pgh.pa.us>
References: <3A5CA5FA.CBDF0513@bigpond.net.au> <12169.979239194@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox