Michael Fuhr wrote:
Right -- when you open a cursor PostgreSQL doesn't know how many
rows it will return. PostgreSQL selects a query plan based on an
*estimate* of how many rows the query will return, but until you
fetch all the rows you can't know for sure how many rows there will
be.
So if
On Wed, Aug 24, 2005 at 05:34:49PM -0600, Michael Fuhr wrote:
> On Wed, Aug 24, 2005 at 04:47:16PM -0400, Lane Van Ingen wrote:
> > Given the following data in a table named 'foo' :
> > id update_time description
> > 22005-08-24 00:10:00 transaction1
> > 22005-0
"Lane Van Ingen" <[EMAIL PROTECTED]> writes:
> I want to select 2nd oldest transaction from foo (transaction 3).
Can't you just do
select * from foo order by update_time desc offset 1 limit 1
regards, tom lane
---(end of broadcast)
On Wed, Aug 24, 2005 at 04:47:16PM -0400, Lane Van Ingen wrote:
> Given the following data in a table named 'foo' :
> id update_time description
> 22005-08-24 00:10:00 transaction1
> 22005-08-24 00:22:00 transaction2
> 22005-08-24 00:34:00 transacti
Given the following data in a table named 'foo' :
id update_time description
22005-08-24 00:10:00 transaction1
22005-08-24 00:22:00 transaction2
22005-08-24 00:34:00 transaction3
22005-08-24 00:58:00 transaction4
I want to select 2nd old
On Tue, 2005-08-16 at 14:53, The One wrote:
> Hello,
>
> I have a table with one encrypted column.
> How can I do a select statement such that it will select all columns
> from the table and at the same time will decrypt it too?
A view should be able to do that...
---(en
On Wed, Aug 24, 2005 at 04:29:00PM +0200, Bo Lorentsen wrote:
> Michael Fuhr wrote:
> >...which is the same reason a cursor doesn't know how many rows it will
> >fetch until you fetch them all (or MOVE to the end of the cursor,
> >which fetches the rows internally).
>
> So, Postgresql is not hiddin
Josep Sanmartí wrote:
Hello,
I have a 'big' problem:
I have the following table users(name, start_time, end_time), a new row
is set whenever a user logs into a server. I want to know how many
users have logged in EVERYDAY between 2 different dates. The only idea
that I have is making several
Michael Fuhr wrote:
...which is the same reason a cursor doesn't know how many rows it will
fetch until you fetch them all (or MOVE to the end of the cursor,
which fetches the rows internally).
So, Postgresql is not hidding something for me, it just, like me, don't
know ?
/BL
On Aug 24, 2005, at 11:03 PM, Sean Davis wrote:
On 8/24/05 9:46 AM, "Josep Sanmartí" <[EMAIL PROTECTED]>
wrote:
Hello,
I have a 'big' problem:
I have the following table users(name, start_time, end_time), a
new row
is set whenever a user logs into a server. I want to know how many
user
On Wed, 2005-08-24 at 15:46 +0200, Josep Sanmartí wrote:
> Hello,
> I have a 'big' problem:
> I have the following table users(name, start_time, end_time), a new row
> is set whenever a user logs into a server. I want to know how many
> users have logged in EVERYDAY between 2 different dates. Th
On 8/24/05 9:46 AM, "Josep Sanmartí" <[EMAIL PROTECTED]> wrote:
> Hello,
> I have a 'big' problem:
> I have the following table users(name, start_time, end_time), a new row
> is set whenever a user logs into a server. I want to know how many
> users have logged in EVERYDAY between 2 different dat
Hello,
I have a 'big' problem:
I have the following table users(name, start_time, end_time), a new row
is set whenever a user logs into a server. I want to know how many
users have logged in EVERYDAY between 2 different dates. The only idea
that I have is making several select (one for each da
On Wed, Aug 24, 2005 at 02:50:07PM +0200, Bo Lorentsen wrote:
> Russell Simpkins wrote:
> >If you need a count, why not just execute one of the methods to get a
> >count. i.e.e select count(id) ...
>
> The reason why i don't just make a count and then a selection of data
> is performance.
...w
Russell Simpkins wrote:
If you need a count, why not just execute one of the methods to get a
count. i.e.e select count(id) ...
The reason why i don't just make a count and then a selection of data
is performance.
/BL
---(end of broadcast)-
I am getting ready to start using jboss
with postgres (newer to jboss then postgres).
Is there a mailing list for java postgres
support?
Can you post the connection elements for
JBOSS or is that something documented in the JDBC driver?
Joel Fradkin
Wazagua, Inc.
2520 Trailma
On Aug 24, 2005, at 6:31 AM, Bo Lorentsen wrote:
How sad, then I have to repeat the query, first for counting and
last for data fetch :-(
No, you can use the MOVE command and read how many rows you moved
with something like
MOVE LAST IN mycursor;
http://www.postgresql.org/docs/8.0/inter
I have created datasource but
getting this error on JBOSS startup.
Using:
PostgreSQL 8.0
JBOSS:
JBOSS-3.2.6
16:09:37,093 WARN
[TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257,
GlobalId=dinesh//1, BranchQual=]
errorCode=XA_UNKNOWN(0)
16:09:37,093 WARN
[TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257,
GlobalId=dinesh//1, BranchQual=]
errorCode=XA_UNKNOWN(0)
org.jboss.resource.connectionmanager.JBossLocalXAException:
Error trying to start local tx: ; - nested throwable:
(org.jb
[EMAIL PROTECTED] wrote:
You cannot count the number of rows in a cursor, unfortunately. I recently
ran in to this problem.
How sad, then I have to repeat the query, first for counting and last for
data fetch :-(
/BL
If you need a count, why not just execute one of the methods to get a c
After using correct version of JDBC driver
I am able to start JBOSS server.
Thanks
Dinesh Pandey
I have created datasource but getting this error on JBOSS
startup.
Using: PostgreSQL 8.0
JBOSS: JBOSS-3.2.6
16:09:37,093 WARN [TransactionImpl] XAException:
tx=Tr
I have created datasource but getting this error on JBOSS
startup.
Using: PostgreSQL 8.0
JBOSS: JBOSS-3.2.6
16:09:37,093 WARN [TransactionImpl] XAException:
tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=dinesh//1, BranchQual=]
errorCode=XA_UNKNOWN(0)
org.jboss.resource.conne
[EMAIL PROTECTED] wrote:
You cannot count the number of rows in a cursor, unfortunately. I recently ran
in to this problem.
How sad, then I have to repeat the query, first for counting and last
for data fetch :-(
/BL
---(end of broadcast)--
Thomas Borg Salling wrote:
Bo Lorentsen wrote:
Is it possible to get the total number of rows found in a cursor, or
must I make a count(*) and then a select ?
Perhaps:
GET DIAGNOSTICS rc = ROW_COUNT;
Ok, and when I use the C interface the "DECLARE .." function will return
the row count ?
You cannot count the number of rows in a cursor, unfortunately. I recently ran
in to this problem.
As far as I am aware, the only way to count them is to either iterate through
them,
or if you are only expecting one or two, perform multiple FETCHES and test if
the
record set returned is empty
Dear DAQ,
Thanks for the native answer ;) For those who have concerns reading
Hungarian, here is an excerpt including my answer.
You adviced me to issue an ACCESS EXCLUSIVE lock on table "shift" in
transaction B, before issuing the actual insert, so that the insert will
wait till the end of
Bo Lorentsen wrote:
Is it possible to get the total number of rows found in a cursor, or
must I make a count(*) and then a select ?
Perhaps:
GET DIAGNOSTICS rc = ROW_COUNT;
(see http://archives.postgresql.org/pgsql-novice/2003-06/msg00143.php
and
http://www.postgresql.org/docs/8.0/interacti
Hi ...
Is it possible to get the total number of rows found in a cursor, or
must I make a count(*) and then a select ?
/BL
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
28 matches
Mail list logo