1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Don't create relfilenode for relations without storage

Some relation kinds had relfilenode set to some non-zero value, but
apparently the actual files did not really exist because creation was
prevented elsewhere.  Get rid of the phony pg_class.relfilenode values.

Catversion bumped, but only because the sanity_test check will fail if
run in a system initdb'd with the previous version.

Reviewed-by: Kyotaro HORIGUCHI, Michael Paquier
Discussion: https://postgr.es/m/20181206215552.fm2ypuxq6nhpwjuc@alvherre.pgsql
This commit is contained in:
Alvaro Herrera
2019-01-04 14:51:17 -03:00
parent df5be63763
commit 807ae415c5
6 changed files with 36 additions and 26 deletions

View File

@ -224,3 +224,12 @@ SELECT relname, nspname
---------+---------
(0 rows)
-- check that relations without storage don't have relfilenode
SELECT relname, relkind
FROM pg_class
WHERE relkind IN ('v', 'c', 'f', 'p', 'I')
AND relfilenode <> 0;
relname | relkind
---------+---------
(0 rows)

View File

@ -31,3 +31,9 @@ SELECT relname, nspname
AND NOT EXISTS (SELECT 1 FROM pg_index i WHERE indrelid = c.oid
AND indkey[0] = a.attnum AND indnatts = 1
AND indisunique AND indimmediate);
-- check that relations without storage don't have relfilenode
SELECT relname, relkind
FROM pg_class
WHERE relkind IN ('v', 'c', 'f', 'p', 'I')
AND relfilenode <> 0;