Re: [BUGS] bug in "fetch" command?

Поиск
Список
Период
Сортировка
Искать

Re: [BUGS] bug in "fetch" command?

От:
Bruce Momjian <maillist@candle.pha.pa.us>
Дата:

Can someone comment on this?  Is is a bug?


> ============================================================================
>                         POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
> 
> 
> Your name		: Sergey E. Levov	
> Your email address	: serg@informika.ru
> 
> 
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)  	: Intel Pentium Pro
> 
>   Operating System (example: Linux 2.0.26 ELF) 	: FreeBSD 2.2.5
> 
>   PostgreSQL version (example: PostgreSQL-6.3.2)  :   PostgreSQL-6.3.2
> 
>   Compiler used (example:  gcc 2.7.2)		: gcc 2.7.2.1
> 
> 
> Please enter a FULL description of your problem:
> ------------------------------------------------
> When I declare cursor for select statement without "ORDER BY" clause
> ( select * from  ), and then attempt to fetch record after
> last record in table, or even just give "fetch all" command,
> all the following "fetch" commands, regardless direction, will return 
> an empty result sets.
> If "SELECT" statement has "ORDER BY" clause, all works well.
> 
> 
> 
> Please describe a way to repeat the problem.   Please try to provide a
> concise reproducible example, if at all possible: 
> ----------------------------------------------------------------------
> Try the following sequence of SQL operators:
> 
> begin
> declare mycurs cursor for select * from pg_user
> fetch all in mycurs             - OK
> fetch backward all in mycurs	- fails
> move backward all in mycurs
> fetch all in mycurs		- fails
> close mycurs
> 
> declare mycurs cursor for select * from pg_user order by usename
> fetch all in mycurs		- OK
> fetch backward all in mycurs	- OK
> move backward all in mycurs
> fetch all in mycurs		- OK
> 
> 
> Regards,
> Sergey Levov (serg@informika.ru)
> 
> 
> 
> 


-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Re: [HACKERS] Re: [BUGS] bug in "fetch" command?

От:
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Дата:
> Can someone comment on this?  Is is a bug?

I was a bit suprised to see this behavior. I am guessing that it is a
bug. Does anyone else think so? I last tested and noticed this a week or
two ago when writing docs...

                  - Tom

> > Please enter a FULL description of your problem:
> > ------------------------------------------------
> > When I declare cursor for select statement without "ORDER BY" clause
> > ( select * from  ), and then attempt to fetch record 
> > after last record in table, or even just give "fetch all" command,
> > all the following "fetch" commands, regardless direction, will 
> > return an empty result sets.
> > If "SELECT" statement has "ORDER BY" clause, all works well.
> > Try the following sequence of SQL operators:
> >
> > begin
> > declare mycurs cursor for select * from pg_user
> > fetch all in mycurs             - OK
> > fetch backward all in mycurs  - fails
> > move backward all in mycurs
> > fetch all in mycurs           - fails
> > close mycurs
> >
> > declare mycurs cursor for select * from pg_user order by usename
> > fetch all in mycurs           - OK
> > fetch backward all in mycurs  - OK
> > move backward all in mycurs
> > fetch all in mycurs           - OK
FAQ