From: | Joseph Shraibman <jks(at)selectacast(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: error on drop table |
Date: | 2001-11-30 05:35:35 |
Message-ID: | 3C071AA7.7090008@selectacast.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Tom Lane wrote:
> Joseph Shraibman <jks(at)selectacast(dot)net> writes:
>
>>To reproduce:
>>create table table1 ( list text, ukey int);
>>insert into table1 values( '1', 1);
>>insert into table1 values( '2', 2);
>>insert into table1 values( '3', 3);
>>insert into table1 values( '4', 4);
>>insert into table1 values( '5', 5);
>>
>
>> SELECT list,ukey INTO temporary tqt FROM table1;
>>BEGIN;
>> DECLARE cname CURSOR FOR SELECT list, ukey FROM tqt ;
>>FETCH 10 from cname;
>>DROP TABLE tqt;
>>END;
>>
>
> I don't see an error if I do it that way, but I do see an error if the
> cursor hasn't yet fetched all the rows:
>
What version are you using? I get the error using exactly what I showed you on 7.1.3.
playpen=# create table table1 ( list text, ukey int);
CREATE
playpen=# insert into table1 values( '1', 1);
INSERT 571129 1
playpen=# insert into table1 values( '2', 2);
INSERT 571130 1
playpen=# insert into table1 values( '3', 3);
INSERT 571131 1
playpen=# insert into table1 values( '4', 4);
INSERT 571132 1
playpen=# insert into table1 values( '5', 5);
INSERT 571133 1
playpen=# SELECT list,ukey INTO temporary tqt FROM table1;
SELECT
playpen=# BEGIN;
BEGIN
playpen=# DECLARE cname CURSOR FOR SELECT list, ukey FROM tqt ;
SELECT
playpen=# FETCH 10 from cname;
list | ukey
------+------
1 | 1
2 | 2
3 | 3
4 | 4
5 | 5
(5 rows)
playpen=# DROP TABLE tqt;
NOTICE: FlushRelationBuffers(tqt, 0): block 0 is referenced (private 1, global 1)
ERROR: heap_drop_with_catalog: FlushRelationBuffers returned -2
playpen=# END;
COMMIT
playpen=#
playpen=# drop table table1;
DROP
playpen=# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)
--
Joseph Shraibman
jks(at)selectacast(dot)net
Increase signal to noise ratio. http://www.targabot.com
From | Date | Subject | |
---|---|---|---|
Next Message | Ronggolawe | 2001-11-30 06:34:32 | libpq Newbie question |
Previous Message | Steve Jorgensen | 2001-11-30 04:32:09 | Re: Import Data form postgresql to Ms excel |