Re: example table functions?

From: Joe Conway <mail(at)joeconway(dot)com>
To: culley harrelson <culley(at)ml1(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: example table functions?
Date: 2003-01-04 00:45:38
Message-ID: 3E162EB2.5060207@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

culley harrelson wrote:
> Does anyone have some sample table functions they could post? I read in
> the archives about something in contrib but currently I only have 7.3
> running in Cygwin (I am patiently waiting for the FreeBSD Postgresql port
> to be updated to 7.3) and I don't see any sign of contrib on Cygiwn...
> I'd love to tinker around with functions returning multiple rows without
> guessing at the syntax :)

You didn't say which language you were looking for examples in, but I recently
posted a plpgsql example here in Roberto Mello's PostgreSQL Cookbook:
http://www.brasileiro.net:8080/postgres/cookbook/view-one-recipe.adp?recipe_id=11378

There are other plpgsql and sql function examples in the mailing list
archives. Couple of examples:

http://archives.postgresql.org/pgsql-general/2002-10/msg00022.php
and
http://archives.postgresql.org/pgsql-general/2002-12/msg00426.php

There is a recent example in Elein Mustain's "General Bits" column:
http://archives.postgresql.org/pgsql-general/2002-12/msg00426.php

The contrib table functions are all C based. You can download them directly
from cvs -- for instructions see:
http://developer.postgresql.org/TODO/docs/cvs.html#ANONCVS

or just to browse see:
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/dblink/
and
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/tablefunc/

And finally, in the manual see:

general ->
http://developer.postgresql.org/docs/postgres/xfunc-tablefunctions.html

sql ->
http://developer.postgresql.org/docs/postgres/xfunc-sql.html (sec 9.2.4)

C ->
http://developer.postgresql.org/docs/postgres/xfunc-c.html (sec 9.5.6)

plpgsql ->
http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html

usage ->
http://developer.postgresql.org/docs/postgres/sql-select.html (from_item,
inputs, from clause, usage)

Possibly others, but that's all I can think of.

HTH,

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-01-04 00:50:33 Re: boolean over char(1)
Previous Message Tom Lane 2003-01-03 22:49:27 Re: postmaster.pid