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 eA3Ltws23477; Fri, 3 Nov 2000 16:55:58 -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 eA3Ltn508280; Fri, 3 Nov 2000 16:55:49 -0500 (EST) To: Frank Joerdens cc: Thomas Lockhart , pgsql-hackers@postgreSQL.org, pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] DBD::Pg installation seems to fail with 7.1 libs In-reply-to: <20001103143435.A16341@rakete.joerdens.de> References: <20001103143435.A16341@rakete.joerdens.de> Comments: In-reply-to Frank Joerdens message dated "Fri, 03 Nov 2000 14:34:35 +0100" Date: Fri, 03 Nov 2000 16:55:48 -0500 Message-ID: <8277.973288548@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/133 X-Sequence-Number: 212 Frank Joerdens writes: > [ DBD::Pg fails against current sources with ] > DBD::Pg::db table_info failed: ERROR: Unable to identify an ordering > operator '<' for type 'unknown' Hmm. It looks like this is caused by my reimplementation of UNION to use CASE-style datatype resolution. The DBD code is fetching table data with a UNION that includes a couple of untyped literal constants. Boiled down: regression=# select 'foo' union select 'bar'; ERROR: Unable to identify an ordering operator '<' for type 'unknown' Use an explicit ordering operator or modify the query This is bad, since the same query used to work pre-7.1. The reason it worked is that the old UNION code had an ugly hack to force such constants to be treated as type text. There is no such hack in the datatype unification code right now. Thomas, you've been muttering about altering the type resolution rules so that "unknown" will be treated as "text" when all else fails. Are you planning to commit such a thing for 7.1? If not, I'll probably have to hack up parse_coerce.c's select_common_type(), along the lines of } } } + /* if all inputs are UNKNOWN, treat as text */ + if (ptype == UNKNOWNOID) + ptype = TEXTOID; return ptype; } This might be an appropriate change anyway. Comments? regards, tom lane