Philip Warner <p...@rhyme.com.au> writes: > I'd like a formulation like: > Select Row(T1.T1F7 as F1, T2.T2F3 as F2, Tp.Fq as Fn)::FOO By Name > Or > Select FOO(F1:=T1.T1F7, F2:=T2.T2F3, Fn:=Tp.Fq)
> Basically: it's some form of UDT constructor with named parameters, > whether by cast, pseudo function call or some other mechanism. Well, you can build a real function call that does that: CREATE FUNCTION FOO(F1 int, F2 int, ...) RETURNS FOO AS ...; SELECT FOO(F1 => T1.T1F7, F2 => T2.T2F3, ...) FROM ...; Admittedly you have to get the ROW() constructor right in the body of function FOO, but then you've got it. This approach also lets you insert appropriate default values for unspecified columns, which is a feature we surely wouldn't build in if this were wired-in syntax. regards, tom lane