pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
name of a column returned from a table function
2+ messages / 2 participants
[nested] [flat]

* name of a column returned from a table function
@ 2004-01-19 11:35  Iain <iain@mst.co.jp>
  0 siblings, 1 reply; 2+ messages in thread

From: Iain @ 2004-01-19 11:35 UTC (permalink / raw)
  To: pgsql-sql

DB Version 7,4.

I had a look through the docs, but the information on table functions (those
returning SETOF something) seems to have gone missing from the 7.4 docs. I
found something under 7.3, but it didn't answer my question, which is...

I've written a little table function that simply returns all the dates in a
month. No problems so far. Now I want to outer join this list to another
table, but I dont know what to call the column returned by the function. All
the examples I saw just had "select * from <fnname>".

I want do something like "select <fnsdatecolname>,... from <myfn> join
<atable> on (<fnsdatecolname> = <atablesdatecolname>;

Searching the lists, I found something to the effect that this might have
problems. Is that still the case?

Thanks
Iain

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: name of a column returned from a table function
@ 2004-01-19 15:07  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Iain <iain@mst.co.jp>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-01-19 15:07 UTC (permalink / raw)
  To: Iain <iain@mst.co.jp>; +Cc: pgsql-sql

"Iain" <iain@mst.co.jp> writes:
> I've written a little table function that simply returns all the dates in a
> month. No problems so far. Now I want to outer join this list to another
> table, but I dont know what to call the column returned by the
> function.

Same as the name of the function, unless you supply a column alias to
change it to something else.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-01-19 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19 11:35 name of a column returned from a table function Iain <iain@mst.co.jp>
2004-01-19 15:07 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox