Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7CCCF475F5F for ; Wed, 15 Jan 2003 10:04:36 -0500 (EST) Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) by postgresql.org (Postfix) with ESMTP id 99A37475E42 for ; Wed, 15 Jan 2003 09:51:28 -0500 (EST) Received: from trooper.velocet.ca (trooper.velocet.net [216.138.242.2]) by sabre.velocet.net (Postfix) with ESMTP id 8BF1C13814E for ; Wed, 15 Jan 2003 09:51:32 -0500 (EST) Received: by trooper.velocet.ca (Postfix, from userid 66) id 5D9BF7462A; Wed, 15 Jan 2003 09:51:32 -0500 (EST) Received: by canoe.velocet.net (Postfix, from userid 101) id 55E61567602; Wed, 15 Jan 2003 09:51:28 -0500 (EST) From: David Gilbert MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15909.30064.257538.752011@canoe.velocet.net> Date: Wed, 15 Jan 2003 09:51:28 -0500 To: pgsql-admin@postgresql.org Subject: Query failing with strange error. X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/158 X-Sequence-Number: 7000 In the middle of a script, inside a transaction, I run the following query: update customer_contact set next_billed=min(customer_services.eff_date) where customer_contact.conn_num=7698 and customer_services.conn_num=7698 and customer_services.inv_num=0 I have also tried changing this to update customer_contact set next_billed=min(customer_services.eff_date) where customer_contact.conn_num=7698 and customer_services.conn_num=customer_contact.conn_num and customer_services.inv_num=0 ... which changes the query plan, but both give the following error: ERROR: ExecutePlan: (junk) `ctid' is NULL! Now... I tried dumping and reloading the database. Then I upgraded from 7.2.1 to 7.2.3 (and reloaded the database from scratch). Neither worked. The odd part about the error is that this query gets executed 100's of times a day with different conn_num values. Only this conn_num gives the error. This conn_num exists in both tables. eff_date has a senable value (it's a 'timestamp with timezone'). In fact: sales=# select min(next_billed),min(customer_services.eff_date) from customer_contact, customer_services where customer_contact.conn_num=7698 and customer_services.conn_num=7698 and customer_services.inv_num=0; min | min ------------+------------------------ 2003-01-23 | 2003-01-23 00:00:00-05 (1 row) Anyone got any ideas? Dave. -- ============================================================================ |David Gilbert, Velocet Communications. | Two things can only be | |Mail: dgilbert@velocet.net | equal if and only if they | |http://daveg.ca | are precisely opposite. | =========================================================GLO================