Re: Select + Functions + Composite Types: Behavior - Mailing list pgsql-general

From David Johnston
Subject Re: Select + Functions + Composite Types: Behavior
Date
Msg-id 01eb01cbcb12$3064bfb0$912e3f10$@yahoo.com
Whole thread Raw
In response to Re: Select + Functions + Composite Types: Behavior  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
Another similar situation that I'll bring here first:

I want to do:

SELECT createdid, eventresult
FROM createvehiclesaleimport() er
INTO targetid, evtresult;

But this gives a function compilation error: ' "evtresult" is not a scalar
variable '

createdid/targeted are boolean
eventresult/evtresult are CompositeType

createvehiclesaleimport() returns (Boolean, CompositeType)

I can do:

SELECT createdid, (eventresult).prop1, (eventresult).prop2
FROM createvehiclesaleimport() er
INTO targetid, evtresult.prop1, evtresult.prop2

(with or without the 'er' alias)

What's the magic syntax to allow me to chain "eventresult/evtresult" without
having to explicitly address it's scalar components.  This is different than
the other situation in that the called function now returns both a scalar as
well as a composite type whereas the other behavior occurred when the sole
output for the called function was a compositetype.

9.0.3/plpgsql

Thanks.

David J




pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Select + Functions + Composite Types: Behavior
Next
From: Ruben Blanco
Date:
Subject: Heavy queries not run by user application