Re: DB2's row_number() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DB2's row_number()
Date
Msg-id 5771.1058466650@sss.pgh.pa.us
Whole thread Raw
In response to DB2's row_number()  (Hans-Jürgen Schönig <postgres@cybertec.at>)
List pgsql-hackers
Hans-Jürgen Schönig <postgres@cybertec.at> writes:
> question is: How do I find out when a query starts? Inside a table 
> function I can call SRF_IS_FIRSTCALL() to see when it is called first. 
> Is there an easy way to check that inside an "ordinary" C function 
> returning just one value?

Use fn_extra to store some state data.
pg_stat_get_backend_idset() is a useful example.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Patches List
Next
From: Bruce Momjian
Date:
Subject: I am back