Re: [HACKERS] weird state after aborted transaction in pgsql 6.4

Поиск
Список
Период
Сортировка
От jwieck@debis.com (Jan Wieck)
Тема Re: [HACKERS] weird state after aborted transaction in pgsql 6.4
Дата
Msg-id m0zlBpv-000EBPC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на weird state after aborted transaction in pgsql 6.4  (David Sauer <davids@iol.cz>)
Ответы Re: [HACKERS] weird state after aborted transaction in pgsql 6.4  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
>
> My database is in weird state after some operation. Here is an example:
>
> [david@kerberos david]$ psql
> .....
> david=> begin;
> BEGIN
> david=> create table tbl ( i int );
> CREATE
> david=> insert into tbl values(1);
> INSERT 104137 1
> EOFid=> [<ctrl-d> here]
> [david@kerberos david]$ psql
> ....
> david=> create table tbl ( a text );
> ERROR:  cannot create tbl
> david=> \d
> Couldn't find any tables, sequences or indices!
>       ====================== cut here ======================
> Simple question: why 'ERROR: cannot create tbl' ?
> Platform: linux i586, glibc, regression tests seems ok (except minor
> problem with floating point. The some problem have my colleague.

    The   problem  is,  that  the  CREATE  TABLE  is  inside  the
    transaction.  So the catalog updates for the  new  table  get
    rolled  back, but the file is still there. On the next CREATE
    TABLE the file creation (made with O_EXCL) fails.

    You can safely remove the file   .../data/base/david/tbl  and
    you   should   execute   CREATE/DROP  statements  outside  of
    transactions.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Sauer
Дата:
Сообщение: weird state after aborted transaction in pgsql 6.4
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: [HACKERS] weird state after aborted transaction in pgsql 6.4