example table functions? 
Author Message
 example table functions?
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 :)

culley

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Wed, 22 Jun 2005 05:43:13 GMT
 example table functions?

Quote:

> 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?...

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/table...

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-structu...

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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Wed, 22 Jun 2005 08:50:06 GMT
 example table functions?

Quote:

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

Oops! That was a cut-n-pasto. Here's the real link:
   http://www.varlena.com/GeneralBits/6.html

Joe

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Wed, 22 Jun 2005 09:47:50 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Add new table and add fields to table - Syntax - Working Code Example

2. Add records to an empty table - AddNewX.cpp example fails with an empty table

3. Example of function to use with DBMS_REPCAT.ADD_DELETE_RESOLUTION

4. Need Create Java Function example, Please

5. FM Pro5 scripting,functions& calc examples

6. FM Pro5 scripting, functions & calculations examples

7. SETOF (was: Function example returning more then 1

8. example of Create Function

9. PL/SQL Function Example?

10. Hey Microsoft, How About Some API Function Examples Written In Visual Basic

11. Create function : somes examples

12. WNT: JDBC to PL/SQL function example


 
Powered by phpBB® Forum Software