Skip to content

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy