* both be -1 meaning "unknown".
*/
/* start location, or -1 if unknown */
- int stmt_location;
+ ParseLoc stmt_location;
/* length in bytes; 0 means "rest of string" */
- int stmt_len pg_node_attr(query_jumble_ignore);
+ ParseLoc stmt_len pg_node_attr(query_jumble_ignore);
} Query;
List *typmods; /* type modifier expression(s) */
int32 typemod; /* prespecified type modifier */
List *arrayBounds; /* array bounds */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} TypeName;
/*
{
NodeTag type;
List *fields; /* field names (String nodes) or A_Star */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} ColumnRef;
/*
{
NodeTag type;
int number; /* the number of the parameter */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} ParamRef;
/*
List *name; /* possibly-qualified name of operator */
Node *lexpr; /* left argument, or NULL if none */
Node *rexpr; /* right argument, or NULL if none */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} A_Expr;
/*
NodeTag type;
union ValUnion val;
bool isnull; /* SQL NULL constant */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} A_Const;
/*
NodeTag type;
Node *arg; /* the expression being casted */
TypeName *typeName; /* the target type */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} TypeCast;
/*
NodeTag type;
Node *arg; /* input expression */
List *collname; /* possibly-qualified collation name */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} CollateClause;
/*
NodeTag type;
RoleSpecType roletype; /* Type of this rolespec */
char *rolename; /* filled only for ROLESPEC_CSTRING */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} RoleSpec;
/*
bool agg_distinct; /* arguments were labeled DISTINCT */
bool func_variadic; /* last argument was labeled VARIADIC */
CoercionForm funcformat; /* how to display this node */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} FuncCall;
/*
{
NodeTag type;
List *elements; /* array element expressions */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} A_ArrayExpr;
/*
char *name; /* column name or NULL */
List *indirection; /* subscripts, field names, and '*', or NIL */
Node *val; /* the value expression to compute or assign */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} ResTarget;
/*
SortByDir sortby_dir; /* ASC/DESC/USING/default */
SortByNulls sortby_nulls; /* NULLS FIRST/LAST */
List *useOp; /* name of op to use, if SORTBY_USING */
- int location; /* operator location, or -1 if none/unknown */
+ ParseLoc location; /* operator location, or -1 if none/unknown */
} SortBy;
/*
int frameOptions; /* frame_clause options, see below */
Node *startOffset; /* expression for starting bound, if any */
Node *endOffset; /* expression for ending bound, if any */
- int location; /* parse location, or -1 if none/unknown */
+ ParseLoc location; /* parse location, or -1 if none/unknown */
} WindowDef;
/*
List *namespaces; /* list of namespaces as ResTarget */
List *columns; /* list of RangeTableFuncCol */
Alias *alias; /* table alias & optional column aliases */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} RangeTableFunc;
/*
bool is_not_null; /* does it have NOT NULL? */
Node *colexpr; /* column filter expression */
Node *coldefexpr; /* column default value expression */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} RangeTableFuncCol;
/*
List *method; /* sampling method name (possibly qualified) */
List *args; /* argument(s) for sampling method */
Node *repeatable; /* REPEATABLE expression, or NULL if none */
- int location; /* method name location, or -1 if unknown */
+ ParseLoc location; /* method name location, or -1 if unknown */
} RangeTableSample;
/*
Oid collOid; /* collation OID (InvalidOid if not set) */
List *constraints; /* other constraints on column */
List *fdwoptions; /* per-column FDW options */
- int location; /* parse location, or -1 if none/unknown */
+ ParseLoc location; /* parse location, or -1 if none/unknown */
} ColumnDef;
/*
Node *arg; /* typically Integer, Float, String, or
* TypeName */
DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} DefElem;
/*
Node *expr;
TypeName *typeName;
bool indent; /* [NO] INDENT */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} XmlSerialize;
/* Partitioning related definitions */
Node *expr; /* expression to partition on, or NULL */
List *collation; /* name of collation; NIL = default */
List *opclass; /* name of desired opclass; NIL = default */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} PartitionElem;
typedef enum PartitionStrategy
NodeTag type;
PartitionStrategy strategy;
List *partParams; /* List of PartitionElems */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} PartitionSpec;
/*
List *lowerdatums; /* List of PartitionRangeDatums */
List *upperdatums; /* List of PartitionRangeDatums */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
};
/*
Node *value; /* Const (or A_Const in raw tree), if kind is
* PARTITION_RANGE_DATUM_VALUE, else NULL */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} PartitionRangeDatum;
/*
NodeTag type;
GroupingSetKind kind pg_node_attr(query_jumble_ignore);
List *content;
- int location;
+ ParseLoc location;
} GroupingSet;
/*
NodeTag type;
List *ctes; /* list of CommonTableExprs */
bool recursive; /* true = WITH RECURSIVE */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} WithClause;
/*
List *indexElems; /* IndexElems to infer unique index */
Node *whereClause; /* qualification (partial-index predicate) */
char *conname; /* Constraint name, or NULL if unnamed */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} InferClause;
/*
InferClause *infer; /* Optional index inference clause */
List *targetList; /* the target list (of ResTarget) */
Node *whereClause; /* qualifications */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} OnConflictClause;
/*
List *search_col_list;
bool search_breadth_first;
char *search_seq_column;
- int location;
+ ParseLoc location;
} CTESearchClause;
typedef struct CTECycleClause
Node *cycle_mark_value;
Node *cycle_mark_default;
char *cycle_path_column;
- int location;
+ ParseLoc location;
/* These fields are set during parse analysis: */
Oid cycle_mark_type; /* common type of _value and _default */
int cycle_mark_typmod;
Node *ctequery; /* the CTE's subquery */
CTESearchClause *search_clause pg_node_attr(query_jumble_ignore);
CTECycleClause *cycle_clause pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
/* These fields are set during parse analysis: */
/* is this CTE actually recursive? */
bool cterecursive pg_node_attr(query_jumble_ignore);
JsonValueExpr *expr; /* string expression */
JsonOutput *output; /* RETURNING clause, if specified */
bool unique_keys; /* WITH UNIQUE KEYS? */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonParseExpr;
/*
NodeTag type;
Expr *expr; /* scalar expression */
JsonOutput *output; /* RETURNING clause, if specified */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonScalarExpr;
/*
NodeTag type;
JsonValueExpr *expr; /* json value expression */
JsonOutput *output; /* RETURNING clause, if specified */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonSerializeExpr;
/*
JsonOutput *output; /* RETURNING clause, if specified */
bool absent_on_null; /* skip NULL values? */
bool unique; /* check key uniqueness? */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonObjectConstructor;
/*
List *exprs; /* list of JsonValueExpr elements */
JsonOutput *output; /* RETURNING clause, if specified */
bool absent_on_null; /* skip NULL elements? */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonArrayConstructor;
/*
JsonOutput *output; /* RETURNING clause, if specified */
JsonFormat *format; /* FORMAT clause for subquery, if specified */
bool absent_on_null; /* skip NULL elements? */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonArrayQueryConstructor;
/*
Node *agg_filter; /* FILTER clause, if any */
List *agg_order; /* ORDER BY clause, if any */
struct WindowDef *over; /* OVER clause, if any */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonAggConstructor;
/*
NodeTag type;
Node *stmt; /* raw parse tree */
- int stmt_location; /* start location, or -1 if unknown */
- int stmt_len; /* length in bytes; 0 means "rest of string" */
+ ParseLoc stmt_location; /* start location, or -1 if unknown */
+ ParseLoc stmt_len; /* length in bytes; 0 means "rest of string" */
} RawStmt;
/*****************************************************************************
List *indirection; /* subscripts and field names, if any */
int nnames; /* number of names to use in ColumnRef */
SelectStmt *val; /* the PL/pgSQL expression to assign */
- int location; /* name's token location, or -1 if unknown */
+ ParseLoc location; /* name's token location, or -1 if unknown */
} PLAssignStmt;
Oid old_pktable_oid; /* pg_constraint.confrelid of my former
* self */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} Constraint;
/* ----------------------
char *gid pg_node_attr(query_jumble_ignore);
bool chain; /* AND CHAIN option */
/* token location, or -1 if unknown */
- int location pg_node_attr(query_jumble_location);
+ ParseLoc location pg_node_attr(query_jumble_location);
} TransactionStmt;
/* ----------------------
/* true if DEALLOCATE ALL */
bool isall;
/* token location, or -1 if unknown */
- int location pg_node_attr(query_jumble_location);
+ ParseLoc location pg_node_attr(query_jumble_location);
} DeallocateStmt;
/*
PublicationObjSpecType pubobjtype; /* type of this publication object */
char *name;
PublicationTable *pubtable;
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} PublicationObjSpec;
typedef struct CreatePublicationStmt
Alias *alias;
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} RangeVar;
/*
/* counts from 0; -1 if none specified */
int ordinalitycol pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} TableFunc;
/*
AttrNumber varattnosyn pg_node_attr(equal_ignore, query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} Var;
/*
* token location, or -1 if unknown. All constants are tracked as
* locations in query jumbling, to be marked as parameters.
*/
- int location pg_node_attr(query_jumble_location);
+ ParseLoc location pg_node_attr(query_jumble_location);
} Const;
/*
/* OID of collation, or InvalidOid if none */
Oid paramcollid pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} Param;
/*
int aggtransno pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} Aggref;
/*
Index agglevelsup;
/* token location */
- int location;
+ ParseLoc location;
} GroupingFunc;
/*
/* is function a simple aggregate? */
bool winagg pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} WindowFunc;
/*
/* OID of collation, or InvalidOid if none */
Oid msfcollid;
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} MergeSupportFunc;
/*
/* arguments to the function */
List *args;
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} FuncExpr;
/*
/* argument's number in positional notation */
int argnumber;
/* argument name location, or -1 if unknown */
- int location;
+ ParseLoc location;
} NamedArgExpr;
/*
List *args;
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} OpExpr;
/*
List *args;
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} ScalarArrayOpExpr;
/*
Expr xpr;
BoolExprType boolop;
List *args; /* arguments to this expression */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} BoolExpr;
/*
List *operName pg_node_attr(query_jumble_ignore);
/* subselect as Query* or raw parsetree */
Node *subselect;
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} SubLink;
/*
Oid resultcollid pg_node_attr(query_jumble_ignore);
/* how to display this node */
CoercionForm relabelformat pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} RelabelType;
/* ----------------
Oid resultcollid pg_node_attr(query_jumble_ignore);
/* how to display this node */
CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} CoerceViaIO;
/* ----------------
Oid resultcollid pg_node_attr(query_jumble_ignore);
/* how to display this node */
CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} ArrayCoerceExpr;
/* ----------------
/* Like RowExpr, we deliberately omit a typmod and collation here */
/* how to display this node */
CoercionForm convertformat pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} ConvertRowtypeExpr;
/*----------
Expr xpr;
Expr *arg; /* input expression */
Oid collOid; /* collation's OID */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} CollateExpr;
/*----------
Expr *arg; /* implicit equality comparison argument */
List *args; /* the arguments (list of WHEN clauses) */
Expr *defresult; /* the default result (ELSE clause) */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} CaseExpr;
/*
Expr xpr;
Expr *expr; /* condition expression */
Expr *result; /* substitution result */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} CaseWhen;
/*
/* true if elements are sub-arrays */
bool multidims pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} ArrayExpr;
/*
/* list of String, or NIL */
List *colnames pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} RowExpr;
/*
/* the arguments */
List *args;
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} CoalesceExpr;
/*
/* the arguments */
List *args;
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} MinMaxExpr;
/*
*/
Oid type pg_node_attr(query_jumble_ignore);
int32 typmod;
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} SQLValueFunction;
/*
Oid type pg_node_attr(query_jumble_ignore);
int32 typmod pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} XmlExpr;
/*
NodeTag type;
JsonFormatType format_type; /* format type */
JsonEncoding encoding; /* JSON encoding */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonFormat;
/*
JsonReturning *returning; /* RETURNING clause */
bool absent_on_null; /* ABSENT ON NULL? */
bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
- int location;
+ ParseLoc location;
} JsonConstructorExpr;
/*
JsonFormat *format; /* FORMAT clause, if specified */
JsonValueType item_type; /* JSON item type */
bool unique_keys; /* check key uniqueness? */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} JsonIsPredicate;
/* ----------------
NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
/* T to perform field-by-field null checks */
bool argisrow pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} NullTest;
/*
Expr xpr;
Expr *arg; /* input expression */
BoolTestType booltesttype; /* test type */
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} BooleanTest;
Oid resultcollid pg_node_attr(query_jumble_ignore);
/* how to display this node */
CoercionForm coercionformat pg_node_attr(query_jumble_ignore);
- int location; /* token location, or -1 if unknown */
+ ParseLoc location; /* token location, or -1 if unknown */
} CoerceToDomain;
/*
/* collation for the substituted value */
Oid collation pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} CoerceToDomainValue;
/*
/* collation for the substituted value */
Oid collation pg_node_attr(query_jumble_ignore);
/* token location, or -1 if unknown */
- int location;
+ ParseLoc location;
} SetToDefault;
/*