VACUUM FULL results in ERROR: integer out of range - Mailing list pgsql-bugs

From Manuel Rigger
Subject VACUUM FULL results in ERROR: integer out of range
Date
Msg-id CA+u7OA7VT2YvyRz1FWXtr+p9ayUxGEqB8xJOsJT+sywXVKVvGw@mail.gmail.com
Whole thread Raw
Responses Re: VACUUM FULL results in ERROR: integer out of range  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi everyone,

Consider the example below:

-- thread 1:
\c db1;
CREATE TABLE t1(c0 int);
INSERT INTO t1(c0) VALUES(2147483647);
UPDATE t1 SET c0 = 0;
CREATE INDEX i0 ON t1((1 + t1.c0));
VACUUM FULL; -- unexpected: ERROR: integer out of range

-- thread 2:
DROP DATABASE db2;
CREATE DATABASE db2;

I would expect that the VACUUM FULL executes without error. However,
it shows an error "integer out of range", which would be expected for
the CREATE INDEX, had the UPDATE not been executed. I can reliably
reproduce this on my machine on the first execution of thread 1's
statements when having a second thread that (repeatedly) drops and
creates a database. I've attached a Java program that should make it
possible to reproduce this by throwing an exception
"org.postgresql.util.PSQLException: ERROR: integer out of range"
immediately after starting the program.

This bug report is similar to a previous case that I reported, where
executing VACUUM FULL on distinct databases can result in a deadlock
(see https://www.postgresql.org/message-id/CA%2Bu7OA6pL%2B7Xm_NXHLenxffe3tCr3gTamVdr7zPjcWqW0RFM-A%40mail.gmail.com),
which might also be unexpected from a user perspective, so I am not
sure if this case bug report is considered relevant.

Best,
Manuel

Attachment

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: ODBC: SQLGetDescField returns incorrect length forSQL_DESC_COUNT field of APD
Next
From: Tom Lane
Date:
Subject: Re: VACUUM FULL results in ERROR: integer out of range