From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Jorge Arevalo <jorgearevalo(at)gis4free(dot)org> |
Cc: | PostgreSQL - General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Writing SRF |
Date: | 2010-04-28 17:00:58 |
Message-ID: | 20234.1272474058@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Jorge Arevalo <jorgearevalo(at)gis4free(dot)org> writes:
> I'm writing a SRF following the example from
> http://www.postgresql.org/docs/8.4/interactive/xfunc-c.html (section
> 34.9.10). In the example, in the code executed in first call, we get
> the number of tuples to be returned, and no more. Then, in each call,
> a new tuple is allocated and returned, until reach max_calls.
You don't have to do it that way, by any means. max_calls is just
a field you can use if you feel like it --- it's not going to be
looked at by anything outside your SRF. If you don't want to determine
the number of result rows at the start, just ignore max_calls, and
use whatever method is convenient to decide that you're done
returning rows.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | John R Pierce | 2010-04-28 17:03:53 | Re: How many threads/cores Postgres can utilise? |
Previous Message | sunpeng | 2010-04-28 16:43:28 | only one namespace allowed by a authid at pg_namespace table? |