SQL_CALC_FOUND_ROWS equivalent in PostgreSQL

From: "Matt Arnilo S(dot) Baluyos (Mailing Lists)" <matt(dot)baluyos(dot)lists(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: SQL_CALC_FOUND_ROWS equivalent in PostgreSQL
Date: 2007-07-31 01:22:25
Message-ID: d1a6d7930707301822geda34b2i1e558ccd84ca9513@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello everyone,

I would like to use PostgreSQL with the SmartyPaginate plugin of the
Smarty template engine.

In the examples on the documentation, the following two queries are used:

SELECT SQL_CALC_FOUND_ROWS * FROM mytable LIMIT X,Y
SELECT FOUND_ROWS() as total

What the SQL_CALC_FOUND_ROWS does is that it allows the FOUND_ROWS()
function to return the total rows if the first query didn't have the
LIMIT.

Is there an equivalent function in PostgreSQL for this or perhaps a workaround?

Thanks,
Matt

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Decibel! 2007-07-31 01:36:19 Re: BUG #3488: exporting data
Previous Message Christian Leclerc 2007-07-30 16:40:19 Auto-vacuum parameters (Postgres 8.2 on Windows Server 2003)