Re: slow query execution - Mailing list pgsql-sql

From Rodrigo De León
Subject Re: slow query execution
Date
Msg-id a55915760705301028r69887f67q2efcb814550b80c5@mail.gmail.com
Whole thread Raw
In response to Re: slow query execution  (Trigve Siver <trigves@yahoo.com>)
List pgsql-sql
On 5/30/07, Trigve Siver <trigves@yahoo.com> wrote:
> Can you point me to some sources
> or give me some examples, please?

CREATE OR REPLACE FUNCTION ROWNUM() RETURNS BIGINT AS
$$BEGIN    RETURN NEXTVAL('ROWNUM_SEQ');EXCEPTION WHEN OTHERS THEN    CREATE TEMP SEQUENCE ROWNUM_SEQ;    RETURN
NEXTVAL('ROWNUM_SEQ');END;
$$
LANGUAGE 'PLPGSQL';

SELECT ROWNUM(), S.X
FROM GENERATE_SERIES(5,1,-1) S(X);

Remember to reset the sequence value if you use this more than once in
the same session.


pgsql-sql by date:

Previous
From: Trigve Siver
Date:
Subject: Re: slow query execution
Next
From: Trigve Siver
Date:
Subject: Re: slow query execution