Skip to content

Commit af691cd

Browse files
committed
Merge branch 'PGPRO_covering_index' into PGPRO9_5
2 parents 35fbc00 + 4c6ba12 commit af691cd

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

src/include/catalog/pg_constraint.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ CATALOG(pg_constraint,2606)
100100
*/
101101
int16 conkey[1];
102102

103-
/*
104-
* Columns of conrelid that the constraint does not apply to,
105-
* but included into the same index with key columns.
106-
*/
107-
int16 conincluding[1];
108-
109103
/*
110104
* If a foreign key, the referenced columns of confrelid
111105
*/
@@ -144,6 +138,12 @@ CATALOG(pg_constraint,2606)
144138
* If a check constraint, source-text representation of expression
145139
*/
146140
text consrc;
141+
142+
/*
143+
* Columns of conrelid that the constraint does not apply to,
144+
* but included into the same index with key columns.
145+
*/
146+
int16 conincluding[1];
147147
#endif
148148
} FormData_pg_constraint;
149149

@@ -176,14 +176,15 @@ typedef FormData_pg_constraint *Form_pg_constraint;
176176
#define Anum_pg_constraint_coninhcount 15
177177
#define Anum_pg_constraint_connoinherit 16
178178
#define Anum_pg_constraint_conkey 17
179-
#define Anum_pg_constraint_conincluding 18
180-
#define Anum_pg_constraint_confkey 19
181-
#define Anum_pg_constraint_conpfeqop 20
182-
#define Anum_pg_constraint_conppeqop 21
183-
#define Anum_pg_constraint_conffeqop 22
184-
#define Anum_pg_constraint_conexclop 23
185-
#define Anum_pg_constraint_conbin 24
186-
#define Anum_pg_constraint_consrc 25
179+
#define Anum_pg_constraint_confkey 18
180+
#define Anum_pg_constraint_conpfeqop 19
181+
#define Anum_pg_constraint_conppeqop 20
182+
#define Anum_pg_constraint_conffeqop 21
183+
#define Anum_pg_constraint_conexclop 22
184+
#define Anum_pg_constraint_conbin 23
185+
#define Anum_pg_constraint_consrc 24
186+
#define Anum_pg_constraint_conincluding 25
187+
187188

188189

189190
/* Valid values for contype */

src/pgpro-upgrade/covering_index.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
insert into pg_attribute select attrelid, 'conincluding', atttypid, attstattarget, attlen, 25, attndims, attcacheoff, atttypmod, attbyval, attstorage, attalign, attnotnull, atthasdef, attisdropped, attislocal, attinhcount, attcollation, attacl, attoptions, attfdwoptions from pg_attribute where attrelid = 'pg_constraint'::regclass::oid and attname ='conkey';

src/pgpro-upgrade/covering_index.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
select count(*)>0 from pg_attribute where attname='conincluding';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
update pg_class set relnatts=25 where relname='pg_constraint';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
select relnatts=25 from pg_class where relname='pg_constraint';

0 commit comments

Comments
 (0)