By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,691 Members | 2,041 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,691 IT Pros & Developers. It's quick & easy.

cursor bug

P: n/a
Hi. I sent this bug to the bugs mailing list. But the email never turned
up on the list. Could somebody here tell me what I'm doing wrong, and why
the email won't show up? Am I breaking some unwritten rule of the bugs
list? I would really like to see an answer to this.

Thanks a lot!


wa************** wrote:

================================================== ==========================

================================================== ==========================
Your name : washington irving
Your email address : wa**************
System Configuration---------------------
Architecture (example: Intel Pentium) : Intel

Operating System (example: Linux 2.0.26 ELF) :Linux 2.4.18 ELF,
FreeBSD 4.8 Release, Mac OSX 10.2.6

PostgreSQL version (example: PostgreSQL-7.3.4): PostgreSQL-7.3.4,

Compiler used (example: gcc 2.95.2) :gcc3.1, gcc 3.3.1, gcc 2.95.4
Please enter a FULL description of your problem:
Under some cases, using cursors and the fetch and move commands don't
work as expected. Please see below for a full decription of the
with the attached dump.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:

I'm attaching the dump of a database named test. I've managed to
reproduce this bug on freebsd (postgresql 7.3.3), linux (7.3.3) and
mac osx
(both 7.3.3. and 7.3.4). This is the smallest test case I could come
with. In this test, I first declare a cursor and
then try to fetch 10k rows. It returns 2153 rows (the number of rowsthat
satisfy the select). Then I try to fetch another 10k rows. This
returns an empty list (as it should). Then I try to move the cursor
back by 2153. This does not move the cursor at all. This happens
regardless of the number you use in the fetch command (for instance
fetching 1000 rows at a time). It also happens regardless of the
passed in to the move command.

Either this is a bug, or I'm doing something terribly wrong. Could
people who know more about this please look into it.
-- psql session showing problem --
unix prompt> psql test
Welcome to psql 7.3.3, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

test=# begin;
BEGINtest=# declare c cursor for SELECT * from pa, ua where ua.adid =
and = 1;
test=# fetch 10000 from c;
..... 2153 rows returned ....
test=# fetch 10000 from c;
pid | adid | cid | k | c | u | ad | adid
(0 rows)
test=# move -2153 from c;
test=# fetch 10000 from c; pid | adid | cid | k | c | u | ad | adid
(0 rows)


If you know how this problem might be fixed, list the solution below:
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.