Skip to content

Commit 788e799

Browse files
committed
psql: allow DROP INDEX CONCURRENTLY in AUTOCOMMIT off mode
Previously this threw an error. Patch by Feike Steenbergen
1 parent bf03889 commit 788e799

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/bin/psql/common.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,24 @@ command_no_begin(const char *query)
16431643
return true;
16441644
if (wordlen == 10 && pg_strncasecmp(query, "tablespace", 10) == 0)
16451645
return true;
1646+
1647+
/* DROP INDEX CONCURRENTLY isn't allowed in xacts */
1648+
if (wordlen == 5 && pg_strncasecmp(query, "index", 5) == 0)
1649+
{
1650+
query += wordlen;
1651+
1652+
query = skip_white_space(query);
1653+
1654+
wordlen = 0;
1655+
while (isalpha((unsigned char) query[wordlen]))
1656+
wordlen += PQmblen(&query[wordlen], pset.encoding);
1657+
1658+
if (wordlen == 12 && pg_strncasecmp(query, "concurrently", 12) == 0)
1659+
return true;
1660+
1661+
return false;
1662+
}
1663+
16461664
return false;
16471665
}
16481666

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