Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1GJw6E07071 for ; Sat, 16 Feb 2002 14:58:07 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 695920; Sat, 16 Feb 2002 11:58:05 -0800 From: "Josh Berkus" Subject: Re: More problems with 7.2 & functions To: Tom Lane Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Sat, 16 Feb 2002 11:58:05 -0800 Message-ID: In-Reply-To: <20728.1013886407@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/201 X-Sequence-Number: 6627 Tom, > Could I trouble you for a full schema dump of these tables, so I > don't > have to waste time trying to reverse-engineer tables that will match > the view? Yeah, I was hoping that it would be an "Oh, yeah, THAT bug" from you. Apparently it's not. To avoid having to dump half my database, I've done some further sleuthing on my own. Here's the source of the problem: The last select of the union view includes a custom function in the SELECT clause. This function works on its own. It works in the SELECT clause when called from the command line. It also works if I call it as the first select query of the UNION, but not as the last. However, the bug is NOT reproduceable with a less complex model -- possibly not reproduceable on any other database. I have tried to reproduce it using a simpler view that I could post to you, and I can't. Since I can't give you the whole database at this time (IP agreements), and I have a workaround, I will document the circumstances: 1. Build a UNION view with four SELECTs unioned, each of which has 10 columns and references at least 4 tables. 2. The top 3 SELECTs should include a DATE column from one of the tables. 3. The 4th SELECT should include: a. a reference to another moderately complex view b. a moderately complex (100 lines) custom plpgsql function resulting in a TIMESTAMP value which supplies a column to align with the DATE value in the top three SELECTs. You may get the error I reported. Under any other circumstances, it doesn't happen. *sigh*. Only me .... Thanks for you patience, Tom. -Josh