mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
psql: allow DROP INDEX CONCURRENTLY in AUTOCOMMIT off mode
Previously this threw an error. Patch by Feike Steenbergen
This commit is contained in:
parent
bf03889996
commit
788e799ed4
@ -1643,6 +1643,24 @@ command_no_begin(const char *query)
|
||||
return true;
|
||||
if (wordlen == 10 && pg_strncasecmp(query, "tablespace", 10) == 0)
|
||||
return true;
|
||||
|
||||
/* DROP INDEX CONCURRENTLY isn't allowed in xacts */
|
||||
if (wordlen == 5 && pg_strncasecmp(query, "index", 5) == 0)
|
||||
{
|
||||
query += wordlen;
|
||||
|
||||
query = skip_white_space(query);
|
||||
|
||||
wordlen = 0;
|
||||
while (isalpha((unsigned char) query[wordlen]))
|
||||
wordlen += PQmblen(&query[wordlen], pset.encoding);
|
||||
|
||||
if (wordlen == 12 && pg_strncasecmp(query, "concurrently", 12) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user