Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group