1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-02 11:44:50 +03:00

Improve generated_stored test

It makes more sense to put the catalog sanity check at the end of the
test rather than at the beginning, so that it can also check whatever
the tests did rather than just whatever happened before the tests.

Suggested-by: jian he <jian.universality@gmail.com>

Discussion: https://www.postgresql.org/message-id/flat/a368248e-69e4-40be-9c07-6c3b5880b0a6@eisentraut.org
This commit is contained in:
Peter Eisentraut 2025-01-20 15:27:33 +01:00
parent 443a8e4ae3
commit 86749ea3b7
2 changed files with 10 additions and 10 deletions

View File

@ -1,9 +1,3 @@
-- sanity check of system catalog
SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE attgenerated NOT IN ('', 's');
attrelid | attname | attgenerated
----------+---------+--------------
(0 rows)
CREATE SCHEMA generated_stored_tests;
GRANT USAGE ON SCHEMA generated_stored_tests TO PUBLIC;
SET search_path = generated_stored_tests;
@ -1356,3 +1350,9 @@ CREATE TABLE gtest28b (LIKE gtest28a INCLUDING GENERATED);
c | integer | | |
x | integer | | | generated always as (b * 2) stored
-- sanity check of system catalog
SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE attgenerated NOT IN ('', 's');
attrelid | attname | attgenerated
----------+---------+--------------
(0 rows)

View File

@ -1,7 +1,3 @@
-- sanity check of system catalog
SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE attgenerated NOT IN ('', 's');
CREATE SCHEMA generated_stored_tests;
GRANT USAGE ON SCHEMA generated_stored_tests TO PUBLIC;
SET search_path = generated_stored_tests;
@ -675,3 +671,7 @@ ALTER TABLE gtest28a DROP COLUMN a;
CREATE TABLE gtest28b (LIKE gtest28a INCLUDING GENERATED);
\d gtest28*
-- sanity check of system catalog
SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE attgenerated NOT IN ('', 's');