8000 Support case of adding predicate in ALTER INDEX ... WHERE ... · postgrespro/postgres_cluster@6779971 · GitHub
[go: up one dir, main page]

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

Appearance settings

Commit 6779971

Browse files
committed
Support case of adding predicate in ALTER INDEX ... WHERE ...
1 parent 137c068 commit 6779971

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/commands/indexcmds.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ AlterIndex(Oid indexRelationId, IndexStmt *stmt)
356356
relationName = quote_qualified_identifier(get_namespace_name(namespaceId),
357357
get_rel_name(heapRelationId)),
358358
newIndexPredicate = deparse_expression(stmt->whereClause, deparseCtx, false, false);
359-
oldIndexPredicate = deparse_expression((Node*)make_ands_explicit(indexInfo->ii_Predicate), deparseCtx, false, false);
359+
oldIndexPredicate = indexInfo->ii_Predicate
360+
? deparse_expression((Node*)make_ands_explicit(indexInfo->ii_Predicate), deparseCtx, false, false)
361+
: "true";
360362

361363
SPI_connect();
362364

0 commit comments

Comments
 (0)
0