John Lawler <postgresql.org@xxxxxxxxx> writes: > Plus, the main part was to be able to have the columns (arbitrarily) > named as if they'd been selected from a table. I hope that there's > something about as easy as the example I cited from MS SQL. In existing releases you need to create a named composite type (row type) and declare the function as returning that type. PG 8.1 will provide some syntactic sugar for this in the form of OUT parameters. There are examples in the docs ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match