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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: t-ishii(at)sra(dot)co(dot)jp
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] delete from ..;vacuum crashes
Date: 1998-10-02 06:14:22
Message-ID: 140.907308862@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-10-02 06:16:08 Re: [HACKERS] functional indexes
Previous Message Bruce Momjian 1998-10-02 06:02:48 Re: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)