Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0BIrPp32182 for ; Thu, 11 Jan 2001 13:53:25 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f0BIrFJ12172; Thu, 11 Jan 2001 13:53:15 -0500 (EST) To: Justin Clift cc: pgsql-sql@postgresql.org Subject: Re: Bad (null) varchar() external representation In-reply-to: <3A5CA5FA.CBDF0513@bigpond.net.au> References: <3A5CA5FA.CBDF0513@bigpond.net.au> Comments: In-reply-to Justin Clift message dated "Thu, 11 Jan 2001 05:12:10 +1100" Date: Thu, 11 Jan 2001 13:53:14 -0500 Message-ID: <12169.979239194@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/108 X-Sequence-Number: 769 Justin Clift 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