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 furthersleuthing on my own. Here's the source of the
problem:
The last select of the union view includes a custom function in theSELECT clause. This function works on its own. It
worksin theSELECT clause when called from the command line. It also works if Icall 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
havetried toreproduce it using a simpler view that I could post to you, and Ican't. Since I can't give you the whole
databaseat this time (IPagreements), and I have a workaround, I will document thecircumstances:
1. Build a UNION view with four SELECTs unioned, each of which has 10columns and references at least 4 tables.
2. The top 3 SELECTs should include a DATE column from one of thetables.
3. The 4th SELECT should include:a. a reference to another moderately complex viewb. a moderately complex (100 lines)
customplpgsql function resultingin a TIMESTAMP value which supplies a column to align with the DATEvalue in the top
threeSELECTs.
You may get the error I reported. Under any other circumstances, itdoesn't happen.
*sigh*. Only me ....
Thanks for you patience, Tom.
-Josh