summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/analyze.c2
-rw-r--r--src/backend/parser/check_keywords.pl2
-rw-r--r--src/backend/parser/gram.y7
-rw-r--r--src/backend/parser/gramparse.h2
-rw-r--r--src/backend/parser/meson.build2
-rw-r--r--src/backend/parser/parse_agg.c2
-rw-r--r--src/backend/parser/parse_clause.c13
-rw-r--r--src/backend/parser/parse_coerce.c2
-rw-r--r--src/backend/parser/parse_collate.c2
-rw-r--r--src/backend/parser/parse_cte.c2
-rw-r--r--src/backend/parser/parse_enr.c2
-rw-r--r--src/backend/parser/parse_expr.c2
-rw-r--r--src/backend/parser/parse_func.c2
-rw-r--r--src/backend/parser/parse_jsontable.c2
-rw-r--r--src/backend/parser/parse_merge.c2
-rw-r--r--src/backend/parser/parse_node.c2
-rw-r--r--src/backend/parser/parse_oper.c2
-rw-r--r--src/backend/parser/parse_param.c2
-rw-r--r--src/backend/parser/parse_relation.c2
-rw-r--r--src/backend/parser/parse_target.c2
-rw-r--r--src/backend/parser/parse_type.c2
-rw-r--r--src/backend/parser/parse_utilcmd.c10
-rw-r--r--src/backend/parser/parser.c2
-rw-r--r--src/backend/parser/scan.l2
-rw-r--r--src/backend/parser/scansup.c2
25 files changed, 41 insertions, 33 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 92be345d9a8..029ca3b68c3 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -14,7 +14,7 @@
* contain optimizable statements, which we should transform.
*
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/parser/analyze.c
diff --git a/src/backend/parser/check_keywords.pl b/src/backend/parser/check_keywords.pl
index 2f25b2a1071..9a0b6242325 100644
--- a/src/backend/parser/check_keywords.pl
+++ b/src/backend/parser/check_keywords.pl
@@ -4,7 +4,7 @@
# Usage: check_keywords.pl gram.y kwlist.h
# src/backend/parser/check_keywords.pl
-# Copyright (c) 2009-2025, PostgreSQL Global Development Group
+# Copyright (c) 2009-2026, PostgreSQL Global Development Group
use strict;
use warnings FATAL => 'all';
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 28f4e11e30f..713ee5c10a2 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -6,7 +6,7 @@
* gram.y
* POSTGRESQL BISON rules/actions
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
@@ -8454,6 +8454,7 @@ index_elem_options:
$$->opclassopts = NIL;
$$->ordering = $3;
$$->nulls_ordering = $4;
+ /* location will be filled in index_elem production */
}
| opt_collate any_name reloptions opt_asc_desc opt_nulls_order
{
@@ -8466,6 +8467,7 @@ index_elem_options:
$$->opclassopts = $3;
$$->ordering = $4;
$$->nulls_ordering = $5;
+ /* location will be filled in index_elem production */
}
;
@@ -8478,16 +8480,19 @@ index_elem: ColId index_elem_options
{
$$ = $2;
$$->name = $1;
+ $$->location = @1;
}
| func_expr_windowless index_elem_options
{
$$ = $2;
$$->expr = $1;
+ $$->location = @1;
}
| '(' a_expr ')' index_elem_options
{
$$ = $4;
$$->expr = $2;
+ $$->location = @1;
}
;
diff --git a/src/backend/parser/gramparse.h b/src/backend/parser/gramparse.h
index a06a918c654..ecd2dbb96b1 100644
--- a/src/backend/parser/gramparse.h
+++ b/src/backend/parser/gramparse.h
@@ -8,7 +8,7 @@
* Definitions that are needed outside the core parser should be in parser.h.
*
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/parser/gramparse.h
diff --git a/src/backend/parser/meson.build b/src/backend/parser/meson.build
index 874aa749aa6..924ee87a453 100644
--- a/src/backend/parser/meson.build
+++ b/src/backend/parser/meson.build
@@ -1,4 +1,4 @@
-# Copyright (c) 2022-2025, PostgreSQL Global Development Group
+# Copyright (c) 2022-2026, PostgreSQL Global Development Group
backend_sources += files(
'analyze.c',
diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c
index b8340557b34..25ee0f87d93 100644
--- a/src/backend/parser/parse_agg.c
+++ b/src/backend/parser/parse_agg.c
@@ -3,7 +3,7 @@
* parse_agg.c
* handle aggregates and window functions in parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 57609e2d55c..e35fd25c9bb 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -3,7 +3,7 @@
* parse_clause.c
* handle clauses in parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
@@ -3288,21 +3288,18 @@ resolve_unique_index_expr(ParseState *pstate, InferClause *infer,
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
errmsg("%s is not allowed in ON CONFLICT clause",
"ASC/DESC"),
- parser_errposition(pstate,
- exprLocation((Node *) infer))));
+ parser_errposition(pstate, ielem->location)));
if (ielem->nulls_ordering != SORTBY_NULLS_DEFAULT)
ereport(ERROR,
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
errmsg("%s is not allowed in ON CONFLICT clause",
"NULLS FIRST/LAST"),
- parser_errposition(pstate,
- exprLocation((Node *) infer))));
+ parser_errposition(pstate, ielem->location)));
if (ielem->opclassopts)
ereport(ERROR,
errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
errmsg("operator class options are not allowed in ON CONFLICT clause"),
- parser_errposition(pstate,
- exprLocation((Node *) infer)));
+ parser_errposition(pstate, ielem->location));
if (!ielem->expr)
{
@@ -3342,7 +3339,7 @@ resolve_unique_index_expr(ParseState *pstate, InferClause *infer,
pInfer->infercollid = InvalidOid;
else
pInfer->infercollid = LookupCollation(pstate, ielem->collation,
- exprLocation(pInfer->expr));
+ ielem->location);
if (!ielem->opclass)
pInfer->inferopclass = InvalidOid;
diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c
index 78b1e366ad7..913ca53666f 100644
--- a/src/backend/parser/parse_coerce.c
+++ b/src/backend/parser/parse_coerce.c
@@ -3,7 +3,7 @@
* parse_coerce.c
* handle type coercions/conversions for parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_collate.c b/src/backend/parser/parse_collate.c
index d2e218353f3..ba7df2a7789 100644
--- a/src/backend/parser/parse_collate.c
+++ b/src/backend/parser/parse_collate.c
@@ -29,7 +29,7 @@
* at runtime. If we knew exactly which functions require collation
* information, we could throw those errors at parse time instead.
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_cte.c b/src/backend/parser/parse_cte.c
index 366fd901d9d..ccde199319a 100644
--- a/src/backend/parser/parse_cte.c
+++ b/src/backend/parser/parse_cte.c
@@ -3,7 +3,7 @@
* parse_cte.c
* handle CTEs (common table expressions) in parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_enr.c b/src/backend/parser/parse_enr.c
index 119911598b9..9b47b7f65fa 100644
--- a/src/backend/parser/parse_enr.c
+++ b/src/backend/parser/parse_enr.c
@@ -3,7 +3,7 @@
* parse_enr.c
* parser support routines dealing with ephemeral named relations
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 6b8fa15fca3..9cba1272253 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -3,7 +3,7 @@
* parse_expr.c
* handle expressions in parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 778d69c6f3c..24f6745923b 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -3,7 +3,7 @@
* parse_func.c
* handle function calls in parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_jsontable.c b/src/backend/parser/parse_jsontable.c
index 13d533b83f3..c28ae99dee8 100644
--- a/src/backend/parser/parse_jsontable.c
+++ b/src/backend/parser/parse_jsontable.c
@@ -3,7 +3,7 @@
* parse_jsontable.c
* parsing of JSON_TABLE
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_merge.c b/src/backend/parser/parse_merge.c
index 51d7703eff7..e08dc18dd75 100644
--- a/src/backend/parser/parse_merge.c
+++ b/src/backend/parser/parse_merge.c
@@ -3,7 +3,7 @@
* parse_merge.c
* handle merge-statement in parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index cafeb87217c..dacd851cffd 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -3,7 +3,7 @@
* parse_node.c
* various routines that make nodes for querytrees
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 7bd7a336fd6..768e4cff9c5 100644
--- a/src/backend/parser/parse_oper.c
+++ b/src/backend/parser/parse_oper.c
@@ -3,7 +3,7 @@
* parse_oper.c
* handle operator things for parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_param.c b/src/backend/parser/parse_param.c
index 772f3e3c1d8..946950dbbda 100644
--- a/src/backend/parser/parse_param.c
+++ b/src/backend/parser/parse_param.c
@@ -12,7 +12,7 @@
* Note that other approaches to parameters are possible using the parser
* hooks defined in ParseState.
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index dd64f45478a..3ec8d8de011 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -3,7 +3,7 @@
* parse_relation.c
* parser support routines dealing with relations
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 905c975d83b..b5a2f915b67 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -3,7 +3,7 @@
* parse_target.c
* handle target lists
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c
index 9d7aa6967da..bb7eccde9fd 100644
--- a/src/backend/parser/parse_type.c
+++ b/src/backend/parser/parse_type.c
@@ -3,7 +3,7 @@
* parse_type.c
* handle type operations for parser
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 2b7b084f216..3f4393b52ea 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -12,7 +12,7 @@
* respective utility commands.
*
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/parser/parse_utilcmd.c
@@ -1962,6 +1962,8 @@ generateClonedIndexStmt(RangeVar *heapRel, Relation source_idx,
}
}
+ iparam->location = -1;
+
index->indexParams = lappend(index->indexParams, iparam);
}
@@ -1993,6 +1995,8 @@ generateClonedIndexStmt(RangeVar *heapRel, Relation source_idx,
/* Copy the original index column name */
iparam->indexcolname = pstrdup(NameStr(attr->attname));
+ iparam->location = -1;
+
index->indexIncludingParams = lappend(index->indexIncludingParams, iparam);
}
/* Copy reloptions if any */
@@ -2813,6 +2817,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
iparam->opclassopts = NIL;
iparam->ordering = SORTBY_DEFAULT;
iparam->nulls_ordering = SORTBY_NULLS_DEFAULT;
+ iparam->location = -1;
index->indexParams = lappend(index->indexParams, iparam);
}
@@ -2929,6 +2934,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
iparam->collation = NIL;
iparam->opclass = NIL;
iparam->opclassopts = NIL;
+ iparam->location = -1;
index->indexIncludingParams = lappend(index->indexIncludingParams, iparam);
}
@@ -3544,7 +3550,7 @@ checkPartition(Relation rel, Oid partRelOid, bool isMerge)
if (get_partition_parent(partRelOid, false) != RelationGetRelid(rel))
ereport(ERROR,
- errcode(ERRCODE_UNDEFINED_TABLE),
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("relation \"%s\" is not a partition of relation \"%s\"",
RelationGetRelationName(partRel), RelationGetRelationName(rel)),
isMerge
diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c
index a3679f8e86c..b5c28523971 100644
--- a/src/backend/parser/parser.c
+++ b/src/backend/parser/parser.c
@@ -10,7 +10,7 @@
* analyze.c and related files.
*
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index a67815339b7..731d584106d 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -22,7 +22,7 @@
* Postgres 9.2, this check is made automatically by the Makefile.)
*
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
diff --git a/src/backend/parser/scansup.c b/src/backend/parser/scansup.c
index d63cb865260..cd9594226d6 100644
--- a/src/backend/parser/scansup.c
+++ b/src/backend/parser/scansup.c
@@ -3,7 +3,7 @@
* scansup.c
* scanner support routines used by the core lexer
*
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*