Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita9f19c1

Browse files
committed
Fix inconsistencies for queries on pg_class in type_sanity.sql
Three queries did not consider partitioned indexes and tables, andsurrounding comments have not been updated in a while.Like4b9fbd6, this is only cosmetic currently as no such relkindsexist at this stage of the regression tests, but running these querieson existing clusters could lead to incorrect results.Author: Jian He, Michael PaquierDiscussion:https://postgr.es/m/CACJufxGsB1ciahkNDccyxhw-Pfp_-_y+Wx+1BOdRyVVxKojAbg@mail.gmail.com
1 parentb7f315c commita9f19c1

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

‎src/test/regress/expected/type_sanity.out

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,28 +507,30 @@ WHERE relkind NOT IN ('r', 'i', 'S', 't', 'v', 'm', 'c', 'f', 'p', 'I') OR
507507
-----+---------
508508
(0 rows)
509509

510-
-- All tables and indexes should have an access method.
510+
-- All tables, indexes, partitioned indexes and matviews should have an
511+
-- access method.
511512
SELECT c1.oid, c1.relname
512513
FROM pg_class as c1
513-
WHERE c1.relkind NOT IN ('S', 'v', 'f', 'c') and
514+
WHERE c1.relkind NOT IN ('S', 'v', 'f', 'c', 'p') and
514515
c1.relam = 0;
515516
oid | relname
516517
-----+---------
517518
(0 rows)
518519

519-
-- Conversely, sequences, views, types shouldn't have them
520+
-- Conversely, sequences, views, foreign tables, types and partitioned
521+
-- tables shouldn't have them.
520522
SELECT c1.oid, c1.relname
521523
FROM pg_class as c1
522-
WHERE c1.relkind IN ('S', 'v', 'f', 'c') and
524+
WHERE c1.relkind IN ('S', 'v', 'f', 'c', 'p') and
523525
c1.relam != 0;
524526
oid | relname
525527
-----+---------
526528
(0 rows)
527529

528-
-- Indexes should have AMs of type 'i'
530+
-- Indexesand partitioned indexesshould have AMs of type 'i'.
529531
SELECT pc.oid, pc.relname, pa.amname, pa.amtype
530532
FROM pg_class as pc JOIN pg_am AS pa ON (pc.relam = pa.oid)
531-
WHERE pc.relkind IN ('i') and
533+
WHERE pc.relkind IN ('i', 'I') and
532534
pa.amtype != 'i';
533535
oid | relname | amname | amtype
534536
-----+---------+--------+--------

‎src/test/regress/sql/type_sanity.sql

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,22 +364,24 @@ WHERE relkind NOT IN ('r', 'i', 'S', 't', 'v', 'm', 'c', 'f', 'p', 'I') OR
364364
relpersistence NOTIN ('p','u','t')OR
365365
relreplident NOTIN ('d','n','f','i');
366366

367-
-- All tables and indexes should have an access method.
367+
-- All tables, indexes, partitioned indexes and matviews should have an
368+
-- access method.
368369
SELECTc1.oid,c1.relname
369370
FROM pg_classas c1
370-
WHEREc1.relkind NOTIN ('S','v','f','c')and
371+
WHEREc1.relkind NOTIN ('S','v','f','c','p')and
371372
c1.relam=0;
372373

373-
-- Conversely, sequences, views, types shouldn't have them
374+
-- Conversely, sequences, views, foreign tables, types and partitioned
375+
-- tables shouldn't have them.
374376
SELECTc1.oid,c1.relname
375377
FROM pg_classas c1
376-
WHEREc1.relkindIN ('S','v','f','c')and
378+
WHEREc1.relkindIN ('S','v','f','c','p')and
377379
c1.relam!=0;
378380

379-
-- Indexes should have AMs of type 'i'
381+
-- Indexesand partitioned indexesshould have AMs of type 'i'.
380382
SELECTpc.oid,pc.relname,pa.amname,pa.amtype
381383
FROM pg_classas pcJOIN pg_amAS paON (pc.relam=pa.oid)
382-
WHEREpc.relkindIN ('i')and
384+
WHEREpc.relkindIN ('i','I')and
383385
pa.amtype!='i';
384386

385387
-- Tables, matviews etc should have AMs of type 't'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp