gross.patch
application/octet-stream
Filename: gross.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/parser/gram.y | 40 | 4 |
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index e5b0541..b896279 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -249,7 +249,7 @@ static TypeName *TableFuncTypeName(List *columns);
%type <list> TriggerEvents TriggerOneEvent
%type <value> TriggerFuncArg
-%type <node> TriggerWhen
+%type <node> TriggerWhen tricky_index_name
%type <str> copy_file_name
database_name access_method_clause access_method attr_name
@@ -4829,14 +4829,29 @@ defacl_privilege_target:
* willing to make TABLESPACE a fully reserved word.
*****************************************************************************/
-IndexStmt: CREATE index_opt_unique INDEX index_name
+IndexStmt: CREATE index_opt_unique INDEX tricky_index_name
ON qualified_name access_method_clause '(' index_params ')'
opt_reloptions OptTableSpace where_clause
{
IndexStmt *n = makeNode(IndexStmt);
n->unique = $2;
- n->concurrent = false;
- n->idxname = $4;
+ if (IsA($4, String))
+ {
+ n->concurrent = false;
+ n->idxname = strVal($4);
+ }
+ else {
+ DefElem *d = (DefElem*) $4;
+ if (!strcmp(d->defname, "concurrently"))
+ {
+ n->concurrent = true;
+ n->idxname = NULL;
+ }
+ else {
+ n->concurrent = false;
+ n->idxname = d->defname;
+ }
+ }
n->relation = $6;
n->accessMethod = $7;
n->indexParams = $9;
@@ -4861,6 +4876,22 @@ IndexStmt: CREATE index_opt_unique INDEX index_name
n->whereClause = $14;
$$ = (Node *)n;
}
+ | CREATE index_opt_unique INDEX
+ ON qualified_name access_method_clause '(' index_params ')'
+ opt_reloptions OptTableSpace where_clause
+ {
+ IndexStmt *n = makeNode(IndexStmt);
+ n->unique = $2;
+ n->concurrent = true;
+ n->idxname = NULL;
+ n->relation = $5;
+ n->accessMethod = $6;
+ n->indexParams = $8;
+ n->options = $10;
+ n->tableSpace = $11;
+ n->whereClause = $12;
+ $$ = (Node *)n;
+ }
;
index_opt_unique:
@@ -10474,6 +10505,11 @@ attr_name: ColLabel { $$ = $1; };
index_name: ColId { $$ = $1; };
+tricky_index_name: IDENT { $$ = (Node *) makeString(pstrdup($1)); }
+ | unreserved_keyword { $$ = (Node *) makeDefElem(pstrdup($1), NULL); }
+ | col_name_keyword { $$ = (Node *) makeDefElem(pstrdup($1), NULL); }
+ ;
+
file_name: Sconst { $$ = $1; };
/*