Обсуждение: strange apllicaion error

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

strange apllicaion error

От
spied@yandex.ru
Дата:
i get this error messages in my application:

query error:  ERROR:  duplicate key violates unique constraint "pg_type_typname_nsp_index"

failed query:  SELECT packv_uid INTO TEMPORARY my_new_to1c FROM new_to1c
connection error:  no connection to the server

it's my code:
for (;;) {
  doquery("begin work");
  doquery("SELECT packv_uid INTO TEMPORARY my_new_to1c FROM new_to1c");
  ....
  doquery("DROP TABLE my_new_to1c");
  doquery("commit");
  sleep(1);
}
new_to1c is view
may be it's related with
http://archives.postgresql.org/pgsql-general/2004-06/msg00394.php


Re: strange apllicaion error

От
mike g
Дата:
What language are you using to execute your code?  Maybe it has the same
problem that pl/pgsql does with caching temp tables?  It would be
created the first time it looped through your code, the 2nd time it
would crash trying to create the table again.


On Thu, 2004-06-24 at 06:37, spied@yandex.ru wrote:
> i get this error messages in my application:
>
> query error:  ERROR:  duplicate key violates unique constraint "pg_type_typname_nsp_index"
>
> failed query:  SELECT packv_uid INTO TEMPORARY my_new_to1c FROM new_to1c
> connection error:  no connection to the server
>
> it's my code:
> for (;;) {
>   doquery("begin work");
>   doquery("SELECT packv_uid INTO TEMPORARY my_new_to1c FROM new_to1c");
>   ....
>   doquery("DROP TABLE my_new_to1c");
>   doquery("commit");
>   sleep(1);
> }
> new_to1c is view
> may be it's related with
> http://archives.postgresql.org/pgsql-general/2004-06/msg00394.php
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org

Re: strange apllicaion error

От
spied@yandex.ru
Дата:
mg> What language are you using to execute your code?

с with modified pgeasy library

mg>  Maybe it has the same  problem that pl/pgsql does with caching
mg> temp tables?  It would be  created the first time it looped
mg> through your code, the 2nd time it  would crash trying to create
mg> the table again.

i think i understood:
 - after SELECT INTO, but before DROP TABLE i get error from some sql
command
 - transation is aborted and any commands (include DROP TABLE) are
ignored
 - after commit temporary table exist and on next loop i get error on
SELECT INTO

>> query error:  ERROR:  duplicate key violates unique constraint "pg_type_typname_nsp_index"
>>
>> failed query:  SELECT packv_uid INTO TEMPORARY my_new_to1c FROM new_to1c
>> connection error:  no connection to the server
>>
>> it's my code:
>> for (;;) {
>>   doquery("begin work");
>>   doquery("SELECT packv_uid INTO TEMPORARY my_new_to1c FROM new_to1c");
>>   ....
>>   doquery("DROP TABLE my_new_to1c");
>>   doquery("commit");
>>   sleep(1);
>> }
>> new_to1c is view
>> may be it's related with
>> http://archives.postgresql.org/pgsql-general/2004-06/msg00394.php