Re: Returning setof records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Scott Schulthess" <scott@xxxxxxxxxxxx> writes:
> :( I realize it often automatically converts, and I've tried using
> varchar and char for the state column, as well as int4, integer, and int
> for the other columns.

[ looks again... ]  Oh, wait, you're getting caught by a standard
plpgsql gotcha:

> create function placenamesearch(place text, state integer, county text,
                                              ^^^^^
> FOR myview IN SELECT featurename, countyname, state, featuretype,
                                                ^^^^^

plpgsql variable names win out over table column names, so what's coming
back in the SELECT result's third column is the integer "state"
parameter.

			regards, tom lane


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux