Re: [HACKERS] delete from ..;vacuum crashes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] delete from ..;vacuum crashes
Дата
Msg-id 140.907308862@sss.pgh.pa.us
обсуждение исходный текст
Ответ на delete from ..;vacuum crashes  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Ответы Re: [HACKERS] delete from ..;vacuum crashes
Список pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> Here is a report regarding the backend-crash from a user in Japan.
> Included shell script should reproduce the phenomenon.

On which postgres version(s)?

> Note that
>     select * from getting; vacuum;
> does cause a crash, while
>     select * from getting;
>     vacuum;
> not.

Specifically I see you are using

> psql -c "select * from getting; vacuum;" $DBNAME

rather than entering the commands at the psql prompt.  The -c option
works differently from entering multiple commands at psql's prompt.
In ordinary interactive use, psql will break what you type at
semicolon boundaries and send each SQL command to the backend
separately, even if you typed several commands on one line.
*But* the -c option doesn't work that way --- it just sends the
whole given string to the backend as one query.

The implication of this is that psql -c "select * from getting; vacuum;"
executes the select and the vacuum as part of a single transaction,
whereas any other way of doing it with psql will make the commands be
two separate transactions.  I speculate that this has something to do
with the different behavior you see.

Exactly what the bug is is beyond my abilities, but perhaps that tidbit
will help someone more competent to find it.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Names that suddenly include an OID
Следующее
От: Bruce Momjian
Дата:
Сообщение: Open 6.4 items