>>> On Fri, Jan 4, 2008 at 4:46 PM, in message <24033.1199486819@sss.pgh.pa.us>,
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I don't see anything in that thread that shows the view definition
It was in the first post on the other thread, but for convenience:
bigbird=# \d "CaseTypeHistEvent" View "public.CaseTypeHistEvent" Column | Type | Modifiers
----------------+---------------+-----------caseType | "CaseTypeT" |eventType | "EventTypeT" |descr
| "EventDescrT" |isActive | boolean |isKeyEvent | boolean |isMoneyEnabled | boolean
|keyEventSeqNo | integer |countyNo | "CountyNoT" |
View definition:SELECT b."caseType", b."eventType", b.descr, b."isActive", CASE WHEN d."eventType" IS
NOTNULL THEN d."isKeyEvent" ELSE b."isKeyEvent" END AS "isKeyEvent", CASE WHEN
d."eventType"IS NOT NULL THEN d."isMoneyEnabled" ELSE b."isMoneyEnabled" END AS "isMoneyEnabled",
COALESCE( CASE WHEN d."eventType" IS NOT NULL THEN d."keyEventSeqNo"::smallint ELSE
b."keyEventSeqNo"::smallint END::integer, 0) AS "keyEventSeqNo", c."countyNo" FROM ONLY "CaseTypeHistEventB" b
JOINONLY "ControlRecord" c ON 1 = 1 LEFT JOIN ONLY "CaseTypeHistEventD" d ON d."caseType"::bpchar =
b."caseType"::bpcharAND d."eventType"::bpchar = b."eventType"::bpchar AND d."countyNo"::smallint =
c."countyNo"::smallint;
> nor mentions the data types involved.
I'll pull those together and post shortly. All are domains
without modifiers or checks.
-Kevin