pg_query

package
v0.0.0-...-901893c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2019 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation ¶

Index ¶

Constants ¶

View Source
const (
	VARTAG_INDIRECT vartag_external = iota
	VARTAG_EXPANDED_RO
	VARTAG_EXPANDED_RW
	VARTAG_ONDISK
)

Variables ¶

This section is empty.

Functions ¶

func Deparse ¶

func Deparse(node Node) (*string, error)

func UnmarshalNodeArrayArrayJSON ¶

func UnmarshalNodeArrayArrayJSON(input json.RawMessage) (nodeLists [][]Node, err error)

Types ¶

type A_ArrayExpr ¶

type A_ArrayExpr struct {
	Elements List `json:"elements"` /* array element expressions */
	Location int  `json:"location"` /* token location, or -1 if unknown */
}

* A_ArrayExpr - an ARRAY[] construct

func (A_ArrayExpr) Deparse ¶

func (node A_ArrayExpr) Deparse(ctx Context) (*string, error)

func (A_ArrayExpr) Fingerprint ¶

func (node A_ArrayExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (A_ArrayExpr) MarshalJSON ¶

func (node A_ArrayExpr) MarshalJSON() ([]byte, error)

func (*A_ArrayExpr) UnmarshalJSON ¶

func (node *A_ArrayExpr) UnmarshalJSON(input []byte) (err error)

type A_Const ¶

type A_Const struct {
	Val      Node `json:"val"`      /* value (includes type info, see value.h) */
	Location int  `json:"location"` /* token location, or -1 if unknown */
}

* A_Const - a literal constant

func (A_Const) Deparse ¶

func (node A_Const) Deparse(ctx Context) (*string, error)

func (A_Const) Fingerprint ¶

func (node A_Const) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (A_Const) MarshalJSON ¶

func (node A_Const) MarshalJSON() ([]byte, error)

func (*A_Const) UnmarshalJSON ¶

func (node *A_Const) UnmarshalJSON(input []byte) (err error)

type A_Expr ¶

type A_Expr struct {
	Kind     A_Expr_Kind `json:"kind"`     /* see above */
	Name     List        `json:"name"`     /* possibly-qualified name of operator */
	Lexpr    Node        `json:"lexpr"`    /* left argument, or NULL if none */
	Rexpr    Node        `json:"rexpr"`    /* right argument, or NULL if none */
	Location int         `json:"location"` /* token location, or -1 if unknown */
}

* A_Expr - infix, prefix, and postfix expressions

func (A_Expr) Deparse ¶

func (node A_Expr) Deparse(ctx Context) (*string, error)

func (A_Expr) Fingerprint ¶

func (node A_Expr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (A_Expr) MarshalJSON ¶

func (node A_Expr) MarshalJSON() ([]byte, error)

func (*A_Expr) UnmarshalJSON ¶

func (node *A_Expr) UnmarshalJSON(input []byte) (err error)

type A_Expr_Kind ¶

type A_Expr_Kind uint

* A_Expr - infix, prefix, and postfix expressions

const (
	AEXPR_OP              A_Expr_Kind = iota /* normal operator */
	AEXPR_OP_ANY                             /* scalar op ANY (array) */
	AEXPR_OP_ALL                             /* scalar op ALL (array) */
	AEXPR_DISTINCT                           /* IS DISTINCT FROM - name must be "=" */
	AEXPR_NOT_DISTINCT                       /* IS NOT DISTINCT FROM - name must be "=" */
	AEXPR_NULLIF                             /* NULLIF - name must be "=" */
	AEXPR_OF                                 /* IS [NOT] OF - name must be "=" or "<>" */
	AEXPR_IN                                 /* [NOT] IN - name must be "=" or "<>" */
	AEXPR_LIKE                               /* [NOT] LIKE - name must be "~~" or "!~~" */
	AEXPR_ILIKE                              /* [NOT] ILIKE - name must be "~~*" or "!~~*" */
	AEXPR_SIMILAR                            /* [NOT] SIMILAR - name must be "~" or "!~" */
	AEXPR_BETWEEN                            /* name must be "BETWEEN" */
	AEXPR_NOT_BETWEEN                        /* name must be "NOT BETWEEN" */
	AEXPR_BETWEEN_SYM                        /* name must be "BETWEEN SYMMETRIC" */
	AEXPR_NOT_BETWEEN_SYM                    /* name must be "NOT BETWEEN SYMMETRIC" */
	AEXPR_PAREN                              /* nameless dummy node for parentheses */
)

type A_Indices ¶

type A_Indices struct {
	IsSlice bool `json:"is_slice"` /* true if slice (i.e., colon present) */
	Lidx    Node `json:"lidx"`     /* slice lower bound, if any */
	Uidx    Node `json:"uidx"`     /* subscript, or slice upper bound if any */
}

* A_Indices - array subscript or slice bounds ([idx] or [lidx:uidx]) * * In slice case, either or both of lidx and uidx can be NULL (omitted). * In non-slice case, uidx holds the single subscript and lidx is always NULL.

func (A_Indices) Deparse ¶

func (node A_Indices) Deparse(ctx Context) (*string, error)

func (A_Indices) Fingerprint ¶

func (node A_Indices) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (A_Indices) MarshalJSON ¶

func (node A_Indices) MarshalJSON() ([]byte, error)

func (*A_Indices) UnmarshalJSON ¶

func (node *A_Indices) UnmarshalJSON(input []byte) (err error)

type A_Indirection ¶

type A_Indirection struct {
	Arg         Node `json:"arg"`         /* the thing being selected from */
	Indirection List `json:"indirection"` /* subscripts and/or field names and/or * */
}

* A_Indirection - select a field and/or array element from an expression * * The indirection list can contain A_Indices nodes (representing * subscripting), string Value nodes (representing field selection --- the * string value is the name of the field to select), and A_Star nodes * (representing selection of all fields of a composite type). * For example, a complex selection operation like * (foo).field1[42][7].field2 * would be represented with a single A_Indirection node having a 4-element * indirection list. * * Currently, A_Star must appear only as the last list element --- the grammar * is responsible for enforcing this!

func (A_Indirection) Deparse ¶

func (node A_Indirection) Deparse(ctx Context) (*string, error)

func (A_Indirection) Fingerprint ¶

func (node A_Indirection) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (A_Indirection) MarshalJSON ¶

func (node A_Indirection) MarshalJSON() ([]byte, error)

func (*A_Indirection) UnmarshalJSON ¶

func (node *A_Indirection) UnmarshalJSON(input []byte) (err error)

type A_Star ¶

type A_Star struct {
}

* A_Star - '*' representing all columns of a table or compound field * * This can appear within ColumnRef.fields, A_Indirection.indirection, and * ResTarget.indirection lists.

func (A_Star) Deparse ¶

func (node A_Star) Deparse(ctx Context) (*string, error)

func (A_Star) Fingerprint ¶

func (node A_Star) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (A_Star) MarshalJSON ¶

func (node A_Star) MarshalJSON() ([]byte, error)

func (*A_Star) UnmarshalJSON ¶

func (node *A_Star) UnmarshalJSON(input []byte) (err error)

type AccessPriv ¶

type AccessPriv struct {
	PrivName *string `json:"priv_name"` /* string name of privilege */
	Cols     List    `json:"cols"`      /* list of Value strings */
}

* An access privilege, with optional list of column names * priv_name == NULL denotes ALL PRIVILEGES (only used with a column list) * cols == NIL denotes "all columns" * Note that simple "ALL PRIVILEGES" is represented as a NIL list, not * an AccessPriv with both fields null.

func (AccessPriv) Deparse ¶

func (node AccessPriv) Deparse(ctx Context) (*string, error)

func (AccessPriv) Fingerprint ¶

func (node AccessPriv) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AccessPriv) MarshalJSON ¶

func (node AccessPriv) MarshalJSON() ([]byte, error)

func (*AccessPriv) UnmarshalJSON ¶

func (node *AccessPriv) UnmarshalJSON(input []byte) (err error)

type AclMode ¶

type AclMode uint32

type AggSplit ¶

type AggSplit uint

Supported operating modes (i.e., useful combinations of these options):

const (
	/* Basic, non-split aggregation: */
	AGGSPLIT_SIMPLE AggSplit = iota

	/* Initial phase of partial aggregation, with serialization: */
	AGGSPLIT_INITIAL_SERIAL

	/* Final phase of partial aggregation, with deserialization: */
	AGGSPLIT_FINAL_DESERIAL
)

type AggStrategy ¶

type AggStrategy uint

* AggStrategy - * overall execution strategies for Agg plan nodes * * This is needed in both plannodes.h and relation.h, so put it here...

const (
	AGG_PLAIN  AggStrategy = iota /* simple agg across all input rows */
	AGG_SORTED                    /* grouped agg, input must be sorted */
	AGG_HASHED                    /* grouped agg, use internal hashtable */
	AGG_MIXED                     /* grouped agg, hash and sort both used */
)

type Aggref ¶

type Aggref struct {
	Xpr           Node `json:"xpr"`
	Aggfnoid      Oid  `json:"aggfnoid"`      /* pg_proc Oid of the aggregate */
	Aggtype       Oid  `json:"aggtype"`       /* type Oid of result of the aggregate */
	Aggcollid     Oid  `json:"aggcollid"`     /* OID of collation of result */
	Inputcollid   Oid  `json:"inputcollid"`   /* OID of collation that function should use */
	Aggtranstype  Oid  `json:"aggtranstype"`  /* type Oid of aggregate's transition value */
	Aggargtypes   List `json:"aggargtypes"`   /* type Oids of direct and aggregated args */
	Aggdirectargs List `json:"aggdirectargs"` /* direct arguments, if an ordered-set agg */
	Args          List `json:"args"`          /* aggregated arguments and sort expressions */
	Aggorder      List `json:"aggorder"`      /* ORDER BY (list of SortGroupClause) */
	Aggdistinct   List `json:"aggdistinct"`   /* DISTINCT (list of SortGroupClause) */
	Aggfilter     Node `json:"aggfilter"`     /* FILTER expression, if any */
	Aggstar       bool `json:"aggstar"`       /* TRUE if argument list was really '*' */
	Aggvariadic   bool `json:"aggvariadic"`   /* true if variadic arguments have been
	 * combined into an array last argument */

	Aggkind     byte     `json:"aggkind"`     /* aggregate kind (see pg_aggregate.h) */
	Agglevelsup Index    `json:"agglevelsup"` /* > 0 if agg belongs to outer query */
	Aggsplit    AggSplit `json:"aggsplit"`    /* expected agg-splitting mode of parent Agg */
	Location    int      `json:"location"`    /* token location, or -1 if unknown */
}

* Aggref * * The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes. * * For a normal (non-ordered-set) aggregate, the non-resjunk TargetEntries * represent the aggregate's regular arguments (if any) and resjunk TLEs can * be added at the end to represent ORDER BY expressions that are not also * arguments. As in a top-level Query, the TLEs can be marked with * ressortgroupref indexes to let them be referenced by SortGroupClause * entries in the aggorder and/or aggdistinct lists. This represents ORDER BY * and DISTINCT operations to be applied to the aggregate input rows before * they are passed to the transition function. The grammar only allows a * simple "DISTINCT" specifier for the arguments, but we use the full * query-level representation to allow more code sharing. * * For an ordered-set aggregate, the args list represents the WITHIN GROUP * (aggregated) arguments, all of which will be listed in the aggorder list. * DISTINCT is not supported in this case, so aggdistinct will be NIL. * The direct arguments appear in aggdirectargs (as a list of plain * expressions, not TargetEntry nodes). * * aggtranstype is the data type of the state transition values for this * aggregate (resolved to an actual type, if agg's transtype is polymorphic). * This is determined during planning and is InvalidOid before that. * * aggargtypes is an OID list of the data types of the direct and regular * arguments. Normally it's redundant with the aggdirectargs and args lists, * but in a combining aggregate, it's not because the args list has been * replaced with a single argument representing the partial-aggregate * transition values. * * aggsplit indicates the expected partial-aggregation mode for the Aggref's * parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but * the planner might change it to something else. We use this mainly as * a crosscheck that the Aggrefs match the plan; but note that when aggsplit * indicates a non-final mode, aggtype reflects the transition data type * not the SQL-level output type of the aggregate.

func (Aggref) Deparse ¶

func (node Aggref) Deparse(ctx Context) (*string, error)

func (Aggref) Fingerprint ¶

func (node Aggref) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Aggref) MarshalJSON ¶

func (node Aggref) MarshalJSON() ([]byte, error)

func (*Aggref) UnmarshalJSON ¶

func (node *Aggref) UnmarshalJSON(input []byte) (err error)

type Alias ¶

type Alias struct {
	Aliasname *string `json:"aliasname"` /* aliased rel name (never qualified) */
	Colnames  List    `json:"colnames"`  /* optional list of column aliases */
}

* Alias - * specifies an alias for a range variable; the alias might also * specify renaming of columns within the table. * * Note: colnames is a list of Value nodes (always strings). In Alias structs * associated with RTEs, there may be entries corresponding to dropped * columns; these are normally empty strings (""). See parsenodes.h for info.

func (Alias) Deparse ¶

func (node Alias) Deparse(ctx Context) (*string, error)

func (Alias) Fingerprint ¶

func (node Alias) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Alias) MarshalJSON ¶

func (node Alias) MarshalJSON() ([]byte, error)

func (*Alias) UnmarshalJSON ¶

func (node *Alias) UnmarshalJSON(input []byte) (err error)

type AlterCollationStmt ¶

type AlterCollationStmt struct {
	Collname List `json:"collname"`
}

---------------------- * Alter Collation * ----------------------

func (AlterCollationStmt) Deparse ¶

func (node AlterCollationStmt) Deparse(ctx Context) (*string, error)

func (AlterCollationStmt) Fingerprint ¶

func (node AlterCollationStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterCollationStmt) MarshalJSON ¶

func (node AlterCollationStmt) MarshalJSON() ([]byte, error)

func (*AlterCollationStmt) UnmarshalJSON ¶

func (node *AlterCollationStmt) UnmarshalJSON(input []byte) (err error)

type AlterDatabaseSetStmt ¶

type AlterDatabaseSetStmt struct {
	Dbname  *string          `json:"dbname"`  /* database name */
	Setstmt *VariableSetStmt `json:"setstmt"` /* SET or RESET subcommand */
}

---------------------- * Alter Database * ----------------------

func (AlterDatabaseSetStmt) Deparse ¶

func (node AlterDatabaseSetStmt) Deparse(ctx Context) (*string, error)

func (AlterDatabaseSetStmt) Fingerprint ¶

func (node AlterDatabaseSetStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterDatabaseSetStmt) MarshalJSON ¶

func (node AlterDatabaseSetStmt) MarshalJSON() ([]byte, error)

func (*AlterDatabaseSetStmt) UnmarshalJSON ¶

func (node *AlterDatabaseSetStmt) UnmarshalJSON(input []byte) (err error)

type AlterDatabaseStmt ¶

type AlterDatabaseStmt struct {
	Dbname  *string `json:"dbname"`  /* name of database to alter */
	Options List    `json:"options"` /* List of DefElem nodes */
}

---------------------- * Alter Database * ----------------------

func (AlterDatabaseStmt) Deparse ¶

func (node AlterDatabaseStmt) Deparse(ctx Context) (*string, error)

func (AlterDatabaseStmt) Fingerprint ¶

func (node AlterDatabaseStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterDatabaseStmt) MarshalJSON ¶

func (node AlterDatabaseStmt) MarshalJSON() ([]byte, error)

func (*AlterDatabaseStmt) UnmarshalJSON ¶

func (node *AlterDatabaseStmt) UnmarshalJSON(input []byte) (err error)

type AlterDefaultPrivilegesStmt ¶

type AlterDefaultPrivilegesStmt struct {
	Options List       `json:"options"` /* list of DefElem */
	Action  *GrantStmt `json:"action"`  /* GRANT/REVOKE action (with objects=NIL) */
}

---------------------- * Alter Default Privileges Statement * ----------------------

func (AlterDefaultPrivilegesStmt) Deparse ¶

func (node AlterDefaultPrivilegesStmt) Deparse(ctx Context) (*string, error)

func (AlterDefaultPrivilegesStmt) Fingerprint ¶

func (node AlterDefaultPrivilegesStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterDefaultPrivilegesStmt) MarshalJSON ¶

func (node AlterDefaultPrivilegesStmt) MarshalJSON() ([]byte, error)

func (*AlterDefaultPrivilegesStmt) UnmarshalJSON ¶

func (node *AlterDefaultPrivilegesStmt) UnmarshalJSON(input []byte) (err error)

type AlterDomainStmt ¶

type AlterDomainStmt struct {
	Subtype byte `json:"subtype"` /*------------
	 *	T = alter column default
	 *	N = alter column drop not null
	 *	O = alter column set not null
	 *	C = add constraint
	 *	X = drop constraint
	 *------------
	 */

	TypeName  List         `json:"typeName"`   /* domain to work on */
	Name      *string      `json:"name"`       /* column or constraint name to act on */
	Def       Node         `json:"def"`        /* definition of default or constraint */
	Behavior  DropBehavior `json:"behavior"`   /* RESTRICT or CASCADE for DROP cases */
	MissingOk bool         `json:"missing_ok"` /* skip error if missing? */
}

---------------------- * Alter Domain * * The fields are used in different ways by the different variants of * this command. * ----------------------

func (AlterDomainStmt) Deparse ¶

func (node AlterDomainStmt) Deparse(ctx Context) (*string, error)

func (AlterDomainStmt) Fingerprint ¶

func (node AlterDomainStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterDomainStmt) MarshalJSON ¶

func (node AlterDomainStmt) MarshalJSON() ([]byte, error)

func (*AlterDomainStmt) UnmarshalJSON ¶

func (node *AlterDomainStmt) UnmarshalJSON(input []byte) (err error)

type AlterEnumStmt ¶

type AlterEnumStmt struct {
	TypeName           List    `json:"typeName"`           /* qualified name (list of Value strings) */
	OldVal             *string `json:"oldVal"`             /* old enum value's name, if renaming */
	NewVal             *string `json:"newVal"`             /* new enum value's name */
	NewValNeighbor     *string `json:"newValNeighbor"`     /* neighboring enum value, if specified */
	NewValIsAfter      bool    `json:"newValIsAfter"`      /* place new enum value after neighbor? */
	SkipIfNewValExists bool    `json:"skipIfNewValExists"` /* no error if new already exists? */
}

---------------------- * Alter Type Statement, enum types * ----------------------

func (AlterEnumStmt) Deparse ¶

func (node AlterEnumStmt) Deparse(ctx Context) (*string, error)

func (AlterEnumStmt) Fingerprint ¶

func (node AlterEnumStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterEnumStmt) MarshalJSON ¶

func (node AlterEnumStmt) MarshalJSON() ([]byte, error)

func (*AlterEnumStmt) UnmarshalJSON ¶

func (node *AlterEnumStmt) UnmarshalJSON(input []byte) (err error)

type AlterEventTrigStmt ¶

type AlterEventTrigStmt struct {
	Trigname  *string `json:"trigname"`  /* TRIGGER's name */
	Tgenabled byte    `json:"tgenabled"` /* trigger's firing configuration WRT
	 * session_replication_role */
}

---------------------- * Alter EVENT TRIGGER Statement * ----------------------

func (AlterEventTrigStmt) Deparse ¶

func (node AlterEventTrigStmt) Deparse(ctx Context) (*string, error)

func (AlterEventTrigStmt) Fingerprint ¶

func (node AlterEventTrigStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterEventTrigStmt) MarshalJSON ¶

func (node AlterEventTrigStmt) MarshalJSON() ([]byte, error)

func (*AlterEventTrigStmt) UnmarshalJSON ¶

func (node *AlterEventTrigStmt) UnmarshalJSON(input []byte) (err error)

type AlterExtensionContentsStmt ¶

type AlterExtensionContentsStmt struct {
	Extname *string    `json:"extname"` /* Extension's name */
	Action  int        `json:"action"`  /* +1 = add object, -1 = drop object */
	Objtype ObjectType `json:"objtype"` /* Object's type */
	Object  Node       `json:"object"`  /* Qualified name of the object */
}

---------------------- * Create/Alter Extension Statements * ----------------------

func (AlterExtensionContentsStmt) Deparse ¶

func (node AlterExtensionContentsStmt) Deparse(ctx Context) (*string, error)

func (AlterExtensionContentsStmt) Fingerprint ¶

func (node AlterExtensionContentsStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterExtensionContentsStmt) MarshalJSON ¶

func (node AlterExtensionContentsStmt) MarshalJSON() ([]byte, error)

func (*AlterExtensionContentsStmt) UnmarshalJSON ¶

func (node *AlterExtensionContentsStmt) UnmarshalJSON(input []byte) (err error)

type AlterExtensionStmt ¶

type AlterExtensionStmt struct {
	Extname *string `json:"extname"`
	Options List    `json:"options"` /* List of DefElem nodes */
}

Only used for ALTER EXTENSION UPDATE; later might need an action field

func (AlterExtensionStmt) Deparse ¶

func (node AlterExtensionStmt) Deparse(ctx Context) (*string, error)

func (AlterExtensionStmt) Fingerprint ¶

func (node AlterExtensionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterExtensionStmt) MarshalJSON ¶

func (node AlterExtensionStmt) MarshalJSON() ([]byte, error)

func (*AlterExtensionStmt) UnmarshalJSON ¶

func (node *AlterExtensionStmt) UnmarshalJSON(input []byte) (err error)

type AlterFdwStmt ¶

type AlterFdwStmt struct {
	Fdwname     *string `json:"fdwname"`      /* foreign-data wrapper name */
	FuncOptions List    `json:"func_options"` /* HANDLER/VALIDATOR options */
	Options     List    `json:"options"`      /* generic options to FDW */
}

---------------------- * Create/Alter FOREIGN DATA WRAPPER Statements * ----------------------

func (AlterFdwStmt) Deparse ¶

func (node AlterFdwStmt) Deparse(ctx Context) (*string, error)

func (AlterFdwStmt) Fingerprint ¶

func (node AlterFdwStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterFdwStmt) MarshalJSON ¶

func (node AlterFdwStmt) MarshalJSON() ([]byte, error)

func (*AlterFdwStmt) UnmarshalJSON ¶

func (node *AlterFdwStmt) UnmarshalJSON(input []byte) (err error)

type AlterForeignServerStmt ¶

type AlterForeignServerStmt struct {
	Servername *string `json:"servername"`  /* server name */
	Version    *string `json:"version"`     /* optional server version */
	Options    List    `json:"options"`     /* generic options to server */
	HasVersion bool    `json:"has_version"` /* version specified */
}

---------------------- * Create/Alter FOREIGN SERVER Statements * ----------------------

func (AlterForeignServerStmt) Deparse ¶

func (node AlterForeignServerStmt) Deparse(ctx Context) (*string, error)

func (AlterForeignServerStmt) Fingerprint ¶

func (node AlterForeignServerStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterForeignServerStmt) MarshalJSON ¶

func (node AlterForeignServerStmt) MarshalJSON() ([]byte, error)

func (*AlterForeignServerStmt) UnmarshalJSON ¶

func (node *AlterForeignServerStmt) UnmarshalJSON(input []byte) (err error)

type AlterFunctionStmt ¶

type AlterFunctionStmt struct {
	Func    *ObjectWithArgs `json:"func"`    /* name and args of function */
	Actions List            `json:"actions"` /* list of DefElem */
}

---------------------- * Create Function Statement * ----------------------

func (AlterFunctionStmt) Deparse ¶

func (node AlterFunctionStmt) Deparse(ctx Context) (*string, error)

func (AlterFunctionStmt) Fingerprint ¶

func (node AlterFunctionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterFunctionStmt) MarshalJSON ¶

func (node AlterFunctionStmt) MarshalJSON() ([]byte, error)

func (*AlterFunctionStmt) UnmarshalJSON ¶

func (node *AlterFunctionStmt) UnmarshalJSON(input []byte) (err error)

type AlterObjectDependsStmt ¶

type AlterObjectDependsStmt struct {
	ObjectType ObjectType `json:"objectType"` /* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */
	Relation   *RangeVar  `json:"relation"`   /* in case a table is involved */
	Object     Node       `json:"object"`     /* name of the object */
	Extname    Node       `json:"extname"`    /* extension name */
}

---------------------- * ALTER object DEPENDS ON EXTENSION extname * ----------------------

func (AlterObjectDependsStmt) Deparse ¶

func (node AlterObjectDependsStmt) Deparse(ctx Context) (*string, error)

func (AlterObjectDependsStmt) Fingerprint ¶

func (node AlterObjectDependsStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterObjectDependsStmt) MarshalJSON ¶

func (node AlterObjectDependsStmt) MarshalJSON() ([]byte, error)

func (*AlterObjectDependsStmt) UnmarshalJSON ¶

func (node *AlterObjectDependsStmt) UnmarshalJSON(input []byte) (err error)

type AlterObjectSchemaStmt ¶

type AlterObjectSchemaStmt struct {
	ObjectType ObjectType `json:"objectType"` /* OBJECT_TABLE, OBJECT_TYPE, etc */
	Relation   *RangeVar  `json:"relation"`   /* in case it's a table */
	Object     Node       `json:"object"`     /* in case it's some other object */
	Newschema  *string    `json:"newschema"`  /* the new schema */
	MissingOk  bool       `json:"missing_ok"` /* skip error if missing? */
}

---------------------- * ALTER object SET SCHEMA Statement * ----------------------

func (AlterObjectSchemaStmt) Deparse ¶

func (node AlterObjectSchemaStmt) Deparse(ctx Context) (*string, error)

func (AlterObjectSchemaStmt) Fingerprint ¶

func (node AlterObjectSchemaStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterObjectSchemaStmt) MarshalJSON ¶

func (node AlterObjectSchemaStmt) MarshalJSON() ([]byte, error)

func (*AlterObjectSchemaStmt) UnmarshalJSON ¶

func (node *AlterObjectSchemaStmt) UnmarshalJSON(input []byte) (err error)

type AlterOpFamilyStmt ¶

type AlterOpFamilyStmt struct {
	Opfamilyname List    `json:"opfamilyname"` /* qualified name (list of Value strings) */
	Amname       *string `json:"amname"`       /* name of index AM opfamily is for */
	IsDrop       bool    `json:"isDrop"`       /* ADD or DROP the items? */
	Items        List    `json:"items"`        /* List of CreateOpClassItem nodes */
}

---------------------- * Alter Operator Family Statement * ----------------------

func (AlterOpFamilyStmt) Deparse ¶

func (node AlterOpFamilyStmt) Deparse(ctx Context) (*string, error)

func (AlterOpFamilyStmt) Fingerprint ¶

func (node AlterOpFamilyStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterOpFamilyStmt) MarshalJSON ¶

func (node AlterOpFamilyStmt) MarshalJSON() ([]byte, error)

func (*AlterOpFamilyStmt) UnmarshalJSON ¶

func (node *AlterOpFamilyStmt) UnmarshalJSON(input []byte) (err error)

type AlterOperatorStmt ¶

type AlterOperatorStmt struct {
	Opername *ObjectWithArgs `json:"opername"` /* operator name and argument types */
	Options  List            `json:"options"`  /* List of DefElem nodes */
}

---------------------- * Alter Operator Set Restrict, Join * ----------------------

func (AlterOperatorStmt) Deparse ¶

func (node AlterOperatorStmt) Deparse(ctx Context) (*string, error)

func (AlterOperatorStmt) Fingerprint ¶

func (node AlterOperatorStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterOperatorStmt) MarshalJSON ¶

func (node AlterOperatorStmt) MarshalJSON() ([]byte, error)

func (*AlterOperatorStmt) UnmarshalJSON ¶

func (node *AlterOperatorStmt) UnmarshalJSON(input []byte) (err error)

type AlterOwnerStmt ¶

type AlterOwnerStmt struct {
	ObjectType ObjectType `json:"objectType"` /* OBJECT_TABLE, OBJECT_TYPE, etc */
	Relation   *RangeVar  `json:"relation"`   /* in case it's a table */
	Object     Node       `json:"object"`     /* in case it's some other object */
	Newowner   *RoleSpec  `json:"newowner"`   /* the new owner */
}

---------------------- * Alter Object Owner Statement * ----------------------

func (AlterOwnerStmt) Deparse ¶

func (node AlterOwnerStmt) Deparse(ctx Context) (*string, error)

func (AlterOwnerStmt) Fingerprint ¶

func (node AlterOwnerStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterOwnerStmt) MarshalJSON ¶

func (node AlterOwnerStmt) MarshalJSON() ([]byte, error)

func (*AlterOwnerStmt) UnmarshalJSON ¶

func (node *AlterOwnerStmt) UnmarshalJSON(input []byte) (err error)

type AlterPolicyStmt ¶

type AlterPolicyStmt struct {
	PolicyName *string   `json:"policy_name"` /* Policy's name */
	Table      *RangeVar `json:"table"`       /* the table name the policy applies to */
	Roles      List      `json:"roles"`       /* the roles associated with the policy */
	Qual       Node      `json:"qual"`        /* the policy's condition */
	WithCheck  Node      `json:"with_check"`  /* the policy's WITH CHECK condition. */
}

----------------------

  • Alter POLICY Statement *----------------------

func (AlterPolicyStmt) Deparse ¶

func (node AlterPolicyStmt) Deparse(ctx Context) (*string, error)

func (AlterPolicyStmt) Fingerprint ¶

func (node AlterPolicyStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterPolicyStmt) MarshalJSON ¶

func (node AlterPolicyStmt) MarshalJSON() ([]byte, error)

func (*AlterPolicyStmt) UnmarshalJSON ¶

func (node *AlterPolicyStmt) UnmarshalJSON(input []byte) (err error)

type AlterPublicationStmt ¶

type AlterPublicationStmt struct {
	Pubname *string `json:"pubname"` /* Name of of the publication */

	/* parameters used for ALTER PUBLICATION ... WITH */
	Options List `json:"options"` /* List of DefElem nodes */

	/* parameters used for ALTER PUBLICATION ... ADD/DROP TABLE */
	Tables       List          `json:"tables"`         /* List of tables to add/drop */
	ForAllTables bool          `json:"for_all_tables"` /* Special publication for all tables in db */
	TableAction  DefElemAction `json:"tableAction"`    /* What action to perform with the tables */
}

func (AlterPublicationStmt) Deparse ¶

func (node AlterPublicationStmt) Deparse(ctx Context) (*string, error)

func (AlterPublicationStmt) Fingerprint ¶

func (node AlterPublicationStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterPublicationStmt) MarshalJSON ¶

func (node AlterPublicationStmt) MarshalJSON() ([]byte, error)

func (*AlterPublicationStmt) UnmarshalJSON ¶

func (node *AlterPublicationStmt) UnmarshalJSON(input []byte) (err error)

type AlterRoleSetStmt ¶

type AlterRoleSetStmt struct {
	Role     *RoleSpec        `json:"role"`     /* role */
	Database *string          `json:"database"` /* database name, or NULL */
	Setstmt  *VariableSetStmt `json:"setstmt"`  /* SET or RESET subcommand */
}

---------------------- * Create/Alter/Drop Role Statements * * Note: these node types are also used for the backwards-compatible * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases * there's really no need to distinguish what the original spelling was, * but for CREATE we mark the type because the defaults vary. * ----------------------

func (AlterRoleSetStmt) Deparse ¶

func (node AlterRoleSetStmt) Deparse(ctx Context) (*string, error)

func (AlterRoleSetStmt) Fingerprint ¶

func (node AlterRoleSetStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterRoleSetStmt) MarshalJSON ¶

func (node AlterRoleSetStmt) MarshalJSON() ([]byte, error)

func (*AlterRoleSetStmt) UnmarshalJSON ¶

func (node *AlterRoleSetStmt) UnmarshalJSON(input []byte) (err error)

type AlterRoleStmt ¶

type AlterRoleStmt struct {
	Role    *RoleSpec `json:"role"`    /* role */
	Options List      `json:"options"` /* List of DefElem nodes */
	Action  int       `json:"action"`  /* +1 = add members, -1 = drop members */
}

---------------------- * Create/Alter/Drop Role Statements * * Note: these node types are also used for the backwards-compatible * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases * there's really no need to distinguish what the original spelling was, * but for CREATE we mark the type because the defaults vary. * ----------------------

func (AlterRoleStmt) Deparse ¶

func (node AlterRoleStmt) Deparse(ctx Context) (*string, error)

func (AlterRoleStmt) Fingerprint ¶

func (node AlterRoleStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterRoleStmt) MarshalJSON ¶

func (node AlterRoleStmt) MarshalJSON() ([]byte, error)

func (*AlterRoleStmt) UnmarshalJSON ¶

func (node *AlterRoleStmt) UnmarshalJSON(input []byte) (err error)

type AlterSeqStmt ¶

type AlterSeqStmt struct {
	Sequence    *RangeVar `json:"sequence"` /* the sequence to alter */
	Options     List      `json:"options"`
	ForIdentity bool      `json:"for_identity"`
	MissingOk   bool      `json:"missing_ok"` /* skip error if a role is missing? */
}

---------------------- * {Create|Alter} SEQUENCE Statement * ----------------------

func (AlterSeqStmt) Deparse ¶

func (node AlterSeqStmt) Deparse(ctx Context) (*string, error)

func (AlterSeqStmt) Fingerprint ¶

func (node AlterSeqStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterSeqStmt) MarshalJSON ¶

func (node AlterSeqStmt) MarshalJSON() ([]byte, error)

func (*AlterSeqStmt) UnmarshalJSON ¶

func (node *AlterSeqStmt) UnmarshalJSON(input []byte) (err error)

type AlterSubscriptionStmt ¶

type AlterSubscriptionStmt struct {
	Kind        AlterSubscriptionType `json:"kind"`        /* ALTER_SUBSCRIPTION_OPTIONS, etc */
	Subname     *string               `json:"subname"`     /* Name of of the subscription */
	Conninfo    *string               `json:"conninfo"`    /* Connection string to publisher */
	Publication List                  `json:"publication"` /* One or more publication to subscribe to */
	Options     List                  `json:"options"`     /* List of DefElem nodes */
}

func (AlterSubscriptionStmt) Deparse ¶

func (node AlterSubscriptionStmt) Deparse(ctx Context) (*string, error)

func (AlterSubscriptionStmt) Fingerprint ¶

func (node AlterSubscriptionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterSubscriptionStmt) MarshalJSON ¶

func (node AlterSubscriptionStmt) MarshalJSON() ([]byte, error)

func (*AlterSubscriptionStmt) UnmarshalJSON ¶

func (node *AlterSubscriptionStmt) UnmarshalJSON(input []byte) (err error)

type AlterSubscriptionType ¶

type AlterSubscriptionType uint
const (
	ALTER_SUBSCRIPTION_OPTIONS AlterSubscriptionType = iota
	ALTER_SUBSCRIPTION_CONNECTION
	ALTER_SUBSCRIPTION_PUBLICATION
	ALTER_SUBSCRIPTION_REFRESH
	ALTER_SUBSCRIPTION_ENABLED
)

type AlterSystemStmt ¶

type AlterSystemStmt struct {
	Setstmt *VariableSetStmt `json:"setstmt"` /* SET subcommand */
}

---------------------- * Alter System Statement * ----------------------

func (AlterSystemStmt) Deparse ¶

func (node AlterSystemStmt) Deparse(ctx Context) (*string, error)

func (AlterSystemStmt) Fingerprint ¶

func (node AlterSystemStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterSystemStmt) MarshalJSON ¶

func (node AlterSystemStmt) MarshalJSON() ([]byte, error)

func (*AlterSystemStmt) UnmarshalJSON ¶

func (node *AlterSystemStmt) UnmarshalJSON(input []byte) (err error)

type AlterTSConfigType ¶

type AlterTSConfigType uint

* TS Configuration stmts: DefineStmt, RenameStmt and DropStmt are default

const (
	ALTER_TSCONFIG_ADD_MAPPING AlterTSConfigType = iota
	ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN
	ALTER_TSCONFIG_REPLACE_DICT
	ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN
	ALTER_TSCONFIG_DROP_MAPPING
)

type AlterTSConfigurationStmt ¶

type AlterTSConfigurationStmt struct {
	Kind    AlterTSConfigType `json:"kind"`    /* ALTER_TSCONFIG_ADD_MAPPING, etc */
	Cfgname List              `json:"cfgname"` /* qualified name (list of Value strings) */

	/*
	 * dicts will be non-NIL if ADD/ALTER MAPPING was specified. If dicts is
	 * NIL, but tokentype isn't, DROP MAPPING was specified.
	 */
	Tokentype List `json:"tokentype"`  /* list of Value strings */
	Dicts     List `json:"dicts"`      /* list of list of Value strings */
	Override  bool `json:"override"`   /* if true - remove old variant */
	Replace   bool `json:"replace"`    /* if true - replace dictionary by another */
	MissingOk bool `json:"missing_ok"` /* for DROP - skip error if missing? */
}

func (AlterTSConfigurationStmt) Deparse ¶

func (node AlterTSConfigurationStmt) Deparse(ctx Context) (*string, error)

func (AlterTSConfigurationStmt) Fingerprint ¶

func (node AlterTSConfigurationStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterTSConfigurationStmt) MarshalJSON ¶

func (node AlterTSConfigurationStmt) MarshalJSON() ([]byte, error)

func (*AlterTSConfigurationStmt) UnmarshalJSON ¶

func (node *AlterTSConfigurationStmt) UnmarshalJSON(input []byte) (err error)

type AlterTSDictionaryStmt ¶

type AlterTSDictionaryStmt struct {
	Dictname List `json:"dictname"` /* qualified name (list of Value strings) */
	Options  List `json:"options"`  /* List of DefElem nodes */
}

* TS Dictionary stmts: DefineStmt, RenameStmt and DropStmt are default

func (AlterTSDictionaryStmt) Deparse ¶

func (node AlterTSDictionaryStmt) Deparse(ctx Context) (*string, error)

func (AlterTSDictionaryStmt) Fingerprint ¶

func (node AlterTSDictionaryStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterTSDictionaryStmt) MarshalJSON ¶

func (node AlterTSDictionaryStmt) MarshalJSON() ([]byte, error)

func (*AlterTSDictionaryStmt) UnmarshalJSON ¶

func (node *AlterTSDictionaryStmt) UnmarshalJSON(input []byte) (err error)

type AlterTableCmd ¶

type AlterTableCmd struct {
	Subtype AlterTableType `json:"subtype"` /* Type of table alteration to apply */
	Name    *string        `json:"name"`    /* column, constraint, or trigger to act on,
	 * or tablespace */

	Newowner *RoleSpec `json:"newowner"`
	Def      Node      `json:"def"` /* definition of new column, index,
	 * constraint, or parent table */

	Behavior  DropBehavior `json:"behavior"`   /* RESTRICT or CASCADE for DROP cases */
	MissingOk bool         `json:"missing_ok"` /* skip error if missing? */
}

---------------------- * Alter Table * ----------------------

func (AlterTableCmd) Deparse ¶

func (node AlterTableCmd) Deparse(ctx Context) (*string, error)

func (AlterTableCmd) Fingerprint ¶

func (node AlterTableCmd) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterTableCmd) MarshalJSON ¶

func (node AlterTableCmd) MarshalJSON() ([]byte, error)

func (*AlterTableCmd) UnmarshalJSON ¶

func (node *AlterTableCmd) UnmarshalJSON(input []byte) (err error)

type AlterTableMoveAllStmt ¶

type AlterTableMoveAllStmt struct {
	OrigTablespacename *string    `json:"orig_tablespacename"`
	Objtype            ObjectType `json:"objtype"` /* Object type to move */
	Roles              List       `json:"roles"`   /* List of roles to move objects of */
	NewTablespacename  *string    `json:"new_tablespacename"`
	Nowait             bool       `json:"nowait"`
}

func (AlterTableMoveAllStmt) Deparse ¶

func (node AlterTableMoveAllStmt) Deparse(ctx Context) (*string, error)

func (AlterTableMoveAllStmt) Fingerprint ¶

func (node AlterTableMoveAllStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterTableMoveAllStmt) MarshalJSON ¶

func (node AlterTableMoveAllStmt) MarshalJSON() ([]byte, error)

func (*AlterTableMoveAllStmt) UnmarshalJSON ¶

func (node *AlterTableMoveAllStmt) UnmarshalJSON(input []byte) (err error)

type AlterTableSpaceOptionsStmt ¶

type AlterTableSpaceOptionsStmt struct {
	Tablespacename *string `json:"tablespacename"`
	Options        List    `json:"options"`
	IsReset        bool    `json:"isReset"`
}

func (AlterTableSpaceOptionsStmt) Deparse ¶

func (node AlterTableSpaceOptionsStmt) Deparse(ctx Context) (*string, error)

func (AlterTableSpaceOptionsStmt) Fingerprint ¶

func (node AlterTableSpaceOptionsStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterTableSpaceOptionsStmt) MarshalJSON ¶

func (node AlterTableSpaceOptionsStmt) MarshalJSON() ([]byte, error)

func (*AlterTableSpaceOptionsStmt) UnmarshalJSON ¶

func (node *AlterTableSpaceOptionsStmt) UnmarshalJSON(input []byte) (err error)

type AlterTableStmt ¶

type AlterTableStmt struct {
	Relation  *RangeVar  `json:"relation"`   /* table to work on */
	Cmds      List       `json:"cmds"`       /* list of subcommands */
	Relkind   ObjectType `json:"relkind"`    /* type of object */
	MissingOk bool       `json:"missing_ok"` /* skip error if table missing */
}

---------------------- * Alter Table * ----------------------

func (AlterTableStmt) Deparse ¶

func (node AlterTableStmt) Deparse(ctx Context) (*string, error)

func (AlterTableStmt) Fingerprint ¶

func (node AlterTableStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterTableStmt) MarshalJSON ¶

func (node AlterTableStmt) MarshalJSON() ([]byte, error)

func (*AlterTableStmt) UnmarshalJSON ¶

func (node *AlterTableStmt) UnmarshalJSON(input []byte) (err error)

type AlterTableType ¶

type AlterTableType uint
const (
	AT_AddColumn                 AlterTableType = iota /* add column */
	AT_AddColumnRecurse                                /* internal to commands/tablecmds.c */
	AT_AddColumnToView                                 /* implicitly via CREATE OR REPLACE VIEW */
	AT_ColumnDefault                                   /* alter column default */
	AT_DropNotNull                                     /* alter column drop not null */
	AT_SetNotNull                                      /* alter column set not null */
	AT_SetStatistics                                   /* alter column set statistics */
	AT_SetOptions                                      /* alter column set ( options ) */
	AT_ResetOptions                                    /* alter column reset ( options ) */
	AT_SetStorage                                      /* alter column set storage */
	AT_DropColumn                                      /* drop column */
	AT_DropColumnRecurse                               /* internal to commands/tablecmds.c */
	AT_AddIndex                                        /* add index */
	AT_ReAddIndex                                      /* internal to commands/tablecmds.c */
	AT_AddConstraint                                   /* add constraint */
	AT_AddConstraintRecurse                            /* internal to commands/tablecmds.c */
	AT_ReAddConstraint                                 /* internal to commands/tablecmds.c */
	AT_AlterConstraint                                 /* alter constraint */
	AT_ValidateConstraint                              /* validate constraint */
	AT_ValidateConstraintRecurse                       /* internal to commands/tablecmds.c */
	AT_ProcessedConstraint                             /* pre-processed add constraint (local in
	 * parser/parse_utilcmd.c) */

	AT_AddIndexConstraint        /* add constraint using existing index */
	AT_DropConstraint            /* drop constraint */
	AT_DropConstraintRecurse     /* internal to commands/tablecmds.c */
	AT_ReAddComment              /* internal to commands/tablecmds.c */
	AT_AlterColumnType           /* alter column type */
	AT_AlterColumnGenericOptions /* alter column OPTIONS (...) */
	AT_ChangeOwner               /* change owner */
	AT_ClusterOn                 /* CLUSTER ON */
	AT_DropCluster               /* SET WITHOUT CLUSTER */
	AT_SetLogged                 /* SET LOGGED */
	AT_SetUnLogged               /* SET UNLOGGED */
	AT_AddOids                   /* SET WITH OIDS */
	AT_AddOidsRecurse            /* internal to commands/tablecmds.c */
	AT_DropOids                  /* SET WITHOUT OIDS */
	AT_SetTableSpace             /* SET TABLESPACE */
	AT_SetRelOptions             /* SET (...) -- AM specific parameters */
	AT_ResetRelOptions           /* RESET (...) -- AM specific parameters */
	AT_ReplaceRelOptions         /* replace reloption list in its entirety */
	AT_EnableTrig                /* ENABLE TRIGGER name */
	AT_EnableAlwaysTrig          /* ENABLE ALWAYS TRIGGER name */
	AT_EnableReplicaTrig         /* ENABLE REPLICA TRIGGER name */
	AT_DisableTrig               /* DISABLE TRIGGER name */
	AT_EnableTrigAll             /* ENABLE TRIGGER ALL */
	AT_DisableTrigAll            /* DISABLE TRIGGER ALL */
	AT_EnableTrigUser            /* ENABLE TRIGGER USER */
	AT_DisableTrigUser           /* DISABLE TRIGGER USER */
	AT_EnableRule                /* ENABLE RULE name */
	AT_EnableAlwaysRule          /* ENABLE ALWAYS RULE name */
	AT_EnableReplicaRule         /* ENABLE REPLICA RULE name */
	AT_DisableRule               /* DISABLE RULE name */
	AT_AddInherit                /* INHERIT parent */
	AT_DropInherit               /* NO INHERIT parent */
	AT_AddOf                     /* OF <type_name> */
	AT_DropOf                    /* NOT OF */
	AT_ReplicaIdentity           /* REPLICA IDENTITY */
	AT_EnableRowSecurity         /* ENABLE ROW SECURITY */
	AT_DisableRowSecurity        /* DISABLE ROW SECURITY */
	AT_ForceRowSecurity          /* FORCE ROW SECURITY */
	AT_NoForceRowSecurity        /* NO FORCE ROW SECURITY */
	AT_GenericOptions            /* OPTIONS (...) */
	AT_AttachPartition           /* ATTACH PARTITION */
	AT_DetachPartition           /* DETACH PARTITION */
	AT_AddIdentity               /* ADD IDENTITY */
	AT_SetIdentity               /* SET identity column options */
	AT_DropIdentity              /* DROP IDENTITY */
)

type AlterUserMappingStmt ¶

type AlterUserMappingStmt struct {
	User       *RoleSpec `json:"user"`       /* user role */
	Servername *string   `json:"servername"` /* server name */
	Options    List      `json:"options"`    /* generic options to server */
}

---------------------- * Create/Drop USER MAPPING Statements * ----------------------

func (AlterUserMappingStmt) Deparse ¶

func (node AlterUserMappingStmt) Deparse(ctx Context) (*string, error)

func (AlterUserMappingStmt) Fingerprint ¶

func (node AlterUserMappingStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlterUserMappingStmt) MarshalJSON ¶

func (node AlterUserMappingStmt) MarshalJSON() ([]byte, error)

func (*AlterUserMappingStmt) UnmarshalJSON ¶

func (node *AlterUserMappingStmt) UnmarshalJSON(input []byte) (err error)

type AlternativeSubPlan ¶

type AlternativeSubPlan struct {
	Xpr      Node `json:"xpr"`
	Subplans List `json:"subplans"` /* SubPlan(s) with equivalent results */
}

* AlternativeSubPlan - expression node for a choice among SubPlans * * The subplans are given as a List so that the node definition need not * change if there's ever more than two alternatives. For the moment, * though, there are always exactly two; and the first one is the fast-start * plan.

func (AlternativeSubPlan) Deparse ¶

func (node AlternativeSubPlan) Deparse(ctx Context) (*string, error)

func (AlternativeSubPlan) Fingerprint ¶

func (node AlternativeSubPlan) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (AlternativeSubPlan) MarshalJSON ¶

func (node AlternativeSubPlan) MarshalJSON() ([]byte, error)

func (*AlternativeSubPlan) UnmarshalJSON ¶

func (node *AlternativeSubPlan) UnmarshalJSON(input []byte) (err error)

type ArrayCoerceExpr ¶

type ArrayCoerceExpr struct {
	Xpr          Node         `json:"xpr"`
	Arg          Node         `json:"arg"`          /* input expression (yields an array) */
	Elemfuncid   Oid          `json:"elemfuncid"`   /* OID of element coercion function, or 0 */
	Resulttype   Oid          `json:"resulttype"`   /* output type of coercion (an array type) */
	Resulttypmod int32        `json:"resulttypmod"` /* output typmod (also element typmod) */
	Resultcollid Oid          `json:"resultcollid"` /* OID of collation, or InvalidOid if none */
	IsExplicit   bool         `json:"isExplicit"`   /* conversion semantics flag to pass to func */
	Coerceformat CoercionForm `json:"coerceformat"` /* how to display this node */
	Location     int          `json:"location"`     /* token location, or -1 if unknown */
}

---------------- * ArrayCoerceExpr * * ArrayCoerceExpr represents a type coercion from one array type to another, * which is implemented by applying the indicated element-type coercion * function to each element of the source array. If elemfuncid is InvalidOid * then the element types are binary-compatible, but the coercion still * requires some effort (we have to fix the element type ID stored in the * array header). * ----------------

func (ArrayCoerceExpr) Deparse ¶

func (node ArrayCoerceExpr) Deparse(ctx Context) (*string, error)

func (ArrayCoerceExpr) Fingerprint ¶

func (node ArrayCoerceExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ArrayCoerceExpr) MarshalJSON ¶

func (node ArrayCoerceExpr) MarshalJSON() ([]byte, error)

func (*ArrayCoerceExpr) UnmarshalJSON ¶

func (node *ArrayCoerceExpr) UnmarshalJSON(input []byte) (err error)

type ArrayExpr ¶

type ArrayExpr struct {
	Xpr           Node `json:"xpr"`
	ArrayTypeid   Oid  `json:"array_typeid"`   /* type of expression result */
	ArrayCollid   Oid  `json:"array_collid"`   /* OID of collation, or InvalidOid if none */
	ElementTypeid Oid  `json:"element_typeid"` /* common type of array elements */
	Elements      List `json:"elements"`       /* the array elements or sub-arrays */
	Multidims     bool `json:"multidims"`      /* true if elements are sub-arrays */
	Location      int  `json:"location"`       /* token location, or -1 if unknown */
}

* ArrayExpr - an ARRAY[] expression * * Note: if multidims is false, the constituent expressions all yield the * scalar type identified by element_typeid. If multidims is true, the * constituent expressions all yield arrays of element_typeid (ie, the same * type as array_typeid); at runtime we must check for compatible subscripts.

func (ArrayExpr) Deparse ¶

func (node ArrayExpr) Deparse(ctx Context) (*string, error)

func (ArrayExpr) Fingerprint ¶

func (node ArrayExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ArrayExpr) MarshalJSON ¶

func (node ArrayExpr) MarshalJSON() ([]byte, error)

func (*ArrayExpr) UnmarshalJSON ¶

func (node *ArrayExpr) UnmarshalJSON(input []byte) (err error)

type ArrayRef ¶

type ArrayRef struct {
	Xpr             Node  `json:"xpr"`
	Refarraytype    Oid   `json:"refarraytype"`    /* type of the array proper */
	Refelemtype     Oid   `json:"refelemtype"`     /* type of the array elements */
	Reftypmod       int32 `json:"reftypmod"`       /* typmod of the array (and elements too) */
	Refcollid       Oid   `json:"refcollid"`       /* OID of collation, or InvalidOid if none */
	Refupperindexpr List  `json:"refupperindexpr"` /* expressions that evaluate to upper
	 * array indexes */

	Reflowerindexpr List `json:"reflowerindexpr"` /* expressions that evaluate to lower
	 * array indexes, or NIL for single array
	 * element */

	Refexpr Node `json:"refexpr"` /* the expression that evaluates to an array
	 * value */

	Refassgnexpr Node `json:"refassgnexpr"` /* expression for the source value, or NULL if
	 * fetch */
}

---------------- * ArrayRef: describes an array subscripting operation * * An ArrayRef can describe fetching a single element from an array, * fetching a subarray (array slice), storing a single element into * an array, or storing a slice. The "store" cases work with an * initial array value and a source value that is inserted into the * appropriate part of the array; the result of the operation is an * entire new modified array value. * * If reflowerindexpr = NIL, then we are fetching or storing a single array * element at the subscripts given by refupperindexpr. Otherwise we are * fetching or storing an array slice, that is a rectangular subarray * with lower and upper bounds given by the index expressions. * reflowerindexpr must be the same length as refupperindexpr when it * is not NIL. * * In the slice case, individual expressions in the subscript lists can be * NULL, meaning "substitute the array's current lower or upper bound". * * Note: the result datatype is the element type when fetching a single * element; but it is the array type when doing subarray fetch or either * type of store. * * Note: for the cases where an array is returned, if refexpr yields a R/W * expanded array, then the implementation is allowed to modify that object * in-place and return the same object.) * ----------------

func (ArrayRef) Deparse ¶

func (node ArrayRef) Deparse(ctx Context) (*string, error)

func (ArrayRef) Fingerprint ¶

func (node ArrayRef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ArrayRef) MarshalJSON ¶

func (node ArrayRef) MarshalJSON() ([]byte, error)

func (*ArrayRef) UnmarshalJSON ¶

func (node *ArrayRef) UnmarshalJSON(input []byte) (err error)

type AttrNumber ¶

type AttrNumber int16

type BitString ¶

type BitString struct {
	Str string `json:"str"`
}

func (BitString) Deparse ¶

func (node BitString) Deparse(ctx Context) (*string, error)

func (BitString) Fingerprint ¶

func (node BitString) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (BitString) MarshalJSON ¶

func (node BitString) MarshalJSON() ([]byte, error)

func (*BitString) UnmarshalJSON ¶

func (node *BitString) UnmarshalJSON(input []byte) (err error)

type BlockId ¶

type BlockId BlockIdData

type BlockIdData ¶

type BlockIdData struct {
	BiHi uint16 `json:"bi_hi"`
	BiLo uint16 `json:"bi_lo"`
}

* BlockId: * * this is a storage type for BlockNumber. in other words, this type * is used for on-disk structures (e.g., in HeapTupleData) whereas * BlockNumber is the type on which calculations are performed (e.g., * in access method code). * * there doesn't appear to be any reason to have separate types except * for the fact that BlockIds can be SHORTALIGN'd (and therefore any * structures that contains them, such as ItemPointerData, can also be * SHORTALIGN'd). this is an important consideration for reducing the * space requirements of the line pointer (ItemIdData) array on each * page and the header of each heap or index tuple, so it doesn't seem * wise to change this without good reason.

func (BlockIdData) Deparse ¶

func (node BlockIdData) Deparse(ctx Context) (*string, error)

func (BlockIdData) Fingerprint ¶

func (node BlockIdData) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (BlockIdData) MarshalJSON ¶

func (node BlockIdData) MarshalJSON() ([]byte, error)

func (*BlockIdData) UnmarshalJSON ¶

func (node *BlockIdData) UnmarshalJSON(input []byte) (err error)

type BlockNumber ¶

type BlockNumber uint32

type BoolExpr ¶

type BoolExpr struct {
	Xpr      Node         `json:"xpr"`
	Boolop   BoolExprType `json:"boolop"`
	Args     List         `json:"args"`     /* arguments to this expression */
	Location int          `json:"location"` /* token location, or -1 if unknown */
}

func (BoolExpr) Deparse ¶

func (node BoolExpr) Deparse(ctx Context) (*string, error)

func (BoolExpr) Fingerprint ¶

func (node BoolExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (BoolExpr) MarshalJSON ¶

func (node BoolExpr) MarshalJSON() ([]byte, error)

func (*BoolExpr) UnmarshalJSON ¶

func (node *BoolExpr) UnmarshalJSON(input []byte) (err error)

type BoolExprType ¶

type BoolExprType uint

* BoolExpr - expression node for the basic Boolean operators AND, OR, NOT * * Notice the arguments are given as a List. For NOT, of course the list * must always have exactly one element. For AND and OR, there can be two * or more arguments.

const (
	AND_EXPR BoolExprType = iota
	OR_EXPR
)

type BoolTestType ¶

type BoolTestType uint

* BooleanTest * * BooleanTest represents the operation of determining whether a boolean * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations * are supported. Note that a NULL input does *not* cause a NULL result. * The appropriate test is performed and returned as a boolean Datum.

const (
	IS_TRUE BoolTestType = iota
	IS_NOT_TRUE
)

type BooleanTest ¶

type BooleanTest struct {
	Xpr          Node         `json:"xpr"`
	Arg          Node         `json:"arg"`          /* input expression */
	Booltesttype BoolTestType `json:"booltesttype"` /* test type */
	Location     int          `json:"location"`     /* token location, or -1 if unknown */
}

* BooleanTest * * BooleanTest represents the operation of determining whether a boolean * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations * are supported. Note that a NULL input does *not* cause a NULL result. * The appropriate test is performed and returned as a boolean Datum.

func (BooleanTest) Deparse ¶

func (node BooleanTest) Deparse(ctx Context) (*string, error)

func (BooleanTest) Fingerprint ¶

func (node BooleanTest) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (BooleanTest) MarshalJSON ¶

func (node BooleanTest) MarshalJSON() ([]byte, error)

func (*BooleanTest) UnmarshalJSON ¶

func (node *BooleanTest) UnmarshalJSON(input []byte) (err error)

type CaseExpr ¶

type CaseExpr struct {
	Xpr        Node `json:"xpr"`
	Casetype   Oid  `json:"casetype"`   /* type of expression result */
	Casecollid Oid  `json:"casecollid"` /* OID of collation, or InvalidOid if none */
	Arg        Node `json:"arg"`        /* implicit equality comparison argument */
	Args       List `json:"args"`       /* the arguments (list of WHEN clauses) */
	Defresult  Node `json:"defresult"`  /* the default result (ELSE clause) */
	Location   int  `json:"location"`   /* token location, or -1 if unknown */
}

----------

  • CaseExpr - a CASE expression *
  • We support two distinct forms of CASE expression:
  • CASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ]
  • CASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ]
  • These are distinguishable by the "arg" field being NULL in the first case
  • and the testexpr in the second case. *
  • In the raw grammar output for the second form, the condition expressions
  • of the WHEN clauses are just the comparison values. Parse analysis
  • converts these to valid boolean expressions of the form
  • CaseTestExpr '=' compexpr
  • where the CaseTestExpr node is a placeholder that emits the correct
  • value at runtime. This structure is used so that the testexpr need be
  • evaluated only once. Note that after parse analysis, the condition
  • expressions always yield boolean. *
  • Note: we can test whether a CaseExpr has been through parse analysis
  • yet by checking whether casetype is InvalidOid or not. *----------

func (CaseExpr) Deparse ¶

func (node CaseExpr) Deparse(ctx Context) (*string, error)

func (CaseExpr) Fingerprint ¶

func (node CaseExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CaseExpr) MarshalJSON ¶

func (node CaseExpr) MarshalJSON() ([]byte, error)

func (*CaseExpr) UnmarshalJSON ¶

func (node *CaseExpr) UnmarshalJSON(input []byte) (err error)

type CaseTestExpr ¶

type CaseTestExpr struct {
	Xpr       Node  `json:"xpr"`
	TypeId    Oid   `json:"typeId"`    /* type for substituted value */
	TypeMod   int32 `json:"typeMod"`   /* typemod for substituted value */
	Collation Oid   `json:"collation"` /* collation for the substituted value */
}

* Placeholder node for the test value to be processed by a CASE expression. * This is effectively like a Param, but can be implemented more simply * since we need only one replacement value at a time. * * We also use this in nested UPDATE expressions. * See transformAssignmentIndirection().

func (CaseTestExpr) Deparse ¶

func (node CaseTestExpr) Deparse(ctx Context) (*string, error)

func (CaseTestExpr) Fingerprint ¶

func (node CaseTestExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CaseTestExpr) MarshalJSON ¶

func (node CaseTestExpr) MarshalJSON() ([]byte, error)

func (*CaseTestExpr) UnmarshalJSON ¶

func (node *CaseTestExpr) UnmarshalJSON(input []byte) (err error)

type CaseWhen ¶

type CaseWhen struct {
	Xpr      Node `json:"xpr"`
	Expr     Node `json:"expr"`     /* condition expression */
	Result   Node `json:"result"`   /* substitution result */
	Location int  `json:"location"` /* token location, or -1 if unknown */
}

* CaseWhen - one arm of a CASE expression

func (CaseWhen) Deparse ¶

func (node CaseWhen) Deparse(ctx Context) (*string, error)

func (CaseWhen) Fingerprint ¶

func (node CaseWhen) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CaseWhen) MarshalJSON ¶

func (node CaseWhen) MarshalJSON() ([]byte, error)

func (*CaseWhen) UnmarshalJSON ¶

func (node *CaseWhen) UnmarshalJSON(input []byte) (err error)

type CheckPointStmt ¶

type CheckPointStmt struct {
}

---------------------- * Checkpoint Statement * ----------------------

func (CheckPointStmt) Deparse ¶

func (node CheckPointStmt) Deparse(ctx Context) (*string, error)

func (CheckPointStmt) Fingerprint ¶

func (node CheckPointStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CheckPointStmt) MarshalJSON ¶

func (node CheckPointStmt) MarshalJSON() ([]byte, error)

func (*CheckPointStmt) UnmarshalJSON ¶

func (node *CheckPointStmt) UnmarshalJSON(input []byte) (err error)

type ClosePortalStmt ¶

type ClosePortalStmt struct {
	Portalname *string `json:"portalname"` /* name of the portal (cursor) */

}

---------------------- * Close Portal Statement * ----------------------

func (ClosePortalStmt) Deparse ¶

func (node ClosePortalStmt) Deparse(ctx Context) (*string, error)

func (ClosePortalStmt) Fingerprint ¶

func (node ClosePortalStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ClosePortalStmt) MarshalJSON ¶

func (node ClosePortalStmt) MarshalJSON() ([]byte, error)

func (*ClosePortalStmt) UnmarshalJSON ¶

func (node *ClosePortalStmt) UnmarshalJSON(input []byte) (err error)

type ClusterStmt ¶

type ClusterStmt struct {
	Relation  *RangeVar `json:"relation"`  /* relation being indexed, or NULL if all */
	Indexname *string   `json:"indexname"` /* original index defined */
	Verbose   bool      `json:"verbose"`   /* print progress info */
}

---------------------- * Cluster Statement (support pbrown's cluster index implementation) * ----------------------

func (ClusterStmt) Deparse ¶

func (node ClusterStmt) Deparse(ctx Context) (*string, error)

func (ClusterStmt) Fingerprint ¶

func (node ClusterStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ClusterStmt) MarshalJSON ¶

func (node ClusterStmt) MarshalJSON() ([]byte, error)

func (*ClusterStmt) UnmarshalJSON ¶

func (node *ClusterStmt) UnmarshalJSON(input []byte) (err error)

type CmdType ¶

type CmdType uint

* CmdType - * enums for type of operation represented by a Query or PlannedStmt * * This is needed in both parsenodes.h and plannodes.h, so put it here...

const (
	CMD_UNKNOWN CmdType = iota
	CMD_SELECT          /* select stmt */
	CMD_UPDATE          /* update stmt */
	CMD_INSERT          /* insert stmt */
	CMD_DELETE
	CMD_UTILITY /* cmds like create, destroy, copy, vacuum,
	 * etc. */

	CMD_NOTHING /* dummy command for instead nothing rules
	 * with qual */
)

type CoalesceExpr ¶

type CoalesceExpr struct {
	Xpr            Node `json:"xpr"`
	Coalescetype   Oid  `json:"coalescetype"`   /* type of expression result */
	Coalescecollid Oid  `json:"coalescecollid"` /* OID of collation, or InvalidOid if none */
	Args           List `json:"args"`           /* the arguments */
	Location       int  `json:"location"`       /* token location, or -1 if unknown */
}

* CoalesceExpr - a COALESCE expression

func (CoalesceExpr) Deparse ¶

func (node CoalesceExpr) Deparse(ctx Context) (*string, error)

func (CoalesceExpr) Fingerprint ¶

func (node CoalesceExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CoalesceExpr) MarshalJSON ¶

func (node CoalesceExpr) MarshalJSON() ([]byte, error)

func (*CoalesceExpr) UnmarshalJSON ¶

func (node *CoalesceExpr) UnmarshalJSON(input []byte) (err error)

type CoerceToDomain ¶

type CoerceToDomain struct {
	Xpr            Node         `json:"xpr"`
	Arg            Node         `json:"arg"`            /* input expression */
	Resulttype     Oid          `json:"resulttype"`     /* domain type ID (result type) */
	Resulttypmod   int32        `json:"resulttypmod"`   /* output typmod (currently always -1) */
	Resultcollid   Oid          `json:"resultcollid"`   /* OID of collation, or InvalidOid if none */
	Coercionformat CoercionForm `json:"coercionformat"` /* how to display this node */
	Location       int          `json:"location"`       /* token location, or -1 if unknown */
}

* CoerceToDomain * * CoerceToDomain represents the operation of coercing a value to a domain * type. At runtime (and not before) the precise set of constraints to be * checked will be determined. If the value passes, it is returned as the * result; if not, an error is raised. Note that this is equivalent to * RelabelType in the scenario where no constraints are applied.

func (CoerceToDomain) Deparse ¶

func (node CoerceToDomain) Deparse(ctx Context) (*string, error)

func (CoerceToDomain) Fingerprint ¶

func (node CoerceToDomain) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CoerceToDomain) MarshalJSON ¶

func (node CoerceToDomain) MarshalJSON() ([]byte, error)

func (*CoerceToDomain) UnmarshalJSON ¶

func (node *CoerceToDomain) UnmarshalJSON(input []byte) (err error)

type CoerceToDomainValue ¶

type CoerceToDomainValue struct {
	Xpr       Node  `json:"xpr"`
	TypeId    Oid   `json:"typeId"`    /* type for substituted value */
	TypeMod   int32 `json:"typeMod"`   /* typemod for substituted value */
	Collation Oid   `json:"collation"` /* collation for the substituted value */
	Location  int   `json:"location"`  /* token location, or -1 if unknown */
}

* Placeholder node for the value to be processed by a domain's check * constraint. This is effectively like a Param, but can be implemented more * simply since we need only one replacement value at a time. * * Note: the typeId/typeMod/collation will be set from the domain's base type, * not the domain itself. This is because we shouldn't consider the value * to be a member of the domain if we haven't yet checked its constraints.

func (CoerceToDomainValue) Deparse ¶

func (node CoerceToDomainValue) Deparse(ctx Context) (*string, error)

func (CoerceToDomainValue) Fingerprint ¶

func (node CoerceToDomainValue) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CoerceToDomainValue) MarshalJSON ¶

func (node CoerceToDomainValue) MarshalJSON() ([]byte, error)

func (*CoerceToDomainValue) UnmarshalJSON ¶

func (node *CoerceToDomainValue) UnmarshalJSON(input []byte) (err error)

type CoerceViaIO ¶

type CoerceViaIO struct {
	Xpr        Node `json:"xpr"`
	Arg        Node `json:"arg"`        /* input expression */
	Resulttype Oid  `json:"resulttype"` /* output type of coercion */

	/* output typmod is not stored, but is presumed -1 */
	Resultcollid Oid          `json:"resultcollid"` /* OID of collation, or InvalidOid if none */
	Coerceformat CoercionForm `json:"coerceformat"` /* how to display this node */
	Location     int          `json:"location"`     /* token location, or -1 if unknown */
}

---------------- * CoerceViaIO * * CoerceViaIO represents a type coercion between two types whose textual * representations are compatible, implemented by invoking the source type's * typoutput function then the destination type's typinput function. * ----------------

func (CoerceViaIO) Deparse ¶

func (node CoerceViaIO) Deparse(ctx Context) (*string, error)

func (CoerceViaIO) Fingerprint ¶

func (node CoerceViaIO) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CoerceViaIO) MarshalJSON ¶

func (node CoerceViaIO) MarshalJSON() ([]byte, error)

func (*CoerceViaIO) UnmarshalJSON ¶

func (node *CoerceViaIO) UnmarshalJSON(input []byte) (err error)

type CoercionContext ¶

type CoercionContext uint

* CoercionContext - distinguishes the allowed set of type casts * * NB: ordering of the alternatives is significant; later (larger) values * allow more casts than earlier ones.

const (
	COERCION_IMPLICIT   CoercionContext = iota /* coercion in context of expression */
	COERCION_ASSIGNMENT                        /* coercion in context of assignment */
	COERCION_EXPLICIT                          /* explicit cast operation */
)

type CoercionForm ¶

type CoercionForm uint

* CoercionForm - how to display a node that could have come from a cast * * NB: equal() ignores CoercionForm fields, therefore this *must* not carry * any semantically significant information. We need that behavior so that * the planner will consider equivalent implicit and explicit casts to be * equivalent. In cases where those actually behave differently, the coercion * function's arguments will be different.

const (
	COERCE_EXPLICIT_CALL CoercionForm = iota /* display as a function call */
	COERCE_EXPLICIT_CAST                     /* display as an explicit cast */
	COERCE_IMPLICIT_CAST                     /* implicit cast, so hide it */
)

type CollateClause ¶

type CollateClause struct {
	Arg      Node `json:"arg"`      /* input expression */
	Collname List `json:"collname"` /* possibly-qualified collation name */
	Location int  `json:"location"` /* token location, or -1 if unknown */
}

* CollateClause - a COLLATE expression

func (CollateClause) Deparse ¶

func (node CollateClause) Deparse(ctx Context) (*string, error)

func (CollateClause) Fingerprint ¶

func (node CollateClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CollateClause) MarshalJSON ¶

func (node CollateClause) MarshalJSON() ([]byte, error)

func (*CollateClause) UnmarshalJSON ¶

func (node *CollateClause) UnmarshalJSON(input []byte) (err error)

type CollateExpr ¶

type CollateExpr struct {
	Xpr      Node `json:"xpr"`
	Arg      Node `json:"arg"`      /* input expression */
	CollOid  Oid  `json:"collOid"`  /* collation's OID */
	Location int  `json:"location"` /* token location, or -1 if unknown */
}

----------

  • CollateExpr - COLLATE *
  • The planner replaces CollateExpr with RelabelType during expression
  • preprocessing, so execution never sees a CollateExpr. *----------

func (CollateExpr) Deparse ¶

func (node CollateExpr) Deparse(ctx Context) (*string, error)

func (CollateExpr) Fingerprint ¶

func (node CollateExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CollateExpr) MarshalJSON ¶

func (node CollateExpr) MarshalJSON() ([]byte, error)

func (*CollateExpr) UnmarshalJSON ¶

func (node *CollateExpr) UnmarshalJSON(input []byte) (err error)

type ColumnDef ¶

type ColumnDef struct {
	Colname       *string        `json:"colname"`        /* name of column */
	TypeName      *TypeName      `json:"typeName"`       /* type of column */
	Inhcount      int            `json:"inhcount"`       /* number of times column is inherited */
	IsLocal       bool           `json:"is_local"`       /* column has local (non-inherited) def'n */
	IsNotNull     bool           `json:"is_not_null"`    /* NOT NULL constraint specified? */
	IsFromType    bool           `json:"is_from_type"`   /* column definition came from table type */
	IsFromParent  bool           `json:"is_from_parent"` /* column def came from partition parent */
	Storage       byte           `json:"storage"`        /* attstorage setting, or 0 for default */
	RawDefault    Node           `json:"raw_default"`    /* default value (untransformed parse tree) */
	CookedDefault Node           `json:"cooked_default"` /* default value (transformed expr tree) */
	Identity      byte           `json:"identity"`       /* attidentity setting */
	CollClause    *CollateClause `json:"collClause"`     /* untransformed COLLATE spec, if any */
	CollOid       Oid            `json:"collOid"`        /* collation OID (InvalidOid if not set) */
	Constraints   List           `json:"constraints"`    /* other constraints on column */
	Fdwoptions    List           `json:"fdwoptions"`     /* per-column FDW options */
	Location      int            `json:"location"`       /* parse location, or -1 if none/unknown */
}

* ColumnDef - column definition (used in various creates) * * If the column has a default value, we may have the value expression * in either "raw" form (an untransformed parse tree) or "cooked" form * (a post-parse-analysis, executable expression tree), depending on * how this ColumnDef node was created (by parsing, or by inheritance * from an existing relation). We should never have both in the same node! * * Similarly, we may have a COLLATE specification in either raw form * (represented as a CollateClause with arg==NULL) or cooked form * (the collation's OID). * * The constraints list may contain a CONSTR_DEFAULT item in a raw * parsetree produced by gram.y, but transformCreateStmt will remove * the item and set raw_default instead. CONSTR_DEFAULT items * should not appear in any subsequent processing.

func (ColumnDef) Deparse ¶

func (node ColumnDef) Deparse(ctx Context) (*string, error)

func (ColumnDef) Fingerprint ¶

func (node ColumnDef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ColumnDef) MarshalJSON ¶

func (node ColumnDef) MarshalJSON() ([]byte, error)

func (*ColumnDef) UnmarshalJSON ¶

func (node *ColumnDef) UnmarshalJSON(input []byte) (err error)

type ColumnRef ¶

type ColumnRef struct {
	Fields   List `json:"fields"`   /* field names (Value strings) or A_Star */
	Location int  `json:"location"` /* token location, or -1 if unknown */
}

* ColumnRef - specifies a reference to a column, or possibly a whole tuple * * The "fields" list must be nonempty. It can contain string Value nodes * (representing names) and A_Star nodes (representing occurrence of a '*'). * Currently, A_Star must appear only as the last list element --- the grammar * is responsible for enforcing this! * * Note: any array subscripting or selection of fields from composite columns * is represented by an A_Indirection node above the ColumnRef. However, * for simplicity in the normal case, initial field selection from a table * name is represented within ColumnRef and not by adding A_Indirection.

func (ColumnRef) Deparse ¶

func (node ColumnRef) Deparse(ctx Context) (*string, error)

func (ColumnRef) Fingerprint ¶

func (node ColumnRef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ColumnRef) MarshalJSON ¶

func (node ColumnRef) MarshalJSON() ([]byte, error)

func (*ColumnRef) UnmarshalJSON ¶

func (node *ColumnRef) UnmarshalJSON(input []byte) (err error)

type CommandId ¶

type CommandId uint32

type CommentStmt ¶

type CommentStmt struct {
	Objtype ObjectType `json:"objtype"` /* Object's type */
	Object  Node       `json:"object"`  /* Qualified name of the object */
	Comment *string    `json:"comment"` /* Comment to insert, or NULL to remove */
}

---------------------- * Comment On Statement * ----------------------

func (CommentStmt) Deparse ¶

func (node CommentStmt) Deparse(ctx Context) (*string, error)

func (CommentStmt) Fingerprint ¶

func (node CommentStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CommentStmt) MarshalJSON ¶

func (node CommentStmt) MarshalJSON() ([]byte, error)

func (*CommentStmt) UnmarshalJSON ¶

func (node *CommentStmt) UnmarshalJSON(input []byte) (err error)

type CommonTableExpr ¶

type CommonTableExpr struct {
	Ctename       *string `json:"ctename"`       /* query name (never qualified) */
	Aliascolnames List    `json:"aliascolnames"` /* optional list of column names */

	/* SelectStmt/InsertStmt/etc before parse analysis, Query afterwards: */
	Ctequery Node `json:"ctequery"` /* the CTE's subquery */
	Location int  `json:"location"` /* token location, or -1 if unknown */

	/* These fields are set during parse analysis: */
	Cterecursive bool `json:"cterecursive"` /* is this CTE actually recursive? */
	Cterefcount  int  `json:"cterefcount"`  /* number of RTEs referencing this CTE
	 * (excluding internal self-references) */

	Ctecolnames      List `json:"ctecolnames"`      /* list of output column names */
	Ctecoltypes      List `json:"ctecoltypes"`      /* OID list of output column type OIDs */
	Ctecoltypmods    List `json:"ctecoltypmods"`    /* integer list of output column typmods */
	Ctecolcollations List `json:"ctecolcollations"` /* OID list of column collation OIDs */
}

* CommonTableExpr - * representation of WITH list element * * We don't currently support the SEARCH or CYCLE clause.

func (CommonTableExpr) Deparse ¶

func (node CommonTableExpr) Deparse(ctx Context) (*string, error)

func (CommonTableExpr) Fingerprint ¶

func (node CommonTableExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CommonTableExpr) MarshalJSON ¶

func (node CommonTableExpr) MarshalJSON() ([]byte, error)

func (*CommonTableExpr) UnmarshalJSON ¶

func (node *CommonTableExpr) UnmarshalJSON(input []byte) (err error)

type CompositeTypeStmt ¶

type CompositeTypeStmt struct {
	Typevar    *RangeVar `json:"typevar"`    /* the composite type to be created */
	Coldeflist List      `json:"coldeflist"` /* list of ColumnDef nodes */
}

---------------------- * Create Type Statement, composite types * ----------------------

func (CompositeTypeStmt) Deparse ¶

func (node CompositeTypeStmt) Deparse(ctx Context) (*string, error)

func (CompositeTypeStmt) Fingerprint ¶

func (node CompositeTypeStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CompositeTypeStmt) MarshalJSON ¶

func (node CompositeTypeStmt) MarshalJSON() ([]byte, error)

func (*CompositeTypeStmt) UnmarshalJSON ¶

func (node *CompositeTypeStmt) UnmarshalJSON(input []byte) (err error)

type Const ¶

type Const struct {
	Xpr         Node  `json:"xpr"`
	Consttype   Oid   `json:"consttype"`   /* pg_type OID of the constant's datatype */
	Consttypmod int32 `json:"consttypmod"` /* typmod value, if any */
	Constcollid Oid   `json:"constcollid"` /* OID of collation, or InvalidOid if none */
	Constlen    int   `json:"constlen"`    /* typlen of the constant's datatype */
	Constvalue  Datum `json:"constvalue"`  /* the constant's value */
	Constisnull bool  `json:"constisnull"` /* whether the constant is null (if true,
	 * constvalue is undefined) */

	Constbyval bool `json:"constbyval"` /* whether this datatype is passed by value.
	 * If true, then all the information is stored
	 * in the Datum. If false, then the Datum
	 * contains a pointer to the information. */

	Location int `json:"location"` /* token location, or -1 if unknown */
}

* Const * * Note: for varlena data types, we make a rule that a Const node's value * must be in non-extended form (4-byte header, no compression or external * references). This ensures that the Const node is self-contained and makes * it more likely that equal() will see logically identical values as equal.

func (Const) Deparse ¶

func (node Const) Deparse(ctx Context) (*string, error)

func (Const) Fingerprint ¶

func (node Const) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Const) MarshalJSON ¶

func (node Const) MarshalJSON() ([]byte, error)

func (*Const) UnmarshalJSON ¶

func (node *Const) UnmarshalJSON(input []byte) (err error)

type ConstrType ¶

type ConstrType uint

---------- * Definitions for constraints in CreateStmt * * Note that column defaults are treated as a type of constraint, * even though that's a bit odd semantically. * * For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT) * we may have the expression in either "raw" form (an untransformed * parse tree) or "cooked" form (the nodeToString representation of * an executable expression tree), depending on how this Constraint * node was created (by parsing, or by inheritance from an existing * relation). We should never have both in the same node! * * FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are * stored into pg_constraint.confmatchtype. Changing the code values may * require an initdb! * * If skip_validation is true then we skip checking that the existing rows * in the table satisfy the constraint, and just install the catalog entries * for the constraint. A new FK constraint is marked as valid iff * initially_valid is true. (Usually skip_validation and initially_valid * are inverses, but we can set both true if the table is known empty.) * * Constraint attributes (DEFERRABLE etc) are initially represented as * separate Constraint nodes for simplicity of parsing. parse_utilcmd.c makes * a pass through the constraints list to insert the info into the appropriate * Constraint node. * ----------

const (
	CONSTR_NULL ConstrType = iota /* not standard SQL, but a lot of people
	 * expect it */

	CONSTR_NOTNULL
	CONSTR_DEFAULT
	CONSTR_IDENTITY
	CONSTR_CHECK
	CONSTR_PRIMARY
	CONSTR_UNIQUE
	CONSTR_EXCLUSION
	CONSTR_FOREIGN
	CONSTR_ATTR_DEFERRABLE /* attributes for previous constraint node */
	CONSTR_ATTR_NOT_DEFERRABLE
	CONSTR_ATTR_DEFERRED
	CONSTR_ATTR_IMMEDIATE
)

type Constraint ¶

type Constraint struct {
	Contype ConstrType `json:"contype"` /* see above */

	/* Fields used for most/all constraint types: */
	Conname      *string `json:"conname"`      /* Constraint name, or NULL if unnamed */
	Deferrable   bool    `json:"deferrable"`   /* DEFERRABLE? */
	Initdeferred bool    `json:"initdeferred"` /* INITIALLY DEFERRED? */
	Location     int     `json:"location"`     /* token location, or -1 if unknown */

	/* Fields used for constraints with expressions (CHECK and DEFAULT): */
	IsNoInherit   bool    `json:"is_no_inherit"` /* is constraint non-inheritable? */
	RawExpr       Node    `json:"raw_expr"`      /* expr, as untransformed parse tree */
	CookedExpr    *string `json:"cooked_expr"`   /* expr, as nodeToString representation */
	GeneratedWhen byte    `json:"generated_when"`

	/* Fields used for unique constraints (UNIQUE and PRIMARY KEY): */
	Keys List `json:"keys"` /* String nodes naming referenced column(s) */

	/* Fields used for EXCLUSION constraints: */
	Exclusions List `json:"exclusions"` /* list of (IndexElem, operator name) pairs */

	/* Fields used for index constraints (UNIQUE, PRIMARY KEY, EXCLUSION): */
	Options    List    `json:"options"`    /* options from WITH clause */
	Indexname  *string `json:"indexname"`  /* existing index to use; otherwise NULL */
	Indexspace *string `json:"indexspace"` /* index tablespace; NULL for default */

	/* These could be, but currently are not, used for UNIQUE/PKEY: */
	AccessMethod *string `json:"access_method"` /* index access method; NULL for default */
	WhereClause  Node    `json:"where_clause"`  /* partial index predicate */

	/* Fields used for FOREIGN KEY constraints: */
	Pktable       *RangeVar `json:"pktable"`         /* Primary key table */
	FkAttrs       List      `json:"fk_attrs"`        /* Attributes of foreign key */
	PkAttrs       List      `json:"pk_attrs"`        /* Corresponding attrs in PK table */
	FkMatchtype   byte      `json:"fk_matchtype"`    /* FULL, PARTIAL, SIMPLE */
	FkUpdAction   byte      `json:"fk_upd_action"`   /* ON UPDATE action */
	FkDelAction   byte      `json:"fk_del_action"`   /* ON DELETE action */
	OldConpfeqop  List      `json:"old_conpfeqop"`   /* pg_constraint.conpfeqop of my former self */
	OldPktableOid Oid       `json:"old_pktable_oid"` /* pg_constraint.confrelid of my former
	 * self */

	/* Fields used for constraints that allow a NOT VALID specification */
	SkipValidation bool `json:"skip_validation"` /* skip validation of existing rows? */
	InitiallyValid bool `json:"initially_valid"` /* mark the new constraint as valid? */
}

Foreign key matchtype codes

func (Constraint) Deparse ¶

func (node Constraint) Deparse(ctx Context) (*string, error)

func (Constraint) Fingerprint ¶

func (node Constraint) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Constraint) MarshalJSON ¶

func (node Constraint) MarshalJSON() ([]byte, error)

func (*Constraint) UnmarshalJSON ¶

func (node *Constraint) UnmarshalJSON(input []byte) (err error)

type ConstraintsSetStmt ¶

type ConstraintsSetStmt struct {
	Constraints List `json:"constraints"` /* List of names as RangeVars */
	Deferred    bool `json:"deferred"`
}

---------------------- * SET CONSTRAINTS Statement * ----------------------

func (ConstraintsSetStmt) Deparse ¶

func (node ConstraintsSetStmt) Deparse(ctx Context) (*string, error)

func (ConstraintsSetStmt) Fingerprint ¶

func (node ConstraintsSetStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ConstraintsSetStmt) MarshalJSON ¶

func (node ConstraintsSetStmt) MarshalJSON() ([]byte, error)

func (*ConstraintsSetStmt) UnmarshalJSON ¶

func (node *ConstraintsSetStmt) UnmarshalJSON(input []byte) (err error)

type ConvertRowtypeExpr ¶

type ConvertRowtypeExpr struct {
	Xpr        Node `json:"xpr"`
	Arg        Node `json:"arg"`        /* input expression */
	Resulttype Oid  `json:"resulttype"` /* output type (always a composite type) */

	/* Like RowExpr, we deliberately omit a typmod and collation here */
	Convertformat CoercionForm `json:"convertformat"` /* how to display this node */
	Location      int          `json:"location"`      /* token location, or -1 if unknown */
}

---------------- * ConvertRowtypeExpr * * ConvertRowtypeExpr represents a type coercion from one composite type * to another, where the source type is guaranteed to contain all the columns * needed for the destination type plus possibly others; the columns need not * be in the same positions, but are matched up by name. This is primarily * used to convert a whole-row value of an inheritance child table into a * valid whole-row value of its parent table's rowtype. * ----------------

func (ConvertRowtypeExpr) Deparse ¶

func (node ConvertRowtypeExpr) Deparse(ctx Context) (*string, error)

func (ConvertRowtypeExpr) Fingerprint ¶

func (node ConvertRowtypeExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ConvertRowtypeExpr) MarshalJSON ¶

func (node ConvertRowtypeExpr) MarshalJSON() ([]byte, error)

func (*ConvertRowtypeExpr) UnmarshalJSON ¶

func (node *ConvertRowtypeExpr) UnmarshalJSON(input []byte) (err error)

type CopyStmt ¶

type CopyStmt struct {
	Relation *RangeVar `json:"relation"` /* the relation to copy */
	Query    Node      `json:"query"`    /* the query (SELECT or DML statement with
	 * RETURNING) to copy, as a raw parse tree */

	Attlist List `json:"attlist"` /* List of column names (as Strings), or NIL
	 * for all columns */

	IsFrom    bool    `json:"is_from"`    /* TO or FROM */
	IsProgram bool    `json:"is_program"` /* is 'filename' a program to popen? */
	Filename  *string `json:"filename"`   /* filename, or NULL for STDIN/STDOUT */
	Options   List    `json:"options"`    /* List of DefElem nodes */
}

---------------------- * Copy Statement * * We support "COPY relation FROM file", "COPY relation TO file", and * "COPY (query) TO file". In any given CopyStmt, exactly one of "relation" * and "query" must be non-NULL. * ----------------------

func (CopyStmt) Deparse ¶

func (node CopyStmt) Deparse(ctx Context) (*string, error)

func (CopyStmt) Fingerprint ¶

func (node CopyStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CopyStmt) MarshalJSON ¶

func (node CopyStmt) MarshalJSON() ([]byte, error)

func (*CopyStmt) UnmarshalJSON ¶

func (node *CopyStmt) UnmarshalJSON(input []byte) (err error)

type Cost ¶

type Cost float64

type CreateAmStmt ¶

type CreateAmStmt struct {
	Amname      *string `json:"amname"`       /* access method name */
	HandlerName List    `json:"handler_name"` /* handler function name */
	Amtype      byte    `json:"amtype"`       /* type of access method */
}

----------------------

  • Create ACCESS METHOD Statement *----------------------

func (CreateAmStmt) Deparse ¶

func (node CreateAmStmt) Deparse(ctx Context) (*string, error)

func (CreateAmStmt) Fingerprint ¶

func (node CreateAmStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateAmStmt) MarshalJSON ¶

func (node CreateAmStmt) MarshalJSON() ([]byte, error)

func (*CreateAmStmt) UnmarshalJSON ¶

func (node *CreateAmStmt) UnmarshalJSON(input []byte) (err error)

type CreateCastStmt ¶

type CreateCastStmt struct {
	Sourcetype *TypeName       `json:"sourcetype"`
	Targettype *TypeName       `json:"targettype"`
	Func       *ObjectWithArgs `json:"func"`
	Context    CoercionContext `json:"context"`
	Inout      bool            `json:"inout"`
}

---------------------- * CREATE CAST Statement * ----------------------

func (CreateCastStmt) Deparse ¶

func (node CreateCastStmt) Deparse(ctx Context) (*string, error)

func (CreateCastStmt) Fingerprint ¶

func (node CreateCastStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateCastStmt) MarshalJSON ¶

func (node CreateCastStmt) MarshalJSON() ([]byte, error)

func (*CreateCastStmt) UnmarshalJSON ¶

func (node *CreateCastStmt) UnmarshalJSON(input []byte) (err error)

type CreateConversionStmt ¶

type CreateConversionStmt struct {
	ConversionName  List    `json:"conversion_name"`   /* Name of the conversion */
	ForEncodingName *string `json:"for_encoding_name"` /* source encoding name */
	ToEncodingName  *string `json:"to_encoding_name"`  /* destination encoding name */
	FuncName        List    `json:"func_name"`         /* qualified conversion function name */
	Def             bool    `json:"def"`               /* is this a default conversion? */
}

---------------------- * CREATE CONVERSION Statement * ----------------------

func (CreateConversionStmt) Deparse ¶

func (node CreateConversionStmt) Deparse(ctx Context) (*string, error)

func (CreateConversionStmt) Fingerprint ¶

func (node CreateConversionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateConversionStmt) MarshalJSON ¶

func (node CreateConversionStmt) MarshalJSON() ([]byte, error)

func (*CreateConversionStmt) UnmarshalJSON ¶

func (node *CreateConversionStmt) UnmarshalJSON(input []byte) (err error)

type CreateDomainStmt ¶

type CreateDomainStmt struct {
	Domainname  List           `json:"domainname"`  /* qualified name (list of Value strings) */
	TypeName    *TypeName      `json:"typeName"`    /* the base type */
	CollClause  *CollateClause `json:"collClause"`  /* untransformed COLLATE spec, if any */
	Constraints List           `json:"constraints"` /* constraints (list of Constraint nodes) */
}

---------------------- * Create Domain Statement * ----------------------

func (CreateDomainStmt) Deparse ¶

func (node CreateDomainStmt) Deparse(ctx Context) (*string, error)

func (CreateDomainStmt) Fingerprint ¶

func (node CreateDomainStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateDomainStmt) MarshalJSON ¶

func (node CreateDomainStmt) MarshalJSON() ([]byte, error)

func (*CreateDomainStmt) UnmarshalJSON ¶

func (node *CreateDomainStmt) UnmarshalJSON(input []byte) (err error)

type CreateEnumStmt ¶

type CreateEnumStmt struct {
	TypeName List `json:"typeName"` /* qualified name (list of Value strings) */
	Vals     List `json:"vals"`     /* enum values (list of Value strings) */
}

---------------------- * Create Type Statement, enum types * ----------------------

func (CreateEnumStmt) Deparse ¶

func (node CreateEnumStmt) Deparse(ctx Context) (*string, error)

func (CreateEnumStmt) Fingerprint ¶

func (node CreateEnumStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateEnumStmt) MarshalJSON ¶

func (node CreateEnumStmt) MarshalJSON() ([]byte, error)

func (*CreateEnumStmt) UnmarshalJSON ¶

func (node *CreateEnumStmt) UnmarshalJSON(input []byte) (err error)

type CreateEventTrigStmt ¶

type CreateEventTrigStmt struct {
	Trigname   *string `json:"trigname"`   /* TRIGGER's name */
	Eventname  *string `json:"eventname"`  /* event's identifier */
	Whenclause List    `json:"whenclause"` /* list of DefElems indicating filtering */
	Funcname   List    `json:"funcname"`   /* qual. name of function to call */
}

---------------------- * Create EVENT TRIGGER Statement * ----------------------

func (CreateEventTrigStmt) Deparse ¶

func (node CreateEventTrigStmt) Deparse(ctx Context) (*string, error)

func (CreateEventTrigStmt) Fingerprint ¶

func (node CreateEventTrigStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateEventTrigStmt) MarshalJSON ¶

func (node CreateEventTrigStmt) MarshalJSON() ([]byte, error)

func (*CreateEventTrigStmt) UnmarshalJSON ¶

func (node *CreateEventTrigStmt) UnmarshalJSON(input []byte) (err error)

type CreateExtensionStmt ¶

type CreateExtensionStmt struct {
	Extname     *string `json:"extname"`
	IfNotExists bool    `json:"if_not_exists"` /* just do nothing if it already exists? */
	Options     List    `json:"options"`       /* List of DefElem nodes */
}

---------------------- * Create/Alter Extension Statements * ----------------------

func (CreateExtensionStmt) Deparse ¶

func (node CreateExtensionStmt) Deparse(ctx Context) (*string, error)

func (CreateExtensionStmt) Fingerprint ¶

func (node CreateExtensionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateExtensionStmt) MarshalJSON ¶

func (node CreateExtensionStmt) MarshalJSON() ([]byte, error)

func (*CreateExtensionStmt) UnmarshalJSON ¶

func (node *CreateExtensionStmt) UnmarshalJSON(input []byte) (err error)

type CreateFdwStmt ¶

type CreateFdwStmt struct {
	Fdwname     *string `json:"fdwname"`      /* foreign-data wrapper name */
	FuncOptions List    `json:"func_options"` /* HANDLER/VALIDATOR options */
	Options     List    `json:"options"`      /* generic options to FDW */
}

---------------------- * Create/Alter FOREIGN DATA WRAPPER Statements * ----------------------

func (CreateFdwStmt) Deparse ¶

func (node CreateFdwStmt) Deparse(ctx Context) (*string, error)

func (CreateFdwStmt) Fingerprint ¶

func (node CreateFdwStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateFdwStmt) MarshalJSON ¶

func (node CreateFdwStmt) MarshalJSON() ([]byte, error)

func (*CreateFdwStmt) UnmarshalJSON ¶

func (node *CreateFdwStmt) UnmarshalJSON(input []byte) (err error)

type CreateForeignServerStmt ¶

type CreateForeignServerStmt struct {
	Servername  *string `json:"servername"`    /* server name */
	Servertype  *string `json:"servertype"`    /* optional server type */
	Version     *string `json:"version"`       /* optional server version */
	Fdwname     *string `json:"fdwname"`       /* FDW name */
	IfNotExists bool    `json:"if_not_exists"` /* just do nothing if it already exists? */
	Options     List    `json:"options"`       /* generic options to server */
}

---------------------- * Create/Alter FOREIGN SERVER Statements * ----------------------

func (CreateForeignServerStmt) Deparse ¶

func (node CreateForeignServerStmt) Deparse(ctx Context) (*string, error)

func (CreateForeignServerStmt) Fingerprint ¶

func (node CreateForeignServerStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateForeignServerStmt) MarshalJSON ¶

func (node CreateForeignServerStmt) MarshalJSON() ([]byte, error)

func (*CreateForeignServerStmt) UnmarshalJSON ¶

func (node *CreateForeignServerStmt) UnmarshalJSON(input []byte) (err error)

type CreateForeignTableStmt ¶

type CreateForeignTableStmt struct {
	Base       CreateStmt `json:"base"`
	Servername *string    `json:"servername"`
	Options    List       `json:"options"`
}

---------------------- * Create FOREIGN TABLE Statement * ----------------------

func (CreateForeignTableStmt) Deparse ¶

func (node CreateForeignTableStmt) Deparse(ctx Context) (*string, error)

func (CreateForeignTableStmt) Fingerprint ¶

func (node CreateForeignTableStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateForeignTableStmt) MarshalJSON ¶

func (node CreateForeignTableStmt) MarshalJSON() ([]byte, error)

func (*CreateForeignTableStmt) UnmarshalJSON ¶

func (node *CreateForeignTableStmt) UnmarshalJSON(input []byte) (err error)

type CreateFunctionStmt ¶

type CreateFunctionStmt struct {
	Replace    bool      `json:"replace"`    /* T => replace if already exists */
	Funcname   List      `json:"funcname"`   /* qualified name of function to create */
	Parameters List      `json:"parameters"` /* a list of FunctionParameter */
	ReturnType *TypeName `json:"returnType"` /* the return type */
	Options    List      `json:"options"`    /* a list of DefElem */
	WithClause List      `json:"withClause"` /* a list of DefElem */
}

---------------------- * Create Function Statement * ----------------------

func (CreateFunctionStmt) Deparse ¶

func (node CreateFunctionStmt) Deparse(ctx Context) (*string, error)

func (CreateFunctionStmt) Fingerprint ¶

func (node CreateFunctionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateFunctionStmt) MarshalJSON ¶

func (node CreateFunctionStmt) MarshalJSON() ([]byte, error)

func (*CreateFunctionStmt) UnmarshalJSON ¶

func (node *CreateFunctionStmt) UnmarshalJSON(input []byte) (err error)

type CreateOpClassItem ¶

type CreateOpClassItem struct {
	Itemtype    int             `json:"itemtype"`     /* see codes above */
	Name        *ObjectWithArgs `json:"name"`         /* operator or function name and args */
	Number      int             `json:"number"`       /* strategy num or support proc num */
	OrderFamily List            `json:"order_family"` /* only used for ordering operators */
	ClassArgs   List            `json:"class_args"`   /* amproclefttype/amprocrighttype or
	 * amoplefttype/amoprighttype */

	/* fields used for a storagetype item: */
	Storedtype *TypeName `json:"storedtype"` /* datatype stored in index */
}

---------------------- * Create Operator Class Statement * ----------------------

func (CreateOpClassItem) Deparse ¶

func (node CreateOpClassItem) Deparse(ctx Context) (*string, error)

func (CreateOpClassItem) Fingerprint ¶

func (node CreateOpClassItem) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateOpClassItem) MarshalJSON ¶

func (node CreateOpClassItem) MarshalJSON() ([]byte, error)

func (*CreateOpClassItem) UnmarshalJSON ¶

func (node *CreateOpClassItem) UnmarshalJSON(input []byte) (err error)

type CreateOpClassStmt ¶

type CreateOpClassStmt struct {
	Opclassname  List      `json:"opclassname"`  /* qualified name (list of Value strings) */
	Opfamilyname List      `json:"opfamilyname"` /* qualified name (ditto); NIL if omitted */
	Amname       *string   `json:"amname"`       /* name of index AM opclass is for */
	Datatype     *TypeName `json:"datatype"`     /* datatype of indexed column */
	Items        List      `json:"items"`        /* List of CreateOpClassItem nodes */
	IsDefault    bool      `json:"isDefault"`    /* Should be marked as default for type? */
}

---------------------- * Create Operator Class Statement * ----------------------

func (CreateOpClassStmt) Deparse ¶

func (node CreateOpClassStmt) Deparse(ctx Context) (*string, error)

func (CreateOpClassStmt) Fingerprint ¶

func (node CreateOpClassStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateOpClassStmt) MarshalJSON ¶

func (node CreateOpClassStmt) MarshalJSON() ([]byte, error)

func (*CreateOpClassStmt) UnmarshalJSON ¶

func (node *CreateOpClassStmt) UnmarshalJSON(input []byte) (err error)

type CreateOpFamilyStmt ¶

type CreateOpFamilyStmt struct {
	Opfamilyname List    `json:"opfamilyname"` /* qualified name (list of Value strings) */
	Amname       *string `json:"amname"`       /* name of index AM opfamily is for */
}

---------------------- * Create Operator Family Statement * ----------------------

func (CreateOpFamilyStmt) Deparse ¶

func (node CreateOpFamilyStmt) Deparse(ctx Context) (*string, error)

func (CreateOpFamilyStmt) Fingerprint ¶

func (node CreateOpFamilyStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateOpFamilyStmt) MarshalJSON ¶

func (node CreateOpFamilyStmt) MarshalJSON() ([]byte, error)

func (*CreateOpFamilyStmt) UnmarshalJSON ¶

func (node *CreateOpFamilyStmt) UnmarshalJSON(input []byte) (err error)

type CreatePLangStmt ¶

type CreatePLangStmt struct {
	Replace     bool    `json:"replace"`     /* T => replace if already exists */
	Plname      *string `json:"plname"`      /* PL name */
	Plhandler   List    `json:"plhandler"`   /* PL call handler function (qual. name) */
	Plinline    List    `json:"plinline"`    /* optional inline function (qual. name) */
	Plvalidator List    `json:"plvalidator"` /* optional validator function (qual. name) */
	Pltrusted   bool    `json:"pltrusted"`   /* PL is trusted */
}

---------------------- * Create/Drop PROCEDURAL LANGUAGE Statements * Create PROCEDURAL LANGUAGE Statements * ----------------------

func (CreatePLangStmt) Deparse ¶

func (node CreatePLangStmt) Deparse(ctx Context) (*string, error)

func (CreatePLangStmt) Fingerprint ¶

func (node CreatePLangStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreatePLangStmt) MarshalJSON ¶

func (node CreatePLangStmt) MarshalJSON() ([]byte, error)

func (*CreatePLangStmt) UnmarshalJSON ¶

func (node *CreatePLangStmt) UnmarshalJSON(input []byte) (err error)

type CreatePolicyStmt ¶

type CreatePolicyStmt struct {
	PolicyName *string   `json:"policy_name"` /* Policy's name */
	Table      *RangeVar `json:"table"`       /* the table name the policy applies to */
	CmdName    *string   `json:"cmd_name"`    /* the command name the policy applies to */
	Permissive bool      `json:"permissive"`  /* restrictive or permissive policy */
	Roles      List      `json:"roles"`       /* the roles associated with the policy */
	Qual       Node      `json:"qual"`        /* the policy's condition */
	WithCheck  Node      `json:"with_check"`  /* the policy's WITH CHECK condition. */
}

----------------------

  • Create POLICY Statement *----------------------

func (CreatePolicyStmt) Deparse ¶

func (node CreatePolicyStmt) Deparse(ctx Context) (*string, error)

func (CreatePolicyStmt) Fingerprint ¶

func (node CreatePolicyStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreatePolicyStmt) MarshalJSON ¶

func (node CreatePolicyStmt) MarshalJSON() ([]byte, error)

func (*CreatePolicyStmt) UnmarshalJSON ¶

func (node *CreatePolicyStmt) UnmarshalJSON(input []byte) (err error)

type CreatePublicationStmt ¶

type CreatePublicationStmt struct {
	Pubname      *string `json:"pubname"`        /* Name of of the publication */
	Options      List    `json:"options"`        /* List of DefElem nodes */
	Tables       List    `json:"tables"`         /* Optional list of tables to add */
	ForAllTables bool    `json:"for_all_tables"` /* Special publication for all tables in db */
}

func (CreatePublicationStmt) Deparse ¶

func (node CreatePublicationStmt) Deparse(ctx Context) (*string, error)

func (CreatePublicationStmt) Fingerprint ¶

func (node CreatePublicationStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreatePublicationStmt) MarshalJSON ¶

func (node CreatePublicationStmt) MarshalJSON() ([]byte, error)

func (*CreatePublicationStmt) UnmarshalJSON ¶

func (node *CreatePublicationStmt) UnmarshalJSON(input []byte) (err error)

type CreateRangeStmt ¶

type CreateRangeStmt struct {
	TypeName List `json:"typeName"` /* qualified name (list of Value strings) */
	Params   List `json:"params"`   /* range parameters (list of DefElem) */
}

---------------------- * Create Type Statement, range types * ----------------------

func (CreateRangeStmt) Deparse ¶

func (node CreateRangeStmt) Deparse(ctx Context) (*string, error)

func (CreateRangeStmt) Fingerprint ¶

func (node CreateRangeStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateRangeStmt) MarshalJSON ¶

func (node CreateRangeStmt) MarshalJSON() ([]byte, error)

func (*CreateRangeStmt) UnmarshalJSON ¶

func (node *CreateRangeStmt) UnmarshalJSON(input []byte) (err error)

type CreateRoleStmt ¶

type CreateRoleStmt struct {
	StmtType RoleStmtType `json:"stmt_type"` /* ROLE/USER/GROUP */
	Role     *string      `json:"role"`      /* role name */
	Options  List         `json:"options"`   /* List of DefElem nodes */
}

---------------------- * Create/Alter/Drop Role Statements * * Note: these node types are also used for the backwards-compatible * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases * there's really no need to distinguish what the original spelling was, * but for CREATE we mark the type because the defaults vary. * ----------------------

func (CreateRoleStmt) Deparse ¶

func (node CreateRoleStmt) Deparse(ctx Context) (*string, error)

func (CreateRoleStmt) Fingerprint ¶

func (node CreateRoleStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateRoleStmt) MarshalJSON ¶

func (node CreateRoleStmt) MarshalJSON() ([]byte, error)

func (*CreateRoleStmt) UnmarshalJSON ¶

func (node *CreateRoleStmt) UnmarshalJSON(input []byte) (err error)

type CreateSchemaStmt ¶

type CreateSchemaStmt struct {
	Schemaname  *string   `json:"schemaname"`    /* the name of the schema to create */
	Authrole    *RoleSpec `json:"authrole"`      /* the owner of the created schema */
	SchemaElts  List      `json:"schemaElts"`    /* schema components (list of parsenodes) */
	IfNotExists bool      `json:"if_not_exists"` /* just do nothing if schema already exists? */
}

---------------------- * Create Schema Statement * * NOTE: the schemaElts list contains raw parsetrees for component statements * of the schema, such as CREATE TABLE, GRANT, etc. These are analyzed and * executed after the schema itself is created. * ----------------------

func (CreateSchemaStmt) Deparse ¶

func (node CreateSchemaStmt) Deparse(ctx Context) (*string, error)

func (CreateSchemaStmt) Fingerprint ¶

func (node CreateSchemaStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateSchemaStmt) MarshalJSON ¶

func (node CreateSchemaStmt) MarshalJSON() ([]byte, error)

func (*CreateSchemaStmt) UnmarshalJSON ¶

func (node *CreateSchemaStmt) UnmarshalJSON(input []byte) (err error)

type CreateSeqStmt ¶

type CreateSeqStmt struct {
	Sequence    *RangeVar `json:"sequence"` /* the sequence to create */
	Options     List      `json:"options"`
	OwnerId     Oid       `json:"ownerId"` /* ID of owner, or InvalidOid for default */
	ForIdentity bool      `json:"for_identity"`
	IfNotExists bool      `json:"if_not_exists"` /* just do nothing if it already exists? */
}

---------------------- * {Create|Alter} SEQUENCE Statement * ----------------------

func (CreateSeqStmt) Deparse ¶

func (node CreateSeqStmt) Deparse(ctx Context) (*string, error)

func (CreateSeqStmt) Fingerprint ¶

func (node CreateSeqStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateSeqStmt) MarshalJSON ¶

func (node CreateSeqStmt) MarshalJSON() ([]byte, error)

func (*CreateSeqStmt) UnmarshalJSON ¶

func (node *CreateSeqStmt) UnmarshalJSON(input []byte) (err error)

type CreateStatsStmt ¶

type CreateStatsStmt struct {
	Defnames    List `json:"defnames"`      /* qualified name (list of Value strings) */
	StatTypes   List `json:"stat_types"`    /* stat types (list of Value strings) */
	Exprs       List `json:"exprs"`         /* expressions to build statistics on */
	Relations   List `json:"relations"`     /* rels to build stats on (list of RangeVar) */
	IfNotExists bool `json:"if_not_exists"` /* do nothing if stats name already exists */
}

---------------------- * Create Statistics Statement * ----------------------

func (CreateStatsStmt) Deparse ¶

func (node CreateStatsStmt) Deparse(ctx Context) (*string, error)

func (CreateStatsStmt) Fingerprint ¶

func (node CreateStatsStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateStatsStmt) MarshalJSON ¶

func (node CreateStatsStmt) MarshalJSON() ([]byte, error)

func (*CreateStatsStmt) UnmarshalJSON ¶

func (node *CreateStatsStmt) UnmarshalJSON(input []byte) (err error)

type CreateStmt ¶

type CreateStmt struct {
	Relation     *RangeVar `json:"relation"`     /* relation to create */
	TableElts    List      `json:"tableElts"`    /* column definitions (list of ColumnDef) */
	InhRelations List      `json:"inhRelations"` /* relations to inherit from (list of
	 * inhRelation) */

	Partbound      *PartitionBoundSpec `json:"partbound"`      /* FOR VALUES clause */
	Partspec       *PartitionSpec      `json:"partspec"`       /* PARTITION BY clause */
	OfTypename     *TypeName           `json:"ofTypename"`     /* OF typename */
	Constraints    List                `json:"constraints"`    /* constraints (list of Constraint nodes) */
	Options        List                `json:"options"`        /* options from WITH clause */
	Oncommit       OnCommitAction      `json:"oncommit"`       /* what do we do at COMMIT? */
	Tablespacename *string             `json:"tablespacename"` /* table space to use, or NULL */
	IfNotExists    bool                `json:"if_not_exists"`  /* just do nothing if it already exists? */
}

---------------------- * Create Table Statement * * NOTE: in the raw gram.y output, ColumnDef and Constraint nodes are * intermixed in tableElts, and constraints is NIL. After parse analysis, * tableElts contains just ColumnDefs, and constraints contains just * Constraint nodes (in fact, only CONSTR_CHECK nodes, in the present * implementation). * ----------------------

func (CreateStmt) Deparse ¶

func (node CreateStmt) Deparse(ctx Context) (*string, error)

func (CreateStmt) Fingerprint ¶

func (node CreateStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateStmt) MarshalJSON ¶

func (node CreateStmt) MarshalJSON() ([]byte, error)

func (CreateStmt) StatementTag ¶

func (node CreateStmt) StatementTag() string

func (CreateStmt) StatementType ¶

func (node CreateStmt) StatementType() StmtType

func (*CreateStmt) UnmarshalJSON ¶

func (node *CreateStmt) UnmarshalJSON(input []byte) (err error)

type CreateSubscriptionStmt ¶

type CreateSubscriptionStmt struct {
	Subname     *string `json:"subname"`     /* Name of of the subscription */
	Conninfo    *string `json:"conninfo"`    /* Connection string to publisher */
	Publication List    `json:"publication"` /* One or more publication to subscribe to */
	Options     List    `json:"options"`     /* List of DefElem nodes */
}

func (CreateSubscriptionStmt) Deparse ¶

func (node CreateSubscriptionStmt) Deparse(ctx Context) (*string, error)

func (CreateSubscriptionStmt) Fingerprint ¶

func (node CreateSubscriptionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateSubscriptionStmt) MarshalJSON ¶

func (node CreateSubscriptionStmt) MarshalJSON() ([]byte, error)

func (*CreateSubscriptionStmt) UnmarshalJSON ¶

func (node *CreateSubscriptionStmt) UnmarshalJSON(input []byte) (err error)

type CreateTableAsStmt ¶

type CreateTableAsStmt struct {
	Query        Node        `json:"query"`          /* the query (see comments above) */
	Into         *IntoClause `json:"into"`           /* destination table */
	Relkind      ObjectType  `json:"relkind"`        /* OBJECT_TABLE or OBJECT_MATVIEW */
	IsSelectInto bool        `json:"is_select_into"` /* it was written as SELECT INTO */
	IfNotExists  bool        `json:"if_not_exists"`  /* just do nothing if it already exists? */
}

---------------------- * CREATE TABLE AS Statement (a/k/a SELECT INTO) * * A query written as CREATE TABLE AS will produce this node type natively. * A query written as SELECT ... INTO will be transformed to this form during * parse analysis. * A query written as CREATE MATERIALIZED view will produce this node type, * during parse analysis, since it needs all the same data. * * The "query" field is handled similarly to EXPLAIN, though note that it * can be a SELECT or an EXECUTE, but not other DML statements. * ----------------------

func (CreateTableAsStmt) Deparse ¶

func (node CreateTableAsStmt) Deparse(ctx Context) (*string, error)

func (CreateTableAsStmt) Fingerprint ¶

func (node CreateTableAsStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateTableAsStmt) MarshalJSON ¶

func (node CreateTableAsStmt) MarshalJSON() ([]byte, error)

func (*CreateTableAsStmt) UnmarshalJSON ¶

func (node *CreateTableAsStmt) UnmarshalJSON(input []byte) (err error)

type CreateTableSpaceStmt ¶

type CreateTableSpaceStmt struct {
	Tablespacename *string   `json:"tablespacename"`
	Owner          *RoleSpec `json:"owner"`
	Location       *string   `json:"location"`
	Options        List      `json:"options"`
}

---------------------- * Create/Drop Table Space Statements * ----------------------

func (CreateTableSpaceStmt) Deparse ¶

func (node CreateTableSpaceStmt) Deparse(ctx Context) (*string, error)

func (CreateTableSpaceStmt) Fingerprint ¶

func (node CreateTableSpaceStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateTableSpaceStmt) MarshalJSON ¶

func (node CreateTableSpaceStmt) MarshalJSON() ([]byte, error)

func (*CreateTableSpaceStmt) UnmarshalJSON ¶

func (node *CreateTableSpaceStmt) UnmarshalJSON(input []byte) (err error)

type CreateTransformStmt ¶

type CreateTransformStmt struct {
	Replace  bool            `json:"replace"`
	TypeName *TypeName       `json:"type_name"`
	Lang     *string         `json:"lang"`
	Fromsql  *ObjectWithArgs `json:"fromsql"`
	Tosql    *ObjectWithArgs `json:"tosql"`
}

---------------------- * CREATE TRANSFORM Statement * ----------------------

func (CreateTransformStmt) Deparse ¶

func (node CreateTransformStmt) Deparse(ctx Context) (*string, error)

func (CreateTransformStmt) Fingerprint ¶

func (node CreateTransformStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateTransformStmt) MarshalJSON ¶

func (node CreateTransformStmt) MarshalJSON() ([]byte, error)

func (*CreateTransformStmt) UnmarshalJSON ¶

func (node *CreateTransformStmt) UnmarshalJSON(input []byte) (err error)

type CreateTrigStmt ¶

type CreateTrigStmt struct {
	Trigname *string   `json:"trigname"` /* TRIGGER's name */
	Relation *RangeVar `json:"relation"` /* relation trigger is on */
	Funcname List      `json:"funcname"` /* qual. name of function to call */
	Args     List      `json:"args"`     /* list of (T_String) Values or NIL */
	Row      bool      `json:"row"`      /* ROW/STATEMENT */

	/* timing uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
	Timing int16 `json:"timing"` /* BEFORE, AFTER, or INSTEAD */

	/* events uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */
	Events       int16 `json:"events"`       /* "OR" of INSERT/UPDATE/DELETE/TRUNCATE */
	Columns      List  `json:"columns"`      /* column names, or NIL for all columns */
	WhenClause   Node  `json:"whenClause"`   /* qual expression, or NULL if none */
	Isconstraint bool  `json:"isconstraint"` /* This is a constraint trigger */

	/* explicitly named transition data */
	TransitionRels List `json:"transitionRels"` /* TriggerTransition nodes, or NIL if none */

	/* The remaining fields are only used for constraint triggers */
	Deferrable   bool      `json:"deferrable"`   /* [NOT] DEFERRABLE */
	Initdeferred bool      `json:"initdeferred"` /* INITIALLY {DEFERRED|IMMEDIATE} */
	Constrrel    *RangeVar `json:"constrrel"`    /* opposite relation, if RI trigger */
}

---------------------- * Create TRIGGER Statement * ----------------------

func (CreateTrigStmt) Deparse ¶

func (node CreateTrigStmt) Deparse(ctx Context) (*string, error)

func (CreateTrigStmt) Fingerprint ¶

func (node CreateTrigStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateTrigStmt) MarshalJSON ¶

func (node CreateTrigStmt) MarshalJSON() ([]byte, error)

func (*CreateTrigStmt) UnmarshalJSON ¶

func (node *CreateTrigStmt) UnmarshalJSON(input []byte) (err error)

type CreateUserMappingStmt ¶

type CreateUserMappingStmt struct {
	User        *RoleSpec `json:"user"`          /* user role */
	Servername  *string   `json:"servername"`    /* server name */
	IfNotExists bool      `json:"if_not_exists"` /* just do nothing if it already exists? */
	Options     List      `json:"options"`       /* generic options to server */
}

---------------------- * Create/Drop USER MAPPING Statements * ----------------------

func (CreateUserMappingStmt) Deparse ¶

func (node CreateUserMappingStmt) Deparse(ctx Context) (*string, error)

func (CreateUserMappingStmt) Fingerprint ¶

func (node CreateUserMappingStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreateUserMappingStmt) MarshalJSON ¶

func (node CreateUserMappingStmt) MarshalJSON() ([]byte, error)

func (*CreateUserMappingStmt) UnmarshalJSON ¶

func (node *CreateUserMappingStmt) UnmarshalJSON(input []byte) (err error)

type CreatedbStmt ¶

type CreatedbStmt struct {
	Dbname  *string `json:"dbname"`  /* name of database to create */
	Options List    `json:"options"` /* List of DefElem nodes */
}

---------------------- * Createdb Statement * ----------------------

func (CreatedbStmt) Deparse ¶

func (node CreatedbStmt) Deparse(ctx Context) (*string, error)

func (CreatedbStmt) Fingerprint ¶

func (node CreatedbStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CreatedbStmt) MarshalJSON ¶

func (node CreatedbStmt) MarshalJSON() ([]byte, error)

func (*CreatedbStmt) UnmarshalJSON ¶

func (node *CreatedbStmt) UnmarshalJSON(input []byte) (err error)

type CurrentOfExpr ¶

type CurrentOfExpr struct {
	Xpr         Node    `json:"xpr"`
	Cvarno      Index   `json:"cvarno"`       /* RT index of target relation */
	CursorName  *string `json:"cursor_name"`  /* name of referenced cursor, or NULL */
	CursorParam int     `json:"cursor_param"` /* refcursor parameter number, or 0 */
}

* Node representing [WHERE] CURRENT OF cursor_name * * CURRENT OF is a bit like a Var, in that it carries the rangetable index * of the target relation being constrained; this aids placing the expression * correctly during planning. We can assume however that its "levelsup" is * always zero, due to the syntactic constraints on where it can appear. * * The referenced cursor can be represented either as a hardwired string * or as a reference to a run-time parameter of type REFCURSOR. The latter * case is for the convenience of plpgsql.

func (CurrentOfExpr) Deparse ¶

func (node CurrentOfExpr) Deparse(ctx Context) (*string, error)

func (CurrentOfExpr) Fingerprint ¶

func (node CurrentOfExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (CurrentOfExpr) MarshalJSON ¶

func (node CurrentOfExpr) MarshalJSON() ([]byte, error)

func (*CurrentOfExpr) UnmarshalJSON ¶

func (node *CurrentOfExpr) UnmarshalJSON(input []byte) (err error)

type Datum ¶

type Datum uintptr

type DatumPtr ¶

type DatumPtr Datum

type DeallocateStmt ¶

type DeallocateStmt struct {
	Name *string `json:"name"` /* The name of the plan to remove */

}

---------------------- * DEALLOCATE Statement * ----------------------

func (DeallocateStmt) Deparse ¶

func (node DeallocateStmt) Deparse(ctx Context) (*string, error)

func (DeallocateStmt) Fingerprint ¶

func (node DeallocateStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DeallocateStmt) MarshalJSON ¶

func (node DeallocateStmt) MarshalJSON() ([]byte, error)

func (*DeallocateStmt) UnmarshalJSON ¶

func (node *DeallocateStmt) UnmarshalJSON(input []byte) (err error)

type DeclareCursorStmt ¶

type DeclareCursorStmt struct {
	Portalname *string `json:"portalname"` /* name of the portal (cursor) */
	Options    int     `json:"options"`    /* bitmask of options (see above) */
	Query      Node    `json:"query"`      /* the query (see comments above) */
}

these planner-control flags do not correspond to any SQL grammar:

func (DeclareCursorStmt) Deparse ¶

func (node DeclareCursorStmt) Deparse(ctx Context) (*string, error)

func (DeclareCursorStmt) Fingerprint ¶

func (node DeclareCursorStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DeclareCursorStmt) MarshalJSON ¶

func (node DeclareCursorStmt) MarshalJSON() ([]byte, error)

func (*DeclareCursorStmt) UnmarshalJSON ¶

func (node *DeclareCursorStmt) UnmarshalJSON(input []byte) (err error)

type DefElem ¶

type DefElem struct {
	Defnamespace *string       `json:"defnamespace"` /* NULL if unqualified name */
	Defname      *string       `json:"defname"`
	Arg          Node          `json:"arg"`       /* a (Value *) or a (TypeName *) */
	Defaction    DefElemAction `json:"defaction"` /* unspecified action, or SET/ADD/DROP */
	Location     int           `json:"location"`  /* token location, or -1 if unknown */
}

* DefElem - a generic "name = value" option definition * * In some contexts the name can be qualified. Also, certain SQL commands * allow a SET/ADD/DROP action to be attached to option settings, so it's * convenient to carry a field for that too. (Note: currently, it is our * practice that the grammar allows namespace and action only in statements * where they are relevant; C code can just ignore those fields in other * statements.)

func (DefElem) Deparse ¶

func (node DefElem) Deparse(ctx Context) (*string, error)

func (DefElem) Fingerprint ¶

func (node DefElem) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DefElem) MarshalJSON ¶

func (node DefElem) MarshalJSON() ([]byte, error)

func (*DefElem) UnmarshalJSON ¶

func (node *DefElem) UnmarshalJSON(input []byte) (err error)

type DefElemAction ¶

type DefElemAction uint

* DefElem - a generic "name = value" option definition * * In some contexts the name can be qualified. Also, certain SQL commands * allow a SET/ADD/DROP action to be attached to option settings, so it's * convenient to carry a field for that too. (Note: currently, it is our * practice that the grammar allows namespace and action only in statements * where they are relevant; C code can just ignore those fields in other * statements.)

const (
	DEFELEM_UNSPEC DefElemAction = iota /* no action given */
	DEFELEM_SET
	DEFELEM_ADD
	DEFELEM_DROP
)

type DefineStmt ¶

type DefineStmt struct {
	Kind        ObjectType `json:"kind"`          /* aggregate, operator, type */
	Oldstyle    bool       `json:"oldstyle"`      /* hack to signal old CREATE AGG syntax */
	Defnames    List       `json:"defnames"`      /* qualified name (list of Value strings) */
	Args        List       `json:"args"`          /* a list of TypeName (if needed) */
	Definition  List       `json:"definition"`    /* a list of DefElem */
	IfNotExists bool       `json:"if_not_exists"` /* just do nothing if it already exists? */
}

---------------------- * Create {Aggregate|Operator|Type} Statement * ----------------------

func (DefineStmt) Deparse ¶

func (node DefineStmt) Deparse(ctx Context) (*string, error)

func (DefineStmt) Fingerprint ¶

func (node DefineStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DefineStmt) MarshalJSON ¶

func (node DefineStmt) MarshalJSON() ([]byte, error)

func (*DefineStmt) UnmarshalJSON ¶

func (node *DefineStmt) UnmarshalJSON(input []byte) (err error)

type DeleteStmt ¶

type DeleteStmt struct {
	Relation      *RangeVar   `json:"relation"`      /* relation to delete from */
	UsingClause   List        `json:"usingClause"`   /* optional using clause for more tables */
	WhereClause   Node        `json:"whereClause"`   /* qualifications */
	ReturningList List        `json:"returningList"` /* list of expressions to return */
	WithClause    *WithClause `json:"withClause"`    /* WITH clause */
}

---------------------- * Delete Statement * ----------------------

func (DeleteStmt) Deparse ¶

func (node DeleteStmt) Deparse(ctx Context) (*string, error)

func (DeleteStmt) Fingerprint ¶

func (node DeleteStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DeleteStmt) MarshalJSON ¶

func (node DeleteStmt) MarshalJSON() ([]byte, error)

func (DeleteStmt) StatementTag ¶

func (node DeleteStmt) StatementTag() string

func (DeleteStmt) StatementType ¶

func (node DeleteStmt) StatementType() StmtType

func (*DeleteStmt) UnmarshalJSON ¶

func (node *DeleteStmt) UnmarshalJSON(input []byte) (err error)

type DiscardMode ¶

type DiscardMode uint

---------------------- * Discard Statement * ----------------------

const (
	DISCARD_ALL DiscardMode = iota
	DISCARD_PLANS
	DISCARD_SEQUENCES
	DISCARD_TEMP
)

type DiscardStmt ¶

type DiscardStmt struct {
	Target DiscardMode `json:"target"`
}

---------------------- * Discard Statement * ----------------------

func (DiscardStmt) Deparse ¶

func (node DiscardStmt) Deparse(ctx Context) (*string, error)

func (DiscardStmt) Fingerprint ¶

func (node DiscardStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DiscardStmt) MarshalJSON ¶

func (node DiscardStmt) MarshalJSON() ([]byte, error)

func (*DiscardStmt) UnmarshalJSON ¶

func (node *DiscardStmt) UnmarshalJSON(input []byte) (err error)

type DistinctExpr ¶

type DistinctExpr OpExpr

type DoStmt ¶

type DoStmt struct {
	Args List `json:"args"` /* List of DefElem nodes */
}

---------------------- * DO Statement * * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API * ----------------------

func (DoStmt) Deparse ¶

func (node DoStmt) Deparse(ctx Context) (*string, error)

func (DoStmt) Fingerprint ¶

func (node DoStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DoStmt) MarshalJSON ¶

func (node DoStmt) MarshalJSON() ([]byte, error)

func (*DoStmt) UnmarshalJSON ¶

func (node *DoStmt) UnmarshalJSON(input []byte) (err error)

type DropBehavior ¶

type DropBehavior uint
const (
	DROP_RESTRICT DropBehavior = iota /* drop fails if any dependent objects */
	DROP_CASCADE                      /* remove dependent objects too */
)

type DropOwnedStmt ¶

type DropOwnedStmt struct {
	Roles    List         `json:"roles"`
	Behavior DropBehavior `json:"behavior"`
}

* DROP OWNED statement

func (DropOwnedStmt) Deparse ¶

func (node DropOwnedStmt) Deparse(ctx Context) (*string, error)

func (DropOwnedStmt) Fingerprint ¶

func (node DropOwnedStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DropOwnedStmt) MarshalJSON ¶

func (node DropOwnedStmt) MarshalJSON() ([]byte, error)

func (*DropOwnedStmt) UnmarshalJSON ¶

func (node *DropOwnedStmt) UnmarshalJSON(input []byte) (err error)

type DropRoleStmt ¶

type DropRoleStmt struct {
	Roles     List `json:"roles"`      /* List of roles to remove */
	MissingOk bool `json:"missing_ok"` /* skip error if a role is missing? */
}

---------------------- * Create/Alter/Drop Role Statements * * Note: these node types are also used for the backwards-compatible * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases * there's really no need to distinguish what the original spelling was, * but for CREATE we mark the type because the defaults vary. * ----------------------

func (DropRoleStmt) Deparse ¶

func (node DropRoleStmt) Deparse(ctx Context) (*string, error)

func (DropRoleStmt) Fingerprint ¶

func (node DropRoleStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DropRoleStmt) MarshalJSON ¶

func (node DropRoleStmt) MarshalJSON() ([]byte, error)

func (*DropRoleStmt) UnmarshalJSON ¶

func (node *DropRoleStmt) UnmarshalJSON(input []byte) (err error)

type DropStmt ¶

type DropStmt struct {
	Objects    List         `json:"objects"`    /* list of names */
	RemoveType ObjectType   `json:"removeType"` /* object type */
	Behavior   DropBehavior `json:"behavior"`   /* RESTRICT or CASCADE behavior */
	MissingOk  bool         `json:"missing_ok"` /* skip error if object is missing? */
	Concurrent bool         `json:"concurrent"` /* drop index concurrently? */
}

---------------------- * Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement * ----------------------

func (DropStmt) Deparse ¶

func (node DropStmt) Deparse(ctx Context) (*string, error)

func (DropStmt) Fingerprint ¶

func (node DropStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DropStmt) MarshalJSON ¶

func (node DropStmt) MarshalJSON() ([]byte, error)

func (DropStmt) StatementTag ¶

func (node DropStmt) StatementTag() string

func (DropStmt) StatementType ¶

func (node DropStmt) StatementType() StmtType

func (*DropStmt) UnmarshalJSON ¶

func (node *DropStmt) UnmarshalJSON(input []byte) (err error)

type DropSubscriptionStmt ¶

type DropSubscriptionStmt struct {
	Subname   *string      `json:"subname"`    /* Name of of the subscription */
	MissingOk bool         `json:"missing_ok"` /* Skip error if missing? */
	Behavior  DropBehavior `json:"behavior"`   /* RESTRICT or CASCADE behavior */
}

func (DropSubscriptionStmt) Deparse ¶

func (node DropSubscriptionStmt) Deparse(ctx Context) (*string, error)

func (DropSubscriptionStmt) Fingerprint ¶

func (node DropSubscriptionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DropSubscriptionStmt) MarshalJSON ¶

func (node DropSubscriptionStmt) MarshalJSON() ([]byte, error)

func (*DropSubscriptionStmt) UnmarshalJSON ¶

func (node *DropSubscriptionStmt) UnmarshalJSON(input []byte) (err error)

type DropTableSpaceStmt ¶

type DropTableSpaceStmt struct {
	Tablespacename *string `json:"tablespacename"`
	MissingOk      bool    `json:"missing_ok"` /* skip error if missing? */
}

---------------------- * Create/Drop Table Space Statements * ----------------------

func (DropTableSpaceStmt) Deparse ¶

func (node DropTableSpaceStmt) Deparse(ctx Context) (*string, error)

func (DropTableSpaceStmt) Fingerprint ¶

func (node DropTableSpaceStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DropTableSpaceStmt) MarshalJSON ¶

func (node DropTableSpaceStmt) MarshalJSON() ([]byte, error)

func (*DropTableSpaceStmt) UnmarshalJSON ¶

func (node *DropTableSpaceStmt) UnmarshalJSON(input []byte) (err error)

type DropUserMappingStmt ¶

type DropUserMappingStmt struct {
	User       *RoleSpec `json:"user"`       /* user role */
	Servername *string   `json:"servername"` /* server name */
	MissingOk  bool      `json:"missing_ok"` /* ignore missing mappings */
}

---------------------- * Create/Drop USER MAPPING Statements * ----------------------

func (DropUserMappingStmt) Deparse ¶

func (node DropUserMappingStmt) Deparse(ctx Context) (*string, error)

func (DropUserMappingStmt) Fingerprint ¶

func (node DropUserMappingStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DropUserMappingStmt) MarshalJSON ¶

func (node DropUserMappingStmt) MarshalJSON() ([]byte, error)

func (*DropUserMappingStmt) UnmarshalJSON ¶

func (node *DropUserMappingStmt) UnmarshalJSON(input []byte) (err error)

type DropdbStmt ¶

type DropdbStmt struct {
	Dbname    *string `json:"dbname"`     /* database to drop */
	MissingOk bool    `json:"missing_ok"` /* skip error if db is missing? */
}

---------------------- * Dropdb Statement * ----------------------

func (DropdbStmt) Deparse ¶

func (node DropdbStmt) Deparse(ctx Context) (*string, error)

func (DropdbStmt) Fingerprint ¶

func (node DropdbStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (DropdbStmt) MarshalJSON ¶

func (node DropdbStmt) MarshalJSON() ([]byte, error)

func (*DropdbStmt) UnmarshalJSON ¶

func (node *DropdbStmt) UnmarshalJSON(input []byte) (err error)

type ExecuteStmt ¶

type ExecuteStmt struct {
	Name   *string `json:"name"`   /* The name of the plan to execute */
	Params List    `json:"params"` /* Values to assign to parameters */
}

---------------------- * EXECUTE Statement * ----------------------

func (ExecuteStmt) Deparse ¶

func (node ExecuteStmt) Deparse(ctx Context) (*string, error)

func (ExecuteStmt) Fingerprint ¶

func (node ExecuteStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ExecuteStmt) MarshalJSON ¶

func (node ExecuteStmt) MarshalJSON() ([]byte, error)

func (*ExecuteStmt) UnmarshalJSON ¶

func (node *ExecuteStmt) UnmarshalJSON(input []byte) (err error)

type ExplainStmt ¶

type ExplainStmt struct {
	Query   Node `json:"query"`   /* the query (see comments above) */
	Options List `json:"options"` /* list of DefElem nodes */
}

---------------------- * Explain Statement * * The "query" field is initially a raw parse tree, and is converted to a * Query node during parse analysis. Note that rewriting and planning * of the query are always postponed until execution. * ----------------------

func (ExplainStmt) Deparse ¶

func (node ExplainStmt) Deparse(ctx Context) (*string, error)

func (ExplainStmt) Fingerprint ¶

func (node ExplainStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ExplainStmt) MarshalJSON ¶

func (node ExplainStmt) MarshalJSON() ([]byte, error)

func (*ExplainStmt) UnmarshalJSON ¶

func (node *ExplainStmt) UnmarshalJSON(input []byte) (err error)

type Expr ¶

type Expr struct {
}

* Expr - generic superclass for executable-expression nodes * * All node types that are used in executable expression trees should derive * from Expr (that is, have Expr as their first field). Since Expr only * contains NodeTag, this is a formality, but it is an easy form of * documentation. See also the ExprState node types in execnodes.h.

func (Expr) Deparse ¶

func (node Expr) Deparse(ctx Context) (*string, error)

func (Expr) Fingerprint ¶

func (node Expr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Expr) MarshalJSON ¶

func (node Expr) MarshalJSON() ([]byte, error)

func (*Expr) UnmarshalJSON ¶

func (node *Expr) UnmarshalJSON(input []byte) (err error)

type FetchDirection ¶

type FetchDirection uint

---------------------- * Fetch Statement (also Move) * ----------------------

const (
	/* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
	FETCH_FORWARD FetchDirection = iota
	FETCH_BACKWARD

	/* for these, howMany indicates a position; only one row is fetched */
	FETCH_ABSOLUTE
	FETCH_RELATIVE
)

type FetchStmt ¶

type FetchStmt struct {
	Direction  FetchDirection `json:"direction"`  /* see above */
	HowMany    int64          `json:"howMany"`    /* number of rows, or position argument */
	Portalname *string        `json:"portalname"` /* name of portal (cursor) */
	Ismove     bool           `json:"ismove"`     /* TRUE if MOVE */
}

---------------------- * Fetch Statement (also Move) * ----------------------

func (FetchStmt) Deparse ¶

func (node FetchStmt) Deparse(ctx Context) (*string, error)

func (FetchStmt) Fingerprint ¶

func (node FetchStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (FetchStmt) MarshalJSON ¶

func (node FetchStmt) MarshalJSON() ([]byte, error)

func (*FetchStmt) UnmarshalJSON ¶

func (node *FetchStmt) UnmarshalJSON(input []byte) (err error)

type FieldSelect ¶

type FieldSelect struct {
	Xpr        Node       `json:"xpr"`
	Arg        Node       `json:"arg"`        /* input expression */
	Fieldnum   AttrNumber `json:"fieldnum"`   /* attribute number of field to extract */
	Resulttype Oid        `json:"resulttype"` /* type of the field (result type of this
	 * node) */

	Resulttypmod int32 `json:"resulttypmod"` /* output typmod (usually -1) */
	Resultcollid Oid   `json:"resultcollid"` /* OID of collation of the field */
}

---------------- * FieldSelect * * FieldSelect represents the operation of extracting one field from a tuple * value. At runtime, the input expression is expected to yield a rowtype * Datum. The specified field number is extracted and returned as a Datum. * ----------------

func (FieldSelect) Deparse ¶

func (node FieldSelect) Deparse(ctx Context) (*string, error)

func (FieldSelect) Fingerprint ¶

func (node FieldSelect) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (FieldSelect) MarshalJSON ¶

func (node FieldSelect) MarshalJSON() ([]byte, error)

func (*FieldSelect) UnmarshalJSON ¶

func (node *FieldSelect) UnmarshalJSON(input []byte) (err error)

type FieldStore ¶

type FieldStore struct {
	Xpr        Node `json:"xpr"`
	Arg        Node `json:"arg"`        /* input tuple value */
	Newvals    List `json:"newvals"`    /* new value(s) for field(s) */
	Fieldnums  List `json:"fieldnums"`  /* integer list of field attnums */
	Resulttype Oid  `json:"resulttype"` /* type of result (same as type of arg) */

}

---------------- * FieldStore * * FieldStore represents the operation of modifying one field in a tuple * value, yielding a new tuple value (the input is not touched!). Like * the assign case of ArrayRef, this is used to implement UPDATE of a * portion of a column. * * A single FieldStore can actually represent updates of several different * fields. The parser only generates FieldStores with single-element lists, * but the planner will collapse multiple updates of the same base column * into one FieldStore. * ----------------

func (FieldStore) Deparse ¶

func (node FieldStore) Deparse(ctx Context) (*string, error)

func (FieldStore) Fingerprint ¶

func (node FieldStore) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (FieldStore) MarshalJSON ¶

func (node FieldStore) MarshalJSON() ([]byte, error)

func (*FieldStore) UnmarshalJSON ¶

func (node *FieldStore) UnmarshalJSON(input []byte) (err error)

type FingerprintContext ¶

type FingerprintContext interface {
	WriteString(string)
}

type FingerprintHashContext ¶

type FingerprintHashContext struct {
	// contains filtered or unexported fields
}

func NewFingerprintHashContext ¶

func NewFingerprintHashContext() *FingerprintHashContext

func (FingerprintHashContext) Sum ¶

func (ctx FingerprintHashContext) Sum() []byte

func (FingerprintHashContext) WriteString ¶

func (ctx FingerprintHashContext) WriteString(str string)

type FingerprintSubContext ¶

type FingerprintSubContext struct {
	// contains filtered or unexported fields
}

func NewFingerprintSubContext ¶

func NewFingerprintSubContext() *FingerprintSubContext

func (FingerprintSubContext) Equal ¶

func (FingerprintSubContext) Sum ¶

func (ctx FingerprintSubContext) Sum() []string

func (*FingerprintSubContext) WriteString ¶

func (ctx *FingerprintSubContext) WriteString(str string)

type FingerprintSubContextSlice ¶

type FingerprintSubContextSlice []FingerprintSubContext

func (*FingerprintSubContextSlice) AddIfUnique ¶

func (FingerprintSubContextSlice) Len ¶

func (FingerprintSubContextSlice) Less ¶

func (p FingerprintSubContextSlice) Less(i, j int) bool

func (FingerprintSubContextSlice) Swap ¶

func (p FingerprintSubContextSlice) Swap(i, j int)

type Float ¶

type Float struct {
	Str string `json:"str"`
}

func (Float) Deparse ¶

func (node Float) Deparse(ctx Context) (*string, error)

func (Float) Fingerprint ¶

func (node Float) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Float) MarshalJSON ¶

func (node Float) MarshalJSON() ([]byte, error)

func (*Float) UnmarshalJSON ¶

func (node *Float) UnmarshalJSON(input []byte) (err error)

type FromExpr ¶

type FromExpr struct {
	Fromlist List `json:"fromlist"` /* List of join subtrees */
	Quals    Node `json:"quals"`    /* qualifiers on join, if any */
}

----------

  • FromExpr - represents a FROM ... WHERE ... construct *
  • This is both more flexible than a JoinExpr (it can have any number of
  • children, including zero) and less so --- we don't need to deal with
  • aliases and so on. The output column set is implicitly just the union
  • of the outputs of the children. *----------

func (FromExpr) Deparse ¶

func (node FromExpr) Deparse(ctx Context) (*string, error)

func (FromExpr) Fingerprint ¶

func (node FromExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (FromExpr) MarshalJSON ¶

func (node FromExpr) MarshalJSON() ([]byte, error)

func (*FromExpr) UnmarshalJSON ¶

func (node *FromExpr) UnmarshalJSON(input []byte) (err error)

type FuncCall ¶

type FuncCall struct {
	Funcname       List       `json:"funcname"`         /* qualified name of function */
	Args           List       `json:"args"`             /* the arguments (list of exprs) */
	AggOrder       List       `json:"agg_order"`        /* ORDER BY (list of SortBy) */
	AggFilter      Node       `json:"agg_filter"`       /* FILTER clause, if any */
	AggWithinGroup bool       `json:"agg_within_group"` /* ORDER BY appeared in WITHIN GROUP */
	AggStar        bool       `json:"agg_star"`         /* argument was really '*' */
	AggDistinct    bool       `json:"agg_distinct"`     /* arguments were labeled DISTINCT */
	FuncVariadic   bool       `json:"func_variadic"`    /* last argument was labeled VARIADIC */
	Over           *WindowDef `json:"over"`             /* OVER clause, if any */
	Location       int        `json:"location"`         /* token location, or -1 if unknown */
}

* FuncCall - a function or aggregate invocation * * agg_order (if not NIL) indicates we saw 'foo(... ORDER BY ...)', or if * agg_within_group is true, it was 'foo(...) WITHIN GROUP (ORDER BY ...)'. * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct * indicates we saw 'foo(DISTINCT ...)'. In any of these cases, the * construct *must* be an aggregate call. Otherwise, it might be either an * aggregate or some other kind of function. However, if FILTER or OVER is * present it had better be an aggregate or window function. * * Normally, you'd initialize this via makeFuncCall() and then only change the * parts of the struct its defaults don't match afterwards, as needed.

func (FuncCall) Deparse ¶

func (node FuncCall) Deparse(ctx Context) (*string, error)

func (FuncCall) Fingerprint ¶

func (node FuncCall) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (FuncCall) MarshalJSON ¶

func (node FuncCall) MarshalJSON() ([]byte, error)

func (FuncCall) Name ¶

func (node FuncCall) Name() (string, error)

func (*FuncCall) UnmarshalJSON ¶

func (node *FuncCall) UnmarshalJSON(input []byte) (err error)

type FuncExpr ¶

type FuncExpr struct {
	Xpr            Node `json:"xpr"`
	Funcid         Oid  `json:"funcid"`         /* PG_PROC OID of the function */
	Funcresulttype Oid  `json:"funcresulttype"` /* PG_TYPE OID of result value */
	Funcretset     bool `json:"funcretset"`     /* true if function returns set */
	Funcvariadic   bool `json:"funcvariadic"`   /* true if variadic arguments have been
	 * combined into an array last argument */

	Funcformat  CoercionForm `json:"funcformat"`  /* how to display this function call */
	Funccollid  Oid          `json:"funccollid"`  /* OID of collation of result */
	Inputcollid Oid          `json:"inputcollid"` /* OID of collation that function should use */
	Args        List         `json:"args"`        /* arguments to the function */
	Location    int          `json:"location"`    /* token location, or -1 if unknown */
}

* FuncExpr - expression node for a function call

func (FuncExpr) Deparse ¶

func (node FuncExpr) Deparse(ctx Context) (*string, error)

func (FuncExpr) Fingerprint ¶

func (node FuncExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (FuncExpr) MarshalJSON ¶

func (node FuncExpr) MarshalJSON() ([]byte, error)

func (*FuncExpr) UnmarshalJSON ¶

func (node *FuncExpr) UnmarshalJSON(input []byte) (err error)

type FunctionParameter ¶

type FunctionParameter struct {
	Name    *string               `json:"name"`    /* parameter name, or NULL if not given */
	ArgType *TypeName             `json:"argType"` /* TypeName for parameter type */
	Mode    FunctionParameterMode `json:"mode"`    /* IN/OUT/etc */
	Defexpr Node                  `json:"defexpr"` /* raw default expr, or NULL if not given */
}

---------------------- * Create Function Statement * ----------------------

func (FunctionParameter) Deparse ¶

func (node FunctionParameter) Deparse(ctx Context) (*string, error)

func (FunctionParameter) Fingerprint ¶

func (node FunctionParameter) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (FunctionParameter) MarshalJSON ¶

func (node FunctionParameter) MarshalJSON() ([]byte, error)

func (*FunctionParameter) UnmarshalJSON ¶

func (node *FunctionParameter) UnmarshalJSON(input []byte) (err error)

type FunctionParameterMode ¶

type FunctionParameterMode uint
const (
	/* the assigned enum values appear in pg_proc, don't change 'em! */
	FUNC_PARAM_IN FunctionParameterMode = iota
	FUNC_PARAM_OUT
	FUNC_PARAM_INOUT
	FUNC_PARAM_VARIADIC
	FUNC_PARAM_TABLE
)

type GrantObjectType ¶

type GrantObjectType uint
const (
	ACL_OBJECT_COLUMN         GrantObjectType = iota /* column */
	ACL_OBJECT_RELATION                              /* table, view */
	ACL_OBJECT_SEQUENCE                              /* sequence */
	ACL_OBJECT_DATABASE                              /* database */
	ACL_OBJECT_DOMAIN                                /* domain */
	ACL_OBJECT_FDW                                   /* foreign-data wrapper */
	ACL_OBJECT_FOREIGN_SERVER                        /* foreign server */
	ACL_OBJECT_FUNCTION                              /* function */
	ACL_OBJECT_LANGUAGE                              /* procedural language */
	ACL_OBJECT_LARGEOBJECT                           /* largeobject */
	ACL_OBJECT_NAMESPACE                             /* namespace */
	ACL_OBJECT_TABLESPACE                            /* tablespace */
	ACL_OBJECT_TYPE                                  /* type */
)

type GrantRoleStmt ¶

type GrantRoleStmt struct {
	GrantedRoles List         `json:"granted_roles"` /* list of roles to be granted/revoked */
	GranteeRoles List         `json:"grantee_roles"` /* list of member roles to add/delete */
	IsGrant      bool         `json:"is_grant"`      /* true = GRANT, false = REVOKE */
	AdminOpt     bool         `json:"admin_opt"`     /* with admin option */
	Grantor      *RoleSpec    `json:"grantor"`       /* set grantor to other than current role */
	Behavior     DropBehavior `json:"behavior"`      /* drop behavior (for REVOKE) */
}

---------------------- * Grant/Revoke Role Statement * * Note: because of the parsing ambiguity with the GRANT <privileges> * statement, granted_roles is a list of AccessPriv; the execution code * should complain if any column lists appear. grantee_roles is a list * of role names, as Value strings. * ----------------------

func (GrantRoleStmt) Deparse ¶

func (node GrantRoleStmt) Deparse(ctx Context) (*string, error)

func (GrantRoleStmt) Fingerprint ¶

func (node GrantRoleStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (GrantRoleStmt) MarshalJSON ¶

func (node GrantRoleStmt) MarshalJSON() ([]byte, error)

func (*GrantRoleStmt) UnmarshalJSON ¶

func (node *GrantRoleStmt) UnmarshalJSON(input []byte) (err error)

type GrantStmt ¶

type GrantStmt struct {
	IsGrant  bool            `json:"is_grant"` /* true = GRANT, false = REVOKE */
	Targtype GrantTargetType `json:"targtype"` /* type of the grant target */
	Objtype  GrantObjectType `json:"objtype"`  /* kind of object being operated on */
	Objects  List            `json:"objects"`  /* list of RangeVar nodes, ObjectWithArgs
	 * nodes, or plain names (as Value strings) */

	Privileges List `json:"privileges"` /* list of AccessPriv nodes */

	/* privileges == NIL denotes ALL PRIVILEGES */
	Grantees    List         `json:"grantees"`     /* list of RoleSpec nodes */
	GrantOption bool         `json:"grant_option"` /* grant or revoke grant option */
	Behavior    DropBehavior `json:"behavior"`     /* drop behavior (for REVOKE) */
}

---------------------- * Grant|Revoke Statement * ----------------------

func (GrantStmt) Deparse ¶

func (node GrantStmt) Deparse(ctx Context) (*string, error)

func (GrantStmt) Fingerprint ¶

func (node GrantStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (GrantStmt) MarshalJSON ¶

func (node GrantStmt) MarshalJSON() ([]byte, error)

func (*GrantStmt) UnmarshalJSON ¶

func (node *GrantStmt) UnmarshalJSON(input []byte) (err error)

type GrantTargetType ¶

type GrantTargetType uint

---------------------- * Grant|Revoke Statement * ----------------------

const (
	ACL_TARGET_OBJECT        GrantTargetType = iota /* grant on specific named object(s) */
	ACL_TARGET_ALL_IN_SCHEMA                        /* grant on all objects in given schema(s) */
	ACL_TARGET_DEFAULTS                             /* ALTER DEFAULT PRIVILEGES */
)

type GroupingFunc ¶

type GroupingFunc struct {
	Xpr  Node `json:"xpr"`
	Args List `json:"args"` /* arguments, not evaluated but kept for
	 * benefit of EXPLAIN etc. */

	Refs        List  `json:"refs"`        /* ressortgrouprefs of arguments */
	Cols        List  `json:"cols"`        /* actual column positions set by planner */
	Agglevelsup Index `json:"agglevelsup"` /* same as Aggref.agglevelsup */
	Location    int   `json:"location"`    /* token location */
}

* GroupingFunc * * A GroupingFunc is a GROUPING(...) expression, which behaves in many ways * like an aggregate function (e.g. it "belongs" to a specific query level, * which might not be the one immediately containing it), but also differs in * an important respect: it never evaluates its arguments, they merely * designate expressions from the GROUP BY clause of the query level to which * it belongs. * * The spec defines the evaluation of GROUPING() purely by syntactic * replacement, but we make it a real expression for optimization purposes so * that one Agg node can handle multiple grouping sets at once. Evaluating the * result only needs the column positions to check against the grouping set * being projected. However, for EXPLAIN to produce meaningful output, we have * to keep the original expressions around, since expression deparse does not * give us any feasible way to get at the GROUP BY clause. * * Also, we treat two GroupingFunc nodes as equal if they have equal arguments * lists and agglevelsup, without comparing the refs and cols annotations. * * In raw parse output we have only the args list; parse analysis fills in the * refs list, and the planner fills in the cols list.

func (GroupingFunc) Deparse ¶

func (node GroupingFunc) Deparse(ctx Context) (*string, error)

func (GroupingFunc) Fingerprint ¶

func (node GroupingFunc) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (GroupingFunc) MarshalJSON ¶

func (node GroupingFunc) MarshalJSON() ([]byte, error)

func (*GroupingFunc) UnmarshalJSON ¶

func (node *GroupingFunc) UnmarshalJSON(input []byte) (err error)

type GroupingSet ¶

type GroupingSet struct {
	Kind     GroupingSetKind `json:"kind"`
	Content  List            `json:"content"`
	Location int             `json:"location"`
}

func (GroupingSet) Deparse ¶

func (node GroupingSet) Deparse(ctx Context) (*string, error)

func (GroupingSet) Fingerprint ¶

func (node GroupingSet) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (GroupingSet) MarshalJSON ¶

func (node GroupingSet) MarshalJSON() ([]byte, error)

func (*GroupingSet) UnmarshalJSON ¶

func (node *GroupingSet) UnmarshalJSON(input []byte) (err error)

type GroupingSetKind ¶

type GroupingSetKind uint

* GroupingSet - * representation of CUBE, ROLLUP and GROUPING SETS clauses * * In a Query with grouping sets, the groupClause contains a flat list of * SortGroupClause nodes for each distinct expression used. The actual * structure of the GROUP BY clause is given by the groupingSets tree. * * In the raw parser output, GroupingSet nodes (of all types except SIMPLE * which is not used) are potentially mixed in with the expressions in the * groupClause of the SelectStmt. (An expression can't contain a GroupingSet, * but a list may mix GroupingSet and expression nodes.) At this stage, the * content of each node is a list of expressions, some of which may be RowExprs * which represent sublists rather than actual row constructors, and nested * GroupingSet nodes where legal in the grammar. The structure directly * reflects the query syntax. * * In parse analysis, the transformed expressions are used to build the tlist * and groupClause list (of SortGroupClause nodes), and the groupingSets tree * is eventually reduced to a fixed format: * * EMPTY nodes represent (), and obviously have no content * * SIMPLE nodes represent a list of one or more expressions to be treated as an * atom by the enclosing structure; the content is an integer list of * ressortgroupref values (see SortGroupClause) * * CUBE and ROLLUP nodes contain a list of one or more SIMPLE nodes. * * SETS nodes contain a list of EMPTY, SIMPLE, CUBE or ROLLUP nodes, but after * parse analysis they cannot contain more SETS nodes; enough of the syntactic * transforms of the spec have been applied that we no longer have arbitrarily * deep nesting (though we still preserve the use of cube/rollup). * * Note that if the groupingSets tree contains no SIMPLE nodes (only EMPTY * nodes at the leaves), then the groupClause will be empty, but this is still * an aggregation query (similar to using aggs or HAVING without GROUP BY). * * As an example, the following clause: * * GROUP BY GROUPING SETS ((a,b), CUBE(c,(d,e))) * * looks like this after raw parsing: * * SETS( RowExpr(a,b) , CUBE( c, RowExpr(d,e) ) ) * * and parse analysis converts it to: * * SETS( SIMPLE(1,2), CUBE( SIMPLE(3), SIMPLE(4,5) ) )

const (
	GROUPING_SET_EMPTY GroupingSetKind = iota
	GROUPING_SET_SIMPLE
	GROUPING_SET_ROLLUP
	GROUPING_SET_CUBE
	GROUPING_SET_SETS
)

type ImportForeignSchemaStmt ¶

type ImportForeignSchemaStmt struct {
	ServerName   *string                 `json:"server_name"`   /* FDW server name */
	RemoteSchema *string                 `json:"remote_schema"` /* remote schema name to query */
	LocalSchema  *string                 `json:"local_schema"`  /* local schema to create objects in */
	ListType     ImportForeignSchemaType `json:"list_type"`     /* type of table list */
	TableList    List                    `json:"table_list"`    /* List of RangeVar */
	Options      List                    `json:"options"`       /* list of options to pass to FDW */
}

func (ImportForeignSchemaStmt) Deparse ¶

func (node ImportForeignSchemaStmt) Deparse(ctx Context) (*string, error)

func (ImportForeignSchemaStmt) Fingerprint ¶

func (node ImportForeignSchemaStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ImportForeignSchemaStmt) MarshalJSON ¶

func (node ImportForeignSchemaStmt) MarshalJSON() ([]byte, error)

func (*ImportForeignSchemaStmt) UnmarshalJSON ¶

func (node *ImportForeignSchemaStmt) UnmarshalJSON(input []byte) (err error)

type ImportForeignSchemaType ¶

type ImportForeignSchemaType uint

---------------------- * Import Foreign Schema Statement * ----------------------

const (
	FDW_IMPORT_SCHEMA_ALL      ImportForeignSchemaType = iota /* all relations wanted */
	FDW_IMPORT_SCHEMA_LIMIT_TO                                /* include only listed tables in import */
	FDW_IMPORT_SCHEMA_EXCEPT                                  /* exclude listed tables from import */
)

type Index ¶

type Index uint64

type IndexElem ¶

type IndexElem struct {
	Name          *string     `json:"name"`           /* name of attribute to index, or NULL */
	Expr          Node        `json:"expr"`           /* expression to index, or NULL */
	Indexcolname  *string     `json:"indexcolname"`   /* name for index column; NULL = default */
	Collation     List        `json:"collation"`      /* name of collation; NIL = default */
	Opclass       List        `json:"opclass"`        /* name of desired opclass; NIL = default */
	Ordering      SortByDir   `json:"ordering"`       /* ASC/DESC/default */
	NullsOrdering SortByNulls `json:"nulls_ordering"` /* FIRST/LAST/default */
}

* IndexElem - index parameters (used in CREATE INDEX, and in ON CONFLICT) * * For a plain index attribute, 'name' is the name of the table column to * index, and 'expr' is NULL. For an index expression, 'name' is NULL and * 'expr' is the expression tree.

func (IndexElem) Deparse ¶

func (node IndexElem) Deparse(ctx Context) (*string, error)

func (IndexElem) Fingerprint ¶

func (node IndexElem) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (IndexElem) MarshalJSON ¶

func (node IndexElem) MarshalJSON() ([]byte, error)

func (*IndexElem) UnmarshalJSON ¶

func (node *IndexElem) UnmarshalJSON(input []byte) (err error)

type IndexStmt ¶

type IndexStmt struct {
	Idxname        *string   `json:"idxname"`        /* name of new index, or NULL for default */
	Relation       *RangeVar `json:"relation"`       /* relation to build index on */
	AccessMethod   *string   `json:"accessMethod"`   /* name of access method (eg. btree) */
	TableSpace     *string   `json:"tableSpace"`     /* tablespace, or NULL for default */
	IndexParams    List      `json:"indexParams"`    /* columns to index: a list of IndexElem */
	Options        List      `json:"options"`        /* WITH clause options: a list of DefElem */
	WhereClause    Node      `json:"whereClause"`    /* qualification (partial-index predicate) */
	ExcludeOpNames List      `json:"excludeOpNames"` /* exclusion operator names, or NIL if none */
	Idxcomment     *string   `json:"idxcomment"`     /* comment to apply to index, or NULL */
	IndexOid       Oid       `json:"indexOid"`       /* OID of an existing index, if any */
	OldNode        Oid       `json:"oldNode"`        /* relfilenode of existing storage, if any */
	Unique         bool      `json:"unique"`         /* is index unique? */
	Primary        bool      `json:"primary"`        /* is index a primary key? */
	Isconstraint   bool      `json:"isconstraint"`   /* is it for a pkey/unique constraint? */
	Deferrable     bool      `json:"deferrable"`     /* is the constraint DEFERRABLE? */
	Initdeferred   bool      `json:"initdeferred"`   /* is the constraint INITIALLY DEFERRED? */
	Transformed    bool      `json:"transformed"`    /* true when transformIndexStmt is finished */
	Concurrent     bool      `json:"concurrent"`     /* should this be a concurrent index build? */
	IfNotExists    bool      `json:"if_not_exists"`  /* just do nothing if index already exists? */
}

---------------------- * Create Index Statement * * This represents creation of an index and/or an associated constraint. * If isconstraint is true, we should create a pg_constraint entry along * with the index. But if indexOid isn't InvalidOid, we are not creating an * index, just a UNIQUE/PKEY constraint using an existing index. isconstraint * must always be true in this case, and the fields describing the index * properties are empty. * ----------------------

func (IndexStmt) Deparse ¶

func (node IndexStmt) Deparse(ctx Context) (*string, error)

func (IndexStmt) Fingerprint ¶

func (node IndexStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (IndexStmt) MarshalJSON ¶

func (node IndexStmt) MarshalJSON() ([]byte, error)

func (*IndexStmt) UnmarshalJSON ¶

func (node *IndexStmt) UnmarshalJSON(input []byte) (err error)

type InferClause ¶

type InferClause struct {
	IndexElems  List    `json:"indexElems"`  /* IndexElems to infer unique index */
	WhereClause Node    `json:"whereClause"` /* qualification (partial-index predicate) */
	Conname     *string `json:"conname"`     /* Constraint name, or NULL if unnamed */
	Location    int     `json:"location"`    /* token location, or -1 if unknown */
}

* InferClause - * ON CONFLICT unique index inference clause * * Note: InferClause does not propagate into the Query representation.

func (InferClause) Deparse ¶

func (node InferClause) Deparse(ctx Context) (*string, error)

func (InferClause) Fingerprint ¶

func (node InferClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (InferClause) MarshalJSON ¶

func (node InferClause) MarshalJSON() ([]byte, error)

func (*InferClause) UnmarshalJSON ¶

func (node *InferClause) UnmarshalJSON(input []byte) (err error)

type InferenceElem ¶

type InferenceElem struct {
	Xpr          Node `json:"xpr"`
	Expr         Node `json:"expr"`         /* expression to infer from, or NULL */
	Infercollid  Oid  `json:"infercollid"`  /* OID of collation, or InvalidOid */
	Inferopclass Oid  `json:"inferopclass"` /* OID of att opclass, or InvalidOid */
}

* InferenceElem - an element of a unique index inference specification * * This mostly matches the structure of IndexElems, but having a dedicated * primnode allows for a clean separation between the use of index parameters * by utility commands, and this node.

func (InferenceElem) Deparse ¶

func (node InferenceElem) Deparse(ctx Context) (*string, error)

func (InferenceElem) Fingerprint ¶

func (node InferenceElem) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (InferenceElem) MarshalJSON ¶

func (node InferenceElem) MarshalJSON() ([]byte, error)

func (*InferenceElem) UnmarshalJSON ¶

func (node *InferenceElem) UnmarshalJSON(input []byte) (err error)

type InlineCodeBlock ¶

type InlineCodeBlock struct {
	SourceText    *string `json:"source_text"`   /* source text of anonymous code block */
	LangOid       Oid     `json:"langOid"`       /* OID of selected language */
	LangIsTrusted bool    `json:"langIsTrusted"` /* trusted property of the language */
}

---------------------- * DO Statement * * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API * ----------------------

func (InlineCodeBlock) Deparse ¶

func (node InlineCodeBlock) Deparse(ctx Context) (*string, error)

func (InlineCodeBlock) Fingerprint ¶

func (node InlineCodeBlock) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (InlineCodeBlock) MarshalJSON ¶

func (node InlineCodeBlock) MarshalJSON() ([]byte, error)

func (*InlineCodeBlock) UnmarshalJSON ¶

func (node *InlineCodeBlock) UnmarshalJSON(input []byte) (err error)

type InsertStmt ¶

type InsertStmt struct {
	Stmt
	Relation         *RangeVar         `json:"relation"`         /* relation to insert into */
	Cols             List              `json:"cols"`             /* optional: names of the target columns */
	SelectStmt       Node              `json:"selectStmt"`       /* the source SELECT/VALUES, or NULL */
	OnConflictClause *OnConflictClause `json:"onConflictClause"` /* ON CONFLICT clause */
	ReturningList    List              `json:"returningList"`    /* list of expressions to return */
	WithClause       *WithClause       `json:"withClause"`       /* WITH clause */
	Override         OverridingKind    `json:"override"`         /* OVERRIDING clause */
}

---------------------- * Insert Statement * * The source expression is represented by SelectStmt for both the * SELECT and VALUES cases. If selectStmt is NULL, then the query * is INSERT ... DEFAULT VALUES. * ----------------------

func (InsertStmt) Deparse ¶

func (node InsertStmt) Deparse(ctx Context) (*string, error)

func (InsertStmt) Fingerprint ¶

func (node InsertStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (InsertStmt) MarshalJSON ¶

func (node InsertStmt) MarshalJSON() ([]byte, error)

func (InsertStmt) StatementTag ¶

func (node InsertStmt) StatementTag() string

func (InsertStmt) StatementType ¶

func (node InsertStmt) StatementType() StmtType

func (*InsertStmt) UnmarshalJSON ¶

func (node *InsertStmt) UnmarshalJSON(input []byte) (err error)

type Integer ¶

type Integer struct {
	Ival int64 `json:"ival"`
}

func (Integer) Deparse ¶

func (node Integer) Deparse(ctx Context) (*string, error)

func (Integer) Fingerprint ¶

func (node Integer) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Integer) MarshalJSON ¶

func (node Integer) MarshalJSON() ([]byte, error)

func (*Integer) UnmarshalJSON ¶

func (node *Integer) UnmarshalJSON(input []byte) (err error)

type IntoClause ¶

type IntoClause struct {
	Rel            *RangeVar      `json:"rel"`            /* target relation name */
	ColNames       List           `json:"colNames"`       /* column names to assign, or NIL */
	Options        List           `json:"options"`        /* options from WITH clause */
	OnCommit       OnCommitAction `json:"onCommit"`       /* what do we do at COMMIT? */
	TableSpaceName *string        `json:"tableSpaceName"` /* table space to use, or NULL */
	ViewQuery      Node           `json:"viewQuery"`      /* materialized view's SELECT query */
	SkipData       bool           `json:"skipData"`       /* true for WITH NO DATA */
}

* IntoClause - target information for SELECT INTO, CREATE TABLE AS, and * CREATE MATERIALIZED VIEW * * For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten * SELECT Query for the view; otherwise it's NULL. (Although it's actually * Query*, we declare it as Node* to avoid a forward reference.)

func (IntoClause) Deparse ¶

func (node IntoClause) Deparse(ctx Context) (*string, error)

func (IntoClause) Fingerprint ¶

func (node IntoClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (IntoClause) MarshalJSON ¶

func (node IntoClause) MarshalJSON() ([]byte, error)

func (*IntoClause) UnmarshalJSON ¶

func (node *IntoClause) UnmarshalJSON(input []byte) (err error)

type JoinExpr ¶

type JoinExpr struct {
	Jointype    JoinType `json:"jointype"`    /* type of join */
	IsNatural   bool     `json:"isNatural"`   /* Natural join? Will need to shape table */
	Larg        Node     `json:"larg"`        /* left subtree */
	Rarg        Node     `json:"rarg"`        /* right subtree */
	UsingClause List     `json:"usingClause"` /* USING clause, if any (list of String) */
	Quals       Node     `json:"quals"`       /* qualifiers on join, if any */
	Alias       *Alias   `json:"alias"`       /* user-written alias clause, if any */
	Rtindex     int      `json:"rtindex"`     /* RT index assigned for join, or 0 */
}

----------

  • JoinExpr - for SQL JOIN expressions *
  • isNatural, usingClause, and quals are interdependent. The user can write
  • only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
  • If he writes NATURAL then parse analysis generates the equivalent USING()
  • list, and from that fills in "quals" with the right equality comparisons.
  • If he writes USING() then "quals" is filled with equality comparisons.
  • If he writes ON() then only "quals" is set. Note that NATURAL/USING
  • are not equivalent to ON() since they also affect the output column list. *
  • alias is an Alias node representing the AS alias-clause attached to the
  • join expression, or NULL if no clause. NB: presence or absence of the
  • alias has a critical impact on semantics, because a join with an alias
  • restricts visibility of the tables/columns inside it. *
  • During parse analysis, an RTE is created for the Join, and its index
  • is filled into rtindex. This RTE is present mainly so that Vars can
  • be created that refer to the outputs of the join. The planner sometimes
  • generates JoinExprs internally; these can have rtindex = 0 if there are
  • no join alias variables referencing such joins. *----------

func (JoinExpr) Deparse ¶

func (node JoinExpr) Deparse(ctx Context) (*string, error)

func (JoinExpr) Fingerprint ¶

func (node JoinExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (JoinExpr) MarshalJSON ¶

func (node JoinExpr) MarshalJSON() ([]byte, error)

func (*JoinExpr) UnmarshalJSON ¶

func (node *JoinExpr) UnmarshalJSON(input []byte) (err error)

type JoinType ¶

type JoinType uint

* JoinType - * enums for types of relation joins * * JoinType determines the exact semantics of joining two relations using * a matching qualification. For example, it tells what to do with a tuple * that has no match in the other relation. * * This is needed in both parsenodes.h and plannodes.h, so put it here...

const (
	/*
	 * The canonical kinds of joins according to the SQL JOIN syntax. Only
	 * these codes can appear in parser output (e.g., JoinExpr nodes).
	 */
	JOIN_INNER JoinType = iota /* matching tuple pairs only */
	JOIN_LEFT                  /* pairs + unmatched LHS tuples */
	JOIN_FULL                  /* pairs + unmatched LHS + unmatched RHS */
	JOIN_RIGHT                 /* pairs + unmatched RHS tuples */

	/*
	 * Semijoins and anti-semijoins (as defined in relational theory) do not
	 * appear in the SQL JOIN syntax, but there are standard idioms for
	 * representing them (e.g., using EXISTS).  The planner recognizes these
	 * cases and converts them to joins.  So the planner and executor must
	 * support these codes.  NOTE: in JOIN_SEMI output, it is unspecified
	 * which matching RHS row is joined to.  In JOIN_ANTI output, the row is
	 * guaranteed to be null-extended.
	 */
	JOIN_SEMI /* 1 copy of each LHS row that has match(es) */
	JOIN_ANTI /* 1 copy of each LHS row that has no match */

	/*
	 * These codes are used internally in the planner, but are not supported
	 * by the executor (nor, indeed, by most of the planner).
	 */
	JOIN_UNIQUE_OUTER /* LHS path must be made unique */
	JOIN_UNIQUE_INNER /* RHS path must be made unique */

)

type List ¶

type List struct {
	Items []Node `json:"items"`
}

func (List) Deparse ¶

func (node List) Deparse(ctx Context) (*string, error)

func (List) DeparseList ¶

func (list List) DeparseList(ctx Context) ([]string, error)

func (List) Fingerprint ¶

func (node List) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (List) MarshalJSON ¶

func (node List) MarshalJSON() ([]byte, error)

func (*List) UnmarshalJSON ¶

func (node *List) UnmarshalJSON(input []byte) (err error)

type ListenStmt ¶

type ListenStmt struct {
	Conditionname *string `json:"conditionname"` /* condition name to listen on */
}

---------------------- * Listen Statement * ----------------------

func (ListenStmt) Deparse ¶

func (node ListenStmt) Deparse(ctx Context) (*string, error)

func (ListenStmt) Fingerprint ¶

func (node ListenStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ListenStmt) MarshalJSON ¶

func (node ListenStmt) MarshalJSON() ([]byte, error)

func (*ListenStmt) UnmarshalJSON ¶

func (node *ListenStmt) UnmarshalJSON(input []byte) (err error)

type LoadStmt ¶

type LoadStmt struct {
	Filename *string `json:"filename"` /* file to load */
}

---------------------- * Load Statement * ----------------------

func (LoadStmt) Deparse ¶

func (node LoadStmt) Deparse(ctx Context) (*string, error)

func (LoadStmt) Fingerprint ¶

func (node LoadStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (LoadStmt) MarshalJSON ¶

func (node LoadStmt) MarshalJSON() ([]byte, error)

func (*LoadStmt) UnmarshalJSON ¶

func (node *LoadStmt) UnmarshalJSON(input []byte) (err error)

type LocalTransactionId ¶

type LocalTransactionId uint32

type LockClauseStrength ¶

type LockClauseStrength uint

* This enum represents the different strengths of FOR UPDATE/SHARE clauses. * The ordering here is important, because the highest numerical value takes * precedence when a RTE is specified multiple ways. See applyLockingClause.

const (
	LCS_NONE           LockClauseStrength = iota /* no such clause - only used in PlanRowMark */
	LCS_FORKEYSHARE                              /* FOR KEY SHARE */
	LCS_FORSHARE                                 /* FOR SHARE */
	LCS_FORNOKEYUPDATE                           /* FOR NO KEY UPDATE */
	LCS_FORUPDATE                                /* FOR UPDATE */
)

type LockStmt ¶

type LockStmt struct {
	Relations List `json:"relations"` /* relations to lock */
	Mode      int  `json:"mode"`      /* lock mode */
	Nowait    bool `json:"nowait"`    /* no wait mode */
}

---------------------- * LOCK Statement * ----------------------

func (LockStmt) Deparse ¶

func (node LockStmt) Deparse(ctx Context) (*string, error)

func (LockStmt) Fingerprint ¶

func (node LockStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (LockStmt) MarshalJSON ¶

func (node LockStmt) MarshalJSON() ([]byte, error)

func (*LockStmt) UnmarshalJSON ¶

func (node *LockStmt) UnmarshalJSON(input []byte) (err error)

type LockWaitPolicy ¶

type LockWaitPolicy uint

* This enum controls how to deal with rows being locked by FOR UPDATE/SHARE * clauses (i.e., it represents the NOWAIT and SKIP LOCKED options). * The ordering here is important, because the highest numerical value takes * precedence when a RTE is specified multiple ways. See applyLockingClause.

const (
	/* Wait for the lock to become available (default behavior) */
	LockWaitBlock LockWaitPolicy = iota

	/* Skip rows that can't be locked (SKIP LOCKED) */
	LockWaitSkip

	/* Raise an error if a row cannot be locked (NOWAIT) */
	LockWaitError
)

type LockingClause ¶

type LockingClause struct {
	LockedRels List               `json:"lockedRels"` /* FOR [KEY] UPDATE/SHARE relations */
	Strength   LockClauseStrength `json:"strength"`
	WaitPolicy LockWaitPolicy     `json:"waitPolicy"` /* NOWAIT and SKIP LOCKED */
}

* LockingClause - raw representation of FOR [NO KEY] UPDATE/[KEY] SHARE * options * * Note: lockedRels == NIL means "all relations in query". Otherwise it * is a list of RangeVar nodes. (We use RangeVar mainly because it carries * a location field --- currently, parse analysis insists on unqualified * names in LockingClause.)

func (LockingClause) Deparse ¶

func (node LockingClause) Deparse(ctx Context) (*string, error)

func (LockingClause) Fingerprint ¶

func (node LockingClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (LockingClause) MarshalJSON ¶

func (node LockingClause) MarshalJSON() ([]byte, error)

func (*LockingClause) UnmarshalJSON ¶

func (node *LockingClause) UnmarshalJSON(input []byte) (err error)

type MinMaxExpr ¶

type MinMaxExpr struct {
	Xpr          Node     `json:"xpr"`
	Minmaxtype   Oid      `json:"minmaxtype"`   /* common type of arguments and result */
	Minmaxcollid Oid      `json:"minmaxcollid"` /* OID of collation of result */
	Inputcollid  Oid      `json:"inputcollid"`  /* OID of collation that function should use */
	Op           MinMaxOp `json:"op"`           /* function to execute */
	Args         List     `json:"args"`         /* the arguments */
	Location     int      `json:"location"`     /* token location, or -1 if unknown */
}

* MinMaxExpr - a GREATEST or LEAST function

func (MinMaxExpr) Deparse ¶

func (node MinMaxExpr) Deparse(ctx Context) (*string, error)

func (MinMaxExpr) Fingerprint ¶

func (node MinMaxExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (MinMaxExpr) MarshalJSON ¶

func (node MinMaxExpr) MarshalJSON() ([]byte, error)

func (*MinMaxExpr) UnmarshalJSON ¶

func (node *MinMaxExpr) UnmarshalJSON(input []byte) (err error)

type MinMaxOp ¶

type MinMaxOp uint

* MinMaxExpr - a GREATEST or LEAST function

const (
	IS_GREATEST MinMaxOp = iota
	IS_LEAST
)

type MultiAssignRef ¶

type MultiAssignRef struct {
	Source   Node `json:"source"`   /* the row-valued expression */
	Colno    int  `json:"colno"`    /* column number for this target (1..n) */
	Ncolumns int  `json:"ncolumns"` /* number of targets in the construct */
}

* MultiAssignRef - element of a row source expression for UPDATE * * In an UPDATE target list, when we have SET (a,b,c) = row-valued-expression, * we generate separate ResTarget items for each of a,b,c. Their "val" trees * are MultiAssignRef nodes numbered 1..n, linking to a common copy of the * row-valued-expression (which parse analysis will process only once, when * handling the MultiAssignRef with colno=1).

func (MultiAssignRef) Deparse ¶

func (node MultiAssignRef) Deparse(ctx Context) (*string, error)

func (MultiAssignRef) Fingerprint ¶

func (node MultiAssignRef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (MultiAssignRef) MarshalJSON ¶

func (node MultiAssignRef) MarshalJSON() ([]byte, error)

func (*MultiAssignRef) UnmarshalJSON ¶

func (node *MultiAssignRef) UnmarshalJSON(input []byte) (err error)

type MultiXactId ¶

type MultiXactId TransactionId

type MultiXactOffset ¶

type MultiXactOffset uint32

type Name ¶

type Name *string

type NamedArgExpr ¶

type NamedArgExpr struct {
	Xpr       Node    `json:"xpr"`
	Arg       Node    `json:"arg"`       /* the argument expression */
	Name      *string `json:"name"`      /* the name */
	Argnumber int     `json:"argnumber"` /* argument's number in positional notation */
	Location  int     `json:"location"`  /* argument name location, or -1 if unknown */
}

* NamedArgExpr - a named argument of a function * * This node type can only appear in the args list of a FuncCall or FuncExpr * node. We support pure positional call notation (no named arguments), * named notation (all arguments are named), and mixed notation (unnamed * arguments followed by named ones). * * Parse analysis sets argnumber to the positional index of the argument, * but doesn't rearrange the argument list. * * The planner will convert argument lists to pure positional notation * during expression preprocessing, so execution never sees a NamedArgExpr.

func (NamedArgExpr) Deparse ¶

func (node NamedArgExpr) Deparse(ctx Context) (*string, error)

func (NamedArgExpr) Fingerprint ¶

func (node NamedArgExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (NamedArgExpr) MarshalJSON ¶

func (node NamedArgExpr) MarshalJSON() ([]byte, error)

func (*NamedArgExpr) UnmarshalJSON ¶

func (node *NamedArgExpr) UnmarshalJSON(input []byte) (err error)

type NextValueExpr ¶

type NextValueExpr struct {
	Xpr    Node `json:"xpr"`
	Seqid  Oid  `json:"seqid"`
	TypeId Oid  `json:"typeId"`
}

* NextValueExpr - get next value from sequence * * This has the same effect as calling the nextval() function, but it does not * check permissions on the sequence. This is used for identity columns, * where the sequence is an implicit dependency without its own permissions.

func (NextValueExpr) Deparse ¶

func (node NextValueExpr) Deparse(ctx Context) (*string, error)

func (NextValueExpr) Fingerprint ¶

func (node NextValueExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (NextValueExpr) MarshalJSON ¶

func (node NextValueExpr) MarshalJSON() ([]byte, error)

func (*NextValueExpr) UnmarshalJSON ¶

func (node *NextValueExpr) UnmarshalJSON(input []byte) (err error)

type Node ¶

type Node interface {
	Deparse(ctx Context) (*string, error)
	Fingerprint(FingerprintContext, Node, string)
}

func UnmarshalNodeArrayJSON ¶

func UnmarshalNodeArrayJSON(input json.RawMessage) (nodes []Node, err error)

func UnmarshalNodeJSON ¶

func UnmarshalNodeJSON(input json.RawMessage) (node Node, err error)

func UnmarshalNodePtrJSON ¶

func UnmarshalNodePtrJSON(input json.RawMessage) (nodePtr *Node, err error)

type NotifyStmt ¶

type NotifyStmt struct {
	Conditionname *string `json:"conditionname"` /* condition name to notify */
	Payload       *string `json:"payload"`       /* the payload string, or NULL if none */
}

---------------------- * Notify Statement * ----------------------

func (NotifyStmt) Deparse ¶

func (node NotifyStmt) Deparse(ctx Context) (*string, error)

func (NotifyStmt) Fingerprint ¶

func (node NotifyStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (NotifyStmt) MarshalJSON ¶

func (node NotifyStmt) MarshalJSON() ([]byte, error)

func (*NotifyStmt) UnmarshalJSON ¶

func (node *NotifyStmt) UnmarshalJSON(input []byte) (err error)

type Null ¶

type Null struct {
}

func (Null) Deparse ¶

func (node Null) Deparse(ctx Context) (*string, error)

func (Null) Fingerprint ¶

func (node Null) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Null) MarshalJSON ¶

func (node Null) MarshalJSON() ([]byte, error)

func (*Null) UnmarshalJSON ¶

func (node *Null) UnmarshalJSON(input []byte) (err error)

type NullIfExpr ¶

type NullIfExpr OpExpr

type NullTest ¶

type NullTest struct {
	Xpr          Node         `json:"xpr"`
	Arg          Node         `json:"arg"`          /* input expression */
	Nulltesttype NullTestType `json:"nulltesttype"` /* IS NULL, IS NOT NULL */
	Argisrow     bool         `json:"argisrow"`     /* T to perform field-by-field null checks */
	Location     int          `json:"location"`     /* token location, or -1 if unknown */
}

---------------- * NullTest * * NullTest represents the operation of testing a value for NULLness. * The appropriate test is performed and returned as a boolean Datum. * * When argisrow is false, this simply represents a test for the null value. * * When argisrow is true, the input expression must yield a rowtype, and * the node implements "row IS [NOT] NULL" per the SQL standard. This * includes checking individual fields for NULLness when the row datum * itself isn't NULL. * * NOTE: the combination of a rowtype input and argisrow==false does NOT * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL". * ----------------

func (NullTest) Deparse ¶

func (node NullTest) Deparse(ctx Context) (*string, error)

func (NullTest) Fingerprint ¶

func (node NullTest) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (NullTest) MarshalJSON ¶

func (node NullTest) MarshalJSON() ([]byte, error)

func (*NullTest) UnmarshalJSON ¶

func (node *NullTest) UnmarshalJSON(input []byte) (err error)

type NullTestType ¶

type NullTestType uint

---------------- * NullTest * * NullTest represents the operation of testing a value for NULLness. * The appropriate test is performed and returned as a boolean Datum. * * When argisrow is false, this simply represents a test for the null value. * * When argisrow is true, the input expression must yield a rowtype, and * the node implements "row IS [NOT] NULL" per the SQL standard. This * includes checking individual fields for NULLness when the row datum * itself isn't NULL. * * NOTE: the combination of a rowtype input and argisrow==false does NOT * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL". * ----------------

const (
	IS_NULL NullTestType = iota
	IS_NOT_NULL
)

type ObjectType ¶

type ObjectType uint

* When a command can act on several kinds of objects with only one * parse structure required, use these constants to designate the * object type. Note that commands typically don't support all the types.

const (
	OBJECT_ACCESS_METHOD ObjectType = iota
	OBJECT_AGGREGATE
	OBJECT_AMOP
	OBJECT_AMPROC
	OBJECT_ATTRIBUTE /* type's attribute, when distinct from column */
	OBJECT_CAST
	OBJECT_COLUMN
	OBJECT_COLLATION
	OBJECT_CONVERSION
	OBJECT_DATABASE
	OBJECT_DEFAULT
	OBJECT_DEFACL
	OBJECT_DOMAIN
	OBJECT_DOMCONSTRAINT
	OBJECT_EVENT_TRIGGER
	OBJECT_EXTENSION
	OBJECT_FDW
	OBJECT_FOREIGN_SERVER
	OBJECT_FOREIGN_TABLE
	OBJECT_FUNCTION
	OBJECT_INDEX
	OBJECT_LANGUAGE
	OBJECT_LARGEOBJECT
	OBJECT_MATVIEW
	OBJECT_OPCLASS
	OBJECT_OPERATOR
	OBJECT_OPFAMILY
	OBJECT_POLICY
	OBJECT_PUBLICATION
	OBJECT_PUBLICATION_REL
	OBJECT_ROLE
	OBJECT_RULE
	OBJECT_SCHEMA
	OBJECT_SEQUENCE
	OBJECT_SUBSCRIPTION
	OBJECT_STATISTIC_EXT
	OBJECT_TABCONSTRAINT
	OBJECT_TABLE
	OBJECT_TABLESPACE
	OBJECT_TRANSFORM
	OBJECT_TRIGGER
	OBJECT_TSCONFIGURATION
	OBJECT_TSDICTIONARY
	OBJECT_TSPARSER
	OBJECT_TSTEMPLATE
	OBJECT_TYPE
	OBJECT_USER_MAPPING
	OBJECT_VIEW
)

type ObjectWithArgs ¶

type ObjectWithArgs struct {
	Objname         List `json:"objname"`          /* qualified name of function/operator */
	Objargs         List `json:"objargs"`          /* list of Typename nodes */
	ArgsUnspecified bool `json:"args_unspecified"` /* argument list was omitted, so name must
	 * be unique (note that objargs == NIL
	 * means zero args) */
}

* Note: ObjectWithArgs carries only the types of the input parameters of the * function. So it is sufficient to identify an existing function, but it * is not enough info to define a function nor to call it.

func (ObjectWithArgs) Deparse ¶

func (node ObjectWithArgs) Deparse(ctx Context) (*string, error)

func (ObjectWithArgs) Fingerprint ¶

func (node ObjectWithArgs) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ObjectWithArgs) MarshalJSON ¶

func (node ObjectWithArgs) MarshalJSON() ([]byte, error)

func (*ObjectWithArgs) UnmarshalJSON ¶

func (node *ObjectWithArgs) UnmarshalJSON(input []byte) (err error)

type Offset ¶

type Offset int64

type Oid ¶

type Oid uint64

type OnCommitAction ¶

type OnCommitAction uint

What to do at commit time for temporary relations

const (
	ONCOMMIT_NOOP          OnCommitAction = iota /* No ON COMMIT clause (do nothing) */
	ONCOMMIT_PRESERVE_ROWS                       /* ON COMMIT PRESERVE ROWS (do nothing) */
	ONCOMMIT_DELETE_ROWS                         /* ON COMMIT DELETE ROWS */
	ONCOMMIT_DROP                                /* ON COMMIT DROP */
)

type OnConflictAction ¶

type OnConflictAction uint

* OnConflictAction - * "ON CONFLICT" clause type of query * * This is needed in both parsenodes.h and plannodes.h, so put it here...

const (
	ONCONFLICT_NONE    OnConflictAction = iota /* No "ON CONFLICT" clause */
	ONCONFLICT_NOTHING                         /* ON CONFLICT ... DO NOTHING */
	ONCONFLICT_UPDATE                          /* ON CONFLICT ... DO UPDATE */
)

type OnConflictClause ¶

type OnConflictClause struct {
	Action      OnConflictAction `json:"action"`      /* DO NOTHING or UPDATE? */
	Infer       *InferClause     `json:"infer"`       /* Optional index inference clause */
	TargetList  List             `json:"targetList"`  /* the target list (of ResTarget) */
	WhereClause Node             `json:"whereClause"` /* qualifications */
	Location    int              `json:"location"`    /* token location, or -1 if unknown */
}

* OnConflictClause - * representation of ON CONFLICT clause * * Note: OnConflictClause does not propagate into the Query representation.

func (OnConflictClause) Deparse ¶

func (node OnConflictClause) Deparse(ctx Context) (*string, error)

func (OnConflictClause) Fingerprint ¶

func (node OnConflictClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (OnConflictClause) MarshalJSON ¶

func (node OnConflictClause) MarshalJSON() ([]byte, error)

func (*OnConflictClause) UnmarshalJSON ¶

func (node *OnConflictClause) UnmarshalJSON(input []byte) (err error)

type OnConflictExpr ¶

type OnConflictExpr struct {
	Action OnConflictAction `json:"action"` /* DO NOTHING or UPDATE? */

	/* Arbiter */
	ArbiterElems List `json:"arbiterElems"` /* unique index arbiter list (of
	 * InferenceElem's) */

	ArbiterWhere Node `json:"arbiterWhere"` /* unique index arbiter WHERE clause */
	Constraint   Oid  `json:"constraint"`   /* pg_constraint OID for arbiter */

	/* ON CONFLICT UPDATE */
	OnConflictSet   List `json:"onConflictSet"`   /* List of ON CONFLICT SET TargetEntrys */
	OnConflictWhere Node `json:"onConflictWhere"` /* qualifiers to restrict UPDATE to */
	ExclRelIndex    int  `json:"exclRelIndex"`    /* RT index of 'excluded' relation */
	ExclRelTlist    List `json:"exclRelTlist"`    /* tlist of the EXCLUDED pseudo relation */
}

----------

  • OnConflictExpr - represents an ON CONFLICT DO ... expression *
  • The optimizer requires a list of inference elements, and optionally a WHERE
  • clause to infer a unique index. The unique index (or, occasionally,
  • indexes) inferred are used to arbitrate whether or not the alternative ON
  • CONFLICT path is taken. *----------

func (OnConflictExpr) Deparse ¶

func (node OnConflictExpr) Deparse(ctx Context) (*string, error)

func (OnConflictExpr) Fingerprint ¶

func (node OnConflictExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (OnConflictExpr) MarshalJSON ¶

func (node OnConflictExpr) MarshalJSON() ([]byte, error)

func (*OnConflictExpr) UnmarshalJSON ¶

func (node *OnConflictExpr) UnmarshalJSON(input []byte) (err error)

type OpExpr ¶

type OpExpr struct {
	Xpr          Node `json:"xpr"`
	Opno         Oid  `json:"opno"`         /* PG_OPERATOR OID of the operator */
	Opfuncid     Oid  `json:"opfuncid"`     /* PG_PROC OID of underlying function */
	Opresulttype Oid  `json:"opresulttype"` /* PG_TYPE OID of result value */
	Opretset     bool `json:"opretset"`     /* true if operator returns set */
	Opcollid     Oid  `json:"opcollid"`     /* OID of collation of result */
	Inputcollid  Oid  `json:"inputcollid"`  /* OID of collation that operator should use */
	Args         List `json:"args"`         /* arguments to the operator (1 or 2) */
	Location     int  `json:"location"`     /* token location, or -1 if unknown */
}

* OpExpr - expression node for an operator invocation * * Semantically, this is essentially the same as a function call. * * Note that opfuncid is not necessarily filled in immediately on creation * of the node. The planner makes sure it is valid before passing the node * tree to the executor, but during parsing/planning opfuncid can be 0.

func (OpExpr) Deparse ¶

func (node OpExpr) Deparse(ctx Context) (*string, error)

func (OpExpr) Fingerprint ¶

func (node OpExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (OpExpr) MarshalJSON ¶

func (node OpExpr) MarshalJSON() ([]byte, error)

func (*OpExpr) UnmarshalJSON ¶

func (node *OpExpr) UnmarshalJSON(input []byte) (err error)

type OverridingKind ¶

type OverridingKind uint

-------------------------------------------------------------------------

*
* parsenodes.h
*	  definitions for parse tree nodes
*
* Many of the node types used in parsetrees include a "location" field.
* This is a byte (not character) offset in the original source text, to be
* used for positioning an error cursor when there is an error related to
* the node.  Access to the original source text is needed to make use of
* the location.  At the topmost (statement) level, we also provide a
* statement length, likewise measured in bytes, for convenience in
* identifying statement boundaries in multi-statement source strings.
*
*
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/nodes/parsenodes.h
*
*-------------------------------------------------------------------------
const (
	OVERRIDING_NOT_SET OverridingKind = iota
	OVERRIDING_USER_VALUE
	OVERRIDING_SYSTEM_VALUE
)

type Param ¶

type Param struct {
	Xpr         Node      `json:"xpr"`
	Paramkind   ParamKind `json:"paramkind"`   /* kind of parameter. See above */
	Paramid     int       `json:"paramid"`     /* numeric ID for parameter */
	Paramtype   Oid       `json:"paramtype"`   /* pg_type OID of parameter's datatype */
	Paramtypmod int32     `json:"paramtypmod"` /* typmod value, if known */
	Paramcollid Oid       `json:"paramcollid"` /* OID of collation, or InvalidOid if none */
	Location    int       `json:"location"`    /* token location, or -1 if unknown */
}

* Param * * paramkind specifies the kind of parameter. The possible values * for this field are: * * PARAM_EXTERN: The parameter value is supplied from outside the plan. * Such parameters are numbered from 1 to n. * * PARAM_EXEC: The parameter is an internal executor parameter, used * for passing values into and out of sub-queries or from * nestloop joins to their inner scans. * For historical reasons, such parameters are numbered from 0. * These numbers are independent of PARAM_EXTERN numbers. * * PARAM_SUBLINK: The parameter represents an output column of a SubLink * node's sub-select. The column number is contained in the * `paramid' field. (This type of Param is converted to * PARAM_EXEC during planning.) * * PARAM_MULTIEXPR: Like PARAM_SUBLINK, the parameter represents an * output column of a SubLink node's sub-select, but here, the * SubLink is always a MULTIEXPR SubLink. The high-order 16 bits * of the `paramid' field contain the SubLink's subLinkId, and * the low-order 16 bits contain the column number. (This type * of Param is also converted to PARAM_EXEC during planning.)

func (Param) Deparse ¶

func (node Param) Deparse(ctx Context) (*string, error)

func (Param) Fingerprint ¶

func (node Param) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Param) MarshalJSON ¶

func (node Param) MarshalJSON() ([]byte, error)

func (*Param) UnmarshalJSON ¶

func (node *Param) UnmarshalJSON(input []byte) (err error)

type ParamExecData ¶

type ParamExecData struct {
	ExecPlan interface{} `json:"execPlan"` /* should be "SubPlanState *" */
	Value    Datum       `json:"value"`
	Isnull   bool        `json:"isnull"`
}

---------------- * ParamExecData * * ParamExecData entries are used for executor internal parameters * (that is, values being passed into or out of a sub-query). The * paramid of a PARAM_EXEC Param is a (zero-based) index into an * array of ParamExecData records, which is referenced through * es_param_exec_vals or ecxt_param_exec_vals. * * If execPlan is not NULL, it points to a SubPlanState node that needs * to be executed to produce the value. (This is done so that we can have * lazy evaluation of InitPlans: they aren't executed until/unless a * result value is needed.) Otherwise the value is assumed to be valid * when needed. * ----------------

func (ParamExecData) Deparse ¶

func (node ParamExecData) Deparse(ctx Context) (*string, error)

func (ParamExecData) Fingerprint ¶

func (node ParamExecData) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ParamExecData) MarshalJSON ¶

func (node ParamExecData) MarshalJSON() ([]byte, error)

func (*ParamExecData) UnmarshalJSON ¶

func (node *ParamExecData) UnmarshalJSON(input []byte) (err error)

type ParamExternData ¶

type ParamExternData struct {
	Value  Datum  `json:"value"`  /* parameter value */
	Isnull bool   `json:"isnull"` /* is it NULL? */
	Pflags uint16 `json:"pflags"` /* flag bits, see above */
	Ptype  Oid    `json:"ptype"`  /* parameter's datatype, or 0 */
}

---------------- * ParamListInfo * * ParamListInfo arrays are used to pass parameters into the executor * for parameterized plans. Each entry in the array defines the value * to be substituted for a PARAM_EXTERN parameter. The "paramid" * of a PARAM_EXTERN Param can range from 1 to numParams. * * Although parameter numbers are normally consecutive, we allow * ptype == InvalidOid to signal an unused array entry. * * pflags is a flags field. Currently the only used bit is: * PARAM_FLAG_CONST signals the planner that it may treat this parameter * as a constant (i.e., generate a plan that works only for this value * of the parameter). * * There are two hook functions that can be associated with a ParamListInfo * array to support dynamic parameter handling. First, if paramFetch * isn't null and the executor requires a value for an invalid parameter * (one with ptype == InvalidOid), the paramFetch hook is called to give * it a chance to fill in the parameter value. Second, a parserSetup * hook can be supplied to re-instantiate the original parsing hooks if * a query needs to be re-parsed/planned (as a substitute for supposing * that the current ptype values represent a fixed set of parameter types).

* Although the data structure is really an array, not a list, we keep * the old typedef name to avoid unnecessary code changes. * ----------------

func (ParamExternData) Deparse ¶

func (node ParamExternData) Deparse(ctx Context) (*string, error)

func (ParamExternData) Fingerprint ¶

func (node ParamExternData) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ParamExternData) MarshalJSON ¶

func (node ParamExternData) MarshalJSON() ([]byte, error)

func (*ParamExternData) UnmarshalJSON ¶

func (node *ParamExternData) UnmarshalJSON(input []byte) (err error)

type ParamKind ¶

type ParamKind uint

* Param * * paramkind specifies the kind of parameter. The possible values * for this field are: * * PARAM_EXTERN: The parameter value is supplied from outside the plan. * Such parameters are numbered from 1 to n. * * PARAM_EXEC: The parameter is an internal executor parameter, used * for passing values into and out of sub-queries or from * nestloop joins to their inner scans. * For historical reasons, such parameters are numbered from 0. * These numbers are independent of PARAM_EXTERN numbers. * * PARAM_SUBLINK: The parameter represents an output column of a SubLink * node's sub-select. The column number is contained in the * `paramid' field. (This type of Param is converted to * PARAM_EXEC during planning.) * * PARAM_MULTIEXPR: Like PARAM_SUBLINK, the parameter represents an * output column of a SubLink node's sub-select, but here, the * SubLink is always a MULTIEXPR SubLink. The high-order 16 bits * of the `paramid' field contain the SubLink's subLinkId, and * the low-order 16 bits contain the column number. (This type * of Param is also converted to PARAM_EXEC during planning.)

const (
	PARAM_EXTERN ParamKind = iota
	PARAM_EXEC
	PARAM_SUBLINK
	PARAM_MULTIEXPR
)

type ParamListInfo ¶

type ParamListInfo ParamListInfoData

type ParamListInfoData ¶

type ParamListInfoData struct {
	ParamFetchArg  interface{} `json:"paramFetchArg"`
	ParserSetupArg interface{} `json:"parserSetupArg"`
	NumParams      int         `json:"numParams"` /* number of ParamExternDatas following */
	ParamMask      []uint32    `json:"paramMask"` /* if non-NULL, can ignore omitted params */
}

---------------- * ParamListInfo * * ParamListInfo arrays are used to pass parameters into the executor * for parameterized plans. Each entry in the array defines the value * to be substituted for a PARAM_EXTERN parameter. The "paramid" * of a PARAM_EXTERN Param can range from 1 to numParams. * * Although parameter numbers are normally consecutive, we allow * ptype == InvalidOid to signal an unused array entry. * * pflags is a flags field. Currently the only used bit is: * PARAM_FLAG_CONST signals the planner that it may treat this parameter * as a constant (i.e., generate a plan that works only for this value * of the parameter). * * There are two hook functions that can be associated with a ParamListInfo * array to support dynamic parameter handling. First, if paramFetch * isn't null and the executor requires a value for an invalid parameter * (one with ptype == InvalidOid), the paramFetch hook is called to give * it a chance to fill in the parameter value. Second, a parserSetup * hook can be supplied to re-instantiate the original parsing hooks if * a query needs to be re-parsed/planned (as a substitute for supposing * that the current ptype values represent a fixed set of parameter types).

* Although the data structure is really an array, not a list, we keep * the old typedef name to avoid unnecessary code changes. * ----------------

func (ParamListInfoData) Deparse ¶

func (node ParamListInfoData) Deparse(ctx Context) (*string, error)

func (ParamListInfoData) Fingerprint ¶

func (node ParamListInfoData) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ParamListInfoData) MarshalJSON ¶

func (node ParamListInfoData) MarshalJSON() ([]byte, error)

func (*ParamListInfoData) UnmarshalJSON ¶

func (node *ParamListInfoData) UnmarshalJSON(input []byte) (err error)

type ParamRef ¶

type ParamRef struct {
	Number   int `json:"number"`   /* the number of the parameter */
	Location int `json:"location"` /* token location, or -1 if unknown */
}

* ParamRef - specifies a $n parameter reference

func (ParamRef) Deparse ¶

func (node ParamRef) Deparse(ctx Context) (*string, error)

func (ParamRef) Fingerprint ¶

func (node ParamRef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ParamRef) MarshalJSON ¶

func (node ParamRef) MarshalJSON() ([]byte, error)

func (*ParamRef) UnmarshalJSON ¶

func (node *ParamRef) UnmarshalJSON(input []byte) (err error)

type PartitionBoundSpec ¶

type PartitionBoundSpec struct {
	Strategy byte `json:"strategy"` /* see PARTITION_STRATEGY codes above */

	/* Partitioning info for LIST strategy: */
	Listdatums List `json:"listdatums"` /* List of Consts (or A_Consts in raw tree) */

	/* Partitioning info for RANGE strategy: */
	Lowerdatums List `json:"lowerdatums"` /* List of PartitionRangeDatums */
	Upperdatums List `json:"upperdatums"` /* List of PartitionRangeDatums */

	Location int `json:"location"` /* token location, or -1 if unknown */
}

* PartitionBoundSpec - a partition bound specification * * This represents the portion of the partition key space assigned to a * particular partition. These are stored on disk in pg_class.relpartbound.

func (PartitionBoundSpec) Deparse ¶

func (node PartitionBoundSpec) Deparse(ctx Context) (*string, error)

func (PartitionBoundSpec) Fingerprint ¶

func (node PartitionBoundSpec) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (PartitionBoundSpec) MarshalJSON ¶

func (node PartitionBoundSpec) MarshalJSON() ([]byte, error)

func (*PartitionBoundSpec) UnmarshalJSON ¶

func (node *PartitionBoundSpec) UnmarshalJSON(input []byte) (err error)

type PartitionCmd ¶

type PartitionCmd struct {
	Name  *RangeVar           `json:"name"`  /* name of partition to attach/detach */
	Bound *PartitionBoundSpec `json:"bound"` /* FOR VALUES, if attaching */
}

* PartitionCmd - info for ALTER TABLE ATTACH/DETACH PARTITION commands

func (PartitionCmd) Deparse ¶

func (node PartitionCmd) Deparse(ctx Context) (*string, error)

func (PartitionCmd) Fingerprint ¶

func (node PartitionCmd) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (PartitionCmd) MarshalJSON ¶

func (node PartitionCmd) MarshalJSON() ([]byte, error)

func (*PartitionCmd) UnmarshalJSON ¶

func (node *PartitionCmd) UnmarshalJSON(input []byte) (err error)

type PartitionElem ¶

type PartitionElem struct {
	Name      *string `json:"name"`      /* name of column to partition on, or NULL */
	Expr      Node    `json:"expr"`      /* expression to partition on, or NULL */
	Collation List    `json:"collation"` /* name of collation; NIL = default */
	Opclass   List    `json:"opclass"`   /* name of desired opclass; NIL = default */
	Location  int     `json:"location"`  /* token location, or -1 if unknown */
}

* PartitionElem - parse-time representation of a single partition key * * expr can be either a raw expression tree or a parse-analyzed expression. * We don't store these on-disk, though.

func (PartitionElem) Deparse ¶

func (node PartitionElem) Deparse(ctx Context) (*string, error)

func (PartitionElem) Fingerprint ¶

func (node PartitionElem) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (PartitionElem) MarshalJSON ¶

func (node PartitionElem) MarshalJSON() ([]byte, error)

func (*PartitionElem) UnmarshalJSON ¶

func (node *PartitionElem) UnmarshalJSON(input []byte) (err error)

type PartitionRangeDatum ¶

type PartitionRangeDatum struct {
	Kind  PartitionRangeDatumKind `json:"kind"`
	Value Node                    `json:"value"` /* Const (or A_Const in raw tree), if kind is
	 * PARTITION_RANGE_DATUM_VALUE, else NULL */

	Location int `json:"location"` /* token location, or -1 if unknown */
}

func (PartitionRangeDatum) Deparse ¶

func (node PartitionRangeDatum) Deparse(ctx Context) (*string, error)

func (PartitionRangeDatum) Fingerprint ¶

func (node PartitionRangeDatum) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (PartitionRangeDatum) MarshalJSON ¶

func (node PartitionRangeDatum) MarshalJSON() ([]byte, error)

func (*PartitionRangeDatum) UnmarshalJSON ¶

func (node *PartitionRangeDatum) UnmarshalJSON(input []byte) (err error)

type PartitionRangeDatumKind ¶

type PartitionRangeDatumKind uint

* PartitionRangeDatum - one of the values in a range partition bound * * This can be MINVALUE, MAXVALUE or a specific bounded value.

const (
	PARTITION_RANGE_DATUM_MINVALUE PartitionRangeDatumKind = iota
	PARTITION_RANGE_DATUM_VALUE
	PARTITION_RANGE_DATUM_MAXVALUE
)

type PartitionSpec ¶

type PartitionSpec struct {
	Strategy   *string `json:"strategy"`   /* partitioning strategy ('list' or 'range') */
	PartParams List    `json:"partParams"` /* List of PartitionElems */
	Location   int     `json:"location"`   /* token location, or -1 if unknown */
}

* PartitionSpec - parse-time representation of a partition key specification * * This represents the key space we will be partitioning on.

func (PartitionSpec) Deparse ¶

func (node PartitionSpec) Deparse(ctx Context) (*string, error)

func (PartitionSpec) Fingerprint ¶

func (node PartitionSpec) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (PartitionSpec) MarshalJSON ¶

func (node PartitionSpec) MarshalJSON() ([]byte, error)

func (*PartitionSpec) UnmarshalJSON ¶

func (node *PartitionSpec) UnmarshalJSON(input []byte) (err error)

type Pointer ¶

type Pointer byte

type PrepareStmt ¶

type PrepareStmt struct {
	Name     *string `json:"name"`     /* Name of plan, arbitrary */
	Argtypes List    `json:"argtypes"` /* Types of parameters (List of TypeName) */
	Query    Node    `json:"query"`    /* The query itself (as a raw parsetree) */
}

---------------------- * PREPARE Statement * ----------------------

func (PrepareStmt) Deparse ¶

func (node PrepareStmt) Deparse(ctx Context) (*string, error)

func (PrepareStmt) Fingerprint ¶

func (node PrepareStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (PrepareStmt) MarshalJSON ¶

func (node PrepareStmt) MarshalJSON() ([]byte, error)

func (*PrepareStmt) UnmarshalJSON ¶

func (node *PrepareStmt) UnmarshalJSON(input []byte) (err error)

type Query ¶

type Query struct {
	CommandType CmdType `json:"commandType"` /* select|insert|update|delete|utility */

	QuerySource QuerySource `json:"querySource"` /* where did I come from? */

	QueryId uint32 `json:"queryId"` /* query identifier (can be set by plugins) */

	CanSetTag bool `json:"canSetTag"` /* do I set the command result tag? */

	UtilityStmt Node `json:"utilityStmt"` /* non-null if commandType == CMD_UTILITY */

	ResultRelation int `json:"resultRelation"` /* rtable index of target relation for
	 * INSERT/UPDATE/DELETE; 0 for SELECT */

	HasAggs         bool `json:"hasAggs"`         /* has aggregates in tlist or havingQual */
	HasWindowFuncs  bool `json:"hasWindowFuncs"`  /* has window functions in tlist */
	HasTargetSrfs   bool `json:"hasTargetSRFs"`   /* has set-returning functions in tlist */
	HasSubLinks     bool `json:"hasSubLinks"`     /* has subquery SubLink */
	HasDistinctOn   bool `json:"hasDistinctOn"`   /* distinctClause is from DISTINCT ON */
	HasRecursive    bool `json:"hasRecursive"`    /* WITH RECURSIVE was specified */
	HasModifyingCte bool `json:"hasModifyingCTE"` /* has INSERT/UPDATE/DELETE in WITH */
	HasForUpdate    bool `json:"hasForUpdate"`    /* FOR [KEY] UPDATE/SHARE was specified */
	HasRowSecurity  bool `json:"hasRowSecurity"`  /* rewriter has applied some RLS policy */

	CteList List `json:"cteList"` /* WITH list (of CommonTableExpr's) */

	Rtable   List      `json:"rtable"`   /* list of range table entries */
	Jointree *FromExpr `json:"jointree"` /* table join tree (FROM and WHERE clauses) */

	TargetList List `json:"targetList"` /* target list (of TargetEntry) */

	Override OverridingKind `json:"override"` /* OVERRIDING clause */

	OnConflict *OnConflictExpr `json:"onConflict"` /* ON CONFLICT DO [NOTHING | UPDATE] */

	ReturningList List `json:"returningList"` /* return-values list (of TargetEntry) */

	GroupClause List `json:"groupClause"` /* a list of SortGroupClause's */

	GroupingSets List `json:"groupingSets"` /* a list of GroupingSet's if present */

	HavingQual Node `json:"havingQual"` /* qualifications applied to groups */

	WindowClause List `json:"windowClause"` /* a list of WindowClause's */

	DistinctClause List `json:"distinctClause"` /* a list of SortGroupClause's */

	SortClause List `json:"sortClause"` /* a list of SortGroupClause's */

	LimitOffset Node `json:"limitOffset"` /* # of result tuples to skip (int8 expr) */
	LimitCount  Node `json:"limitCount"`  /* # of result tuples to return (int8 expr) */

	RowMarks List `json:"rowMarks"` /* a list of RowMarkClause's */

	SetOperations Node `json:"setOperations"` /* set-operation tree if this is top level of
	 * a UNION/INTERSECT/EXCEPT query */

	ConstraintDeps List `json:"constraintDeps"` /* a list of pg_constraint OIDs that the query
	 * depends on to be semantically valid */

	WithCheckOptions List `json:"withCheckOptions"` /* a list of WithCheckOption's, which are
	 * only added during rewrite and therefore
	 * are not written out as part of Query. */

	/*
	 * The following two fields identify the portion of the source text string
	 * containing this query.  They are typically only populated in top-level
	 * Queries, not in sub-queries.  When not set, they might both be zero, or
	 * both be -1 meaning "unknown".
	 */
	StmtLocation int `json:"stmt_location"` /* start location, or -1 if unknown */
	StmtLen      int `json:"stmt_len"`      /* length in bytes; 0 means "rest of string" */
}

* Query - * Parse analysis turns all statements into a Query tree * for further processing by the rewriter and planner. * * Utility statements (i.e. non-optimizable statements) have the * utilityStmt field set, and the rest of the Query is mostly dummy. * * Planning converts a Query tree into a Plan tree headed by a PlannedStmt * node --- the Query structure is not used by the executor.

func (Query) Deparse ¶

func (node Query) Deparse(ctx Context) (*string, error)

func (Query) Fingerprint ¶

func (node Query) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Query) MarshalJSON ¶

func (node Query) MarshalJSON() ([]byte, error)

func (*Query) UnmarshalJSON ¶

func (node *Query) UnmarshalJSON(input []byte) (err error)

type QuerySource ¶

type QuerySource uint

Possible sources of a Query

const (
	QSRC_ORIGINAL          QuerySource = iota /* original parsetree (explicit query) */
	QSRC_PARSER                               /* added by parse analysis (now unused) */
	QSRC_INSTEAD_RULE                         /* added by unconditional INSTEAD rule */
	QSRC_QUAL_INSTEAD_RULE                    /* added by conditional INSTEAD rule */
	QSRC_NON_INSTEAD_RULE                     /* added by non-INSTEAD rule */
)

type RTEKind ¶

type RTEKind uint

--------------------

  • RangeTblEntry -
  • A range table is a List of RangeTblEntry nodes. *
  • A range table entry may represent a plain relation, a sub-select in
  • FROM, or the result of a JOIN clause. (Only explicit JOIN syntax
  • produces an RTE, not the implicit join resulting from multiple FROM
  • items. This is because we only need the RTE to deal with SQL features
  • like outer joins and join-output-column aliasing.) Other special
  • RTE types also exist, as indicated by RTEKind. *
  • Note that we consider RTE_RELATION to cover anything that has a pg_class
  • entry. relkind distinguishes the sub-cases. *
  • alias is an Alias node representing the AS alias-clause attached to the
  • FROM expression, or NULL if no clause. *
  • eref is the table reference name and column reference names (either
  • real or aliases). Note that system columns (OID etc) are not included
  • in the column list.
  • eref->aliasname is required to be present, and should generally be used
  • to identify the RTE for error messages etc. *
  • In RELATION RTEs, the colnames in both alias and eref are indexed by
  • physical attribute number; this means there must be colname entries for
  • dropped columns. When building an RTE we insert empty strings ("") for
  • dropped columns. Note however that a stored rule may have nonempty
  • colnames for columns dropped since the rule was created (and for that
  • matter the colnames might be out of date due to column renamings).
  • The same comments apply to FUNCTION RTEs when a function's return type
  • is a named composite type. *
  • In JOIN RTEs, the colnames in both alias and eref are one-to-one with
  • joinaliasvars entries. A JOIN RTE will omit columns of its inputs when
  • those columns are known to be dropped at parse time. Again, however,
  • a stored rule might contain entries for columns dropped since the rule
  • was created. (This is only possible for columns not actually referenced
  • in the rule.) When loading a stored rule, we replace the joinaliasvars
  • items for any such columns with null pointers. (We can't simply delete
  • them from the joinaliasvars list, because that would affect the attnums
  • of Vars referencing the rest of the list.) *
  • inh is TRUE for relation references that should be expanded to include
  • inheritance children, if the rel has any. This *must* be FALSE for
  • RTEs other than RTE_RELATION entries. *
  • inFromCl marks those range variables that are listed in the FROM clause.
  • It's false for RTEs that are added to a query behind the scenes, such
  • as the NEW and OLD variables for a rule, or the subqueries of a UNION.
  • This flag is not used anymore during parsing, since the parser now uses
  • a separate "namespace" data structure to control visibility, but it is
  • needed by ruleutils.c to determine whether RTEs should be shown in
  • decompiled queries. *
  • requiredPerms and checkAsUser specify run-time access permissions
  • checks to be performed at query startup. The user must have *all*
  • of the permissions that are OR'd together in requiredPerms (zero
  • indicates no permissions checking). If checkAsUser is not zero,
  • then do the permissions checks using the access rights of that user,
  • not the current effective user ID. (This allows rules to act as
  • setuid gateways.) Permissions checks only apply to RELATION RTEs. *
  • For SELECT/INSERT/UPDATE permissions, if the user doesn't have
  • table-wide permissions then it is sufficient to have the permissions
  • on all columns identified in selectedCols (for SELECT) and/or
  • insertedCols and/or updatedCols (INSERT with ON CONFLICT DO UPDATE may
  • have all 3). selectedCols, insertedCols and updatedCols are bitmapsets,
  • which cannot have negative integer members, so we subtract
  • FirstLowInvalidHeapAttributeNumber from column numbers before storing
  • them in these fields. A whole-row Var reference is represented by
  • setting the bit for InvalidAttrNumber. *
  • securityQuals is a list of security barrier quals (boolean expressions),
  • to be tested in the listed order before returning a row from the
  • relation. It is always NIL in parser output. Entries are added by the
  • rewriter to implement security-barrier views and/or row-level security.
  • Note that the planner turns each boolean expression into an implicitly
  • AND'ed sublist, as is its usual habit with qualification expressions. *--------------------
const (
	RTE_RELATION        RTEKind = iota /* ordinary relation reference */
	RTE_SUBQUERY                       /* subquery in FROM */
	RTE_JOIN                           /* join */
	RTE_FUNCTION                       /* function in FROM */
	RTE_TABLEFUNC                      /* TableFunc(.., column list) */
	RTE_VALUES                         /* VALUES (<exprlist>), (<exprlist>), ... */
	RTE_CTE                            /* common table expr (WITH list element) */
	RTE_NAMEDTUPLESTORE                /* tuplestore, e.g. for AFTER triggers */
)

type RangeFunction ¶

type RangeFunction struct {
	Lateral    bool   `json:"lateral"`     /* does it have LATERAL prefix? */
	Ordinality bool   `json:"ordinality"`  /* does it have WITH ORDINALITY suffix? */
	IsRowsfrom bool   `json:"is_rowsfrom"` /* is result of ROWS FROM() syntax? */
	Functions  List   `json:"functions"`   /* per-function information, see above */
	Alias      *Alias `json:"alias"`       /* table alias & optional column aliases */
	Coldeflist List   `json:"coldeflist"`  /* list of ColumnDef nodes to describe result
	 * of function returning RECORD */
}

* RangeFunction - function call appearing in a FROM clause * * functions is a List because we use this to represent the construct * ROWS FROM(func1(...), func2(...), ...). Each element of this list is a * two-element sublist, the first element being the untransformed function * call tree, and the second element being a possibly-empty list of ColumnDef * nodes representing any columndef list attached to that function within the * ROWS FROM() syntax. * * alias and coldeflist represent any alias and/or columndef list attached * at the top level. (We disallow coldeflist appearing both here and * per-function, but that's checked in parse analysis, not by the grammar.)

func (RangeFunction) Deparse ¶

func (node RangeFunction) Deparse(ctx Context) (*string, error)

func (RangeFunction) Fingerprint ¶

func (node RangeFunction) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeFunction) MarshalJSON ¶

func (node RangeFunction) MarshalJSON() ([]byte, error)

func (*RangeFunction) UnmarshalJSON ¶

func (node *RangeFunction) UnmarshalJSON(input []byte) (err error)

type RangeSubselect ¶

type RangeSubselect struct {
	Lateral  bool   `json:"lateral"`  /* does it have LATERAL prefix? */
	Subquery Node   `json:"subquery"` /* the untransformed sub-select clause */
	Alias    *Alias `json:"alias"`    /* table alias & optional column aliases */
}

* RangeSubselect - subquery appearing in a FROM clause

func (RangeSubselect) Deparse ¶

func (node RangeSubselect) Deparse(ctx Context) (*string, error)

func (RangeSubselect) Fingerprint ¶

func (node RangeSubselect) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeSubselect) MarshalJSON ¶

func (node RangeSubselect) MarshalJSON() ([]byte, error)

func (*RangeSubselect) UnmarshalJSON ¶

func (node *RangeSubselect) UnmarshalJSON(input []byte) (err error)

type RangeTableFunc ¶

type RangeTableFunc struct {
	Lateral    bool   `json:"lateral"`    /* does it have LATERAL prefix? */
	Docexpr    Node   `json:"docexpr"`    /* document expression */
	Rowexpr    Node   `json:"rowexpr"`    /* row generator expression */
	Namespaces List   `json:"namespaces"` /* list of namespaces as ResTarget */
	Columns    List   `json:"columns"`    /* list of RangeTableFuncCol */
	Alias      *Alias `json:"alias"`      /* table alias & optional column aliases */
	Location   int    `json:"location"`   /* token location, or -1 if unknown */
}

* RangeTableFunc - raw form of "table functions" such as XMLTABLE

func (RangeTableFunc) Deparse ¶

func (node RangeTableFunc) Deparse(ctx Context) (*string, error)

func (RangeTableFunc) Fingerprint ¶

func (node RangeTableFunc) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeTableFunc) MarshalJSON ¶

func (node RangeTableFunc) MarshalJSON() ([]byte, error)

func (*RangeTableFunc) UnmarshalJSON ¶

func (node *RangeTableFunc) UnmarshalJSON(input []byte) (err error)

type RangeTableFuncCol ¶

type RangeTableFuncCol struct {
	Colname       *string   `json:"colname"`        /* name of generated column */
	TypeName      *TypeName `json:"typeName"`       /* type of generated column */
	ForOrdinality bool      `json:"for_ordinality"` /* does it have FOR ORDINALITY? */
	IsNotNull     bool      `json:"is_not_null"`    /* does it have NOT NULL? */
	Colexpr       Node      `json:"colexpr"`        /* column filter expression */
	Coldefexpr    Node      `json:"coldefexpr"`     /* column default value expression */
	Location      int       `json:"location"`       /* token location, or -1 if unknown */
}

* RangeTableFuncCol - one column in a RangeTableFunc->columns * * If for_ordinality is true (FOR ORDINALITY), then the column is an int4 * column and the rest of the fields are ignored.

func (RangeTableFuncCol) Deparse ¶

func (node RangeTableFuncCol) Deparse(ctx Context) (*string, error)

func (RangeTableFuncCol) Fingerprint ¶

func (node RangeTableFuncCol) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeTableFuncCol) MarshalJSON ¶

func (node RangeTableFuncCol) MarshalJSON() ([]byte, error)

func (*RangeTableFuncCol) UnmarshalJSON ¶

func (node *RangeTableFuncCol) UnmarshalJSON(input []byte) (err error)

type RangeTableSample ¶

type RangeTableSample struct {
	Relation   Node `json:"relation"`   /* relation to be sampled */
	Method     List `json:"method"`     /* sampling method name (possibly qualified) */
	Args       List `json:"args"`       /* argument(s) for sampling method */
	Repeatable Node `json:"repeatable"` /* REPEATABLE expression, or NULL if none */
	Location   int  `json:"location"`   /* method name location, or -1 if unknown */
}

* RangeTableSample - TABLESAMPLE appearing in a raw FROM clause * * This node, appearing only in raw parse trees, represents * <relation> TABLESAMPLE <method> (<params>) REPEATABLE (<num>) * Currently, the <relation> can only be a RangeVar, but we might in future * allow RangeSubselect and other options. Note that the RangeTableSample * is wrapped around the node representing the <relation>, rather than being * a subfield of it.

func (RangeTableSample) Deparse ¶

func (node RangeTableSample) Deparse(ctx Context) (*string, error)

func (RangeTableSample) Fingerprint ¶

func (node RangeTableSample) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeTableSample) MarshalJSON ¶

func (node RangeTableSample) MarshalJSON() ([]byte, error)

func (*RangeTableSample) UnmarshalJSON ¶

func (node *RangeTableSample) UnmarshalJSON(input []byte) (err error)

type RangeTblEntry ¶

type RangeTblEntry struct {
	Rtekind RTEKind `json:"rtekind"` /* see above */

	/*
	 * Fields valid for a plain relation RTE (else zero):
	 *
	 * As a special case, RTE_NAMEDTUPLESTORE can also set relid to indicate
	 * that the tuple format of the tuplestore is the same as the referenced
	 * relation.  This allows plans referencing AFTER trigger transition
	 * tables to be invalidated if the underlying table is altered.
	 */
	Relid       Oid                `json:"relid"`       /* OID of the relation */
	Relkind     byte               `json:"relkind"`     /* relation kind (see pg_class.relkind) */
	Tablesample *TableSampleClause `json:"tablesample"` /* sampling info, or NULL */

	/*
	 * Fields valid for a subquery RTE (else NULL):
	 */
	Subquery        *Query `json:"subquery"`         /* the sub-query */
	SecurityBarrier bool   `json:"security_barrier"` /* is from security_barrier view? */

	/*
	 * Fields valid for a join RTE (else NULL/zero):
	 *
	 * joinaliasvars is a list of (usually) Vars corresponding to the columns
	 * of the join result.  An alias Var referencing column K of the join
	 * result can be replaced by the K'th element of joinaliasvars --- but to
	 * simplify the task of reverse-listing aliases correctly, we do not do
	 * that until planning time.  In detail: an element of joinaliasvars can
	 * be a Var of one of the join's input relations, or such a Var with an
	 * implicit coercion to the join's output column type, or a COALESCE
	 * expression containing the two input column Vars (possibly coerced).
	 * Within a Query loaded from a stored rule, it is also possible for
	 * joinaliasvars items to be null pointers, which are placeholders for
	 * (necessarily unreferenced) columns dropped since the rule was made.
	 * Also, once planning begins, joinaliasvars items can be almost anything,
	 * as a result of subquery-flattening substitutions.
	 */
	Jointype      JoinType `json:"jointype"`      /* type of join */
	Joinaliasvars List     `json:"joinaliasvars"` /* list of alias-var expansions */

	/*
	 * Fields valid for a function RTE (else NIL/zero):
	 *
	 * When funcordinality is true, the eref->colnames list includes an alias
	 * for the ordinality column.  The ordinality column is otherwise
	 * implicit, and must be accounted for "by hand" in places such as
	 * expandRTE().
	 */
	Functions      List `json:"functions"`      /* list of RangeTblFunction nodes */
	Funcordinality bool `json:"funcordinality"` /* is this called WITH ORDINALITY? */

	/*
	 * Fields valid for a TableFunc RTE (else NULL):
	 */
	Tablefunc *TableFunc `json:"tablefunc"`

	/*
	 * Fields valid for a values RTE (else NIL):
	 */
	ValuesLists List `json:"values_lists"` /* list of expression lists */

	/*
	 * Fields valid for a CTE RTE (else NULL/zero):
	 */
	Ctename       *string `json:"ctename"`        /* name of the WITH list item */
	Ctelevelsup   Index   `json:"ctelevelsup"`    /* number of query levels up */
	SelfReference bool    `json:"self_reference"` /* is this a recursive self-reference? */

	/*
	 * Fields valid for table functions, values, CTE and ENR RTEs (else NIL):
	 *
	 * We need these for CTE RTEs so that the types of self-referential
	 * columns are well-defined.  For VALUES RTEs, storing these explicitly
	 * saves having to re-determine the info by scanning the values_lists. For
	 * ENRs, we store the types explicitly here (we could get the information
	 * from the catalogs if 'relid' was supplied, but we'd still need these
	 * for TupleDesc-based ENRs, so we might as well always store the type
	 * info here).
	 */
	Coltypes      List `json:"coltypes"`      /* OID list of column type OIDs */
	Coltypmods    List `json:"coltypmods"`    /* integer list of column typmods */
	Colcollations List `json:"colcollations"` /* OID list of column collation OIDs */

	/*
	 * Fields valid for ENR RTEs (else NULL/zero):
	 */
	Enrname   *string `json:"enrname"`   /* name of ephemeral named relation */
	Enrtuples float64 `json:"enrtuples"` /* estimated or actual from caller */

	/*
	 * Fields valid in all RTEs:
	 */
	Alias         *Alias   `json:"alias"`         /* user-written alias clause, if any */
	Eref          *Alias   `json:"eref"`          /* expanded reference names */
	Lateral       bool     `json:"lateral"`       /* subquery, function, or values is LATERAL? */
	Inh           bool     `json:"inh"`           /* inheritance requested? */
	InFromCl      bool     `json:"inFromCl"`      /* present in FROM clause? */
	RequiredPerms AclMode  `json:"requiredPerms"` /* bitmask of required access permissions */
	CheckAsUser   Oid      `json:"checkAsUser"`   /* if valid, check access as this role */
	SelectedCols  []uint32 `json:"selectedCols"`  /* columns needing SELECT permission */
	InsertedCols  []uint32 `json:"insertedCols"`  /* columns needing INSERT permission */
	UpdatedCols   []uint32 `json:"updatedCols"`   /* columns needing UPDATE permission */
	SecurityQuals List     `json:"securityQuals"` /* security barrier quals to apply, if any */
}

--------------------

  • RangeTblEntry -
  • A range table is a List of RangeTblEntry nodes. *
  • A range table entry may represent a plain relation, a sub-select in
  • FROM, or the result of a JOIN clause. (Only explicit JOIN syntax
  • produces an RTE, not the implicit join resulting from multiple FROM
  • items. This is because we only need the RTE to deal with SQL features
  • like outer joins and join-output-column aliasing.) Other special
  • RTE types also exist, as indicated by RTEKind. *
  • Note that we consider RTE_RELATION to cover anything that has a pg_class
  • entry. relkind distinguishes the sub-cases. *
  • alias is an Alias node representing the AS alias-clause attached to the
  • FROM expression, or NULL if no clause. *
  • eref is the table reference name and column reference names (either
  • real or aliases). Note that system columns (OID etc) are not included
  • in the column list.
  • eref->aliasname is required to be present, and should generally be used
  • to identify the RTE for error messages etc. *
  • In RELATION RTEs, the colnames in both alias and eref are indexed by
  • physical attribute number; this means there must be colname entries for
  • dropped columns. When building an RTE we insert empty strings ("") for
  • dropped columns. Note however that a stored rule may have nonempty
  • colnames for columns dropped since the rule was created (and for that
  • matter the colnames might be out of date due to column renamings).
  • The same comments apply to FUNCTION RTEs when a function's return type
  • is a named composite type. *
  • In JOIN RTEs, the colnames in both alias and eref are one-to-one with
  • joinaliasvars entries. A JOIN RTE will omit columns of its inputs when
  • those columns are known to be dropped at parse time. Again, however,
  • a stored rule might contain entries for columns dropped since the rule
  • was created. (This is only possible for columns not actually referenced
  • in the rule.) When loading a stored rule, we replace the joinaliasvars
  • items for any such columns with null pointers. (We can't simply delete
  • them from the joinaliasvars list, because that would affect the attnums
  • of Vars referencing the rest of the list.) *
  • inh is TRUE for relation references that should be expanded to include
  • inheritance children, if the rel has any. This *must* be FALSE for
  • RTEs other than RTE_RELATION entries. *
  • inFromCl marks those range variables that are listed in the FROM clause.
  • It's false for RTEs that are added to a query behind the scenes, such
  • as the NEW and OLD variables for a rule, or the subqueries of a UNION.
  • This flag is not used anymore during parsing, since the parser now uses
  • a separate "namespace" data structure to control visibility, but it is
  • needed by ruleutils.c to determine whether RTEs should be shown in
  • decompiled queries. *
  • requiredPerms and checkAsUser specify run-time access permissions
  • checks to be performed at query startup. The user must have *all*
  • of the permissions that are OR'd together in requiredPerms (zero
  • indicates no permissions checking). If checkAsUser is not zero,
  • then do the permissions checks using the access rights of that user,
  • not the current effective user ID. (This allows rules to act as
  • setuid gateways.) Permissions checks only apply to RELATION RTEs. *
  • For SELECT/INSERT/UPDATE permissions, if the user doesn't have
  • table-wide permissions then it is sufficient to have the permissions
  • on all columns identified in selectedCols (for SELECT) and/or
  • insertedCols and/or updatedCols (INSERT with ON CONFLICT DO UPDATE may
  • have all 3). selectedCols, insertedCols and updatedCols are bitmapsets,
  • which cannot have negative integer members, so we subtract
  • FirstLowInvalidHeapAttributeNumber from column numbers before storing
  • them in these fields. A whole-row Var reference is represented by
  • setting the bit for InvalidAttrNumber. *
  • securityQuals is a list of security barrier quals (boolean expressions),
  • to be tested in the listed order before returning a row from the
  • relation. It is always NIL in parser output. Entries are added by the
  • rewriter to implement security-barrier views and/or row-level security.
  • Note that the planner turns each boolean expression into an implicitly
  • AND'ed sublist, as is its usual habit with qualification expressions. *--------------------

func (RangeTblEntry) Deparse ¶

func (node RangeTblEntry) Deparse(ctx Context) (*string, error)

func (RangeTblEntry) Fingerprint ¶

func (node RangeTblEntry) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeTblEntry) MarshalJSON ¶

func (node RangeTblEntry) MarshalJSON() ([]byte, error)

func (*RangeTblEntry) UnmarshalJSON ¶

func (node *RangeTblEntry) UnmarshalJSON(input []byte) (err error)

type RangeTblFunction ¶

type RangeTblFunction struct {
	Funcexpr     Node `json:"funcexpr"`     /* expression tree for func call */
	Funccolcount int  `json:"funccolcount"` /* number of columns it contributes to RTE */

	/* These fields record the contents of a column definition list, if any: */
	Funccolnames      List `json:"funccolnames"`      /* column names (list of String) */
	Funccoltypes      List `json:"funccoltypes"`      /* OID list of column type OIDs */
	Funccoltypmods    List `json:"funccoltypmods"`    /* integer list of column typmods */
	Funccolcollations List `json:"funccolcollations"` /* OID list of column collation OIDs */

	/* This is set during planning for use by the executor: */
	Funcparams []uint32 `json:"funcparams"` /* PARAM_EXEC Param IDs affecting this func */
}

* RangeTblFunction - * RangeTblEntry subsidiary data for one function in a FUNCTION RTE. * * If the function had a column definition list (required for an * otherwise-unspecified RECORD result), funccolnames lists the names given * in the definition list, funccoltypes lists their declared column types, * funccoltypmods lists their typmods, funccolcollations their collations. * Otherwise, those fields are NIL. * * Notice we don't attempt to store info about the results of functions * returning named composite types, because those can change from time to * time. We do however remember how many columns we thought the type had * (including dropped columns!), so that we can successfully ignore any * columns added after the query was parsed.

func (RangeTblFunction) Deparse ¶

func (node RangeTblFunction) Deparse(ctx Context) (*string, error)

func (RangeTblFunction) Fingerprint ¶

func (node RangeTblFunction) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeTblFunction) MarshalJSON ¶

func (node RangeTblFunction) MarshalJSON() ([]byte, error)

func (*RangeTblFunction) UnmarshalJSON ¶

func (node *RangeTblFunction) UnmarshalJSON(input []byte) (err error)

type RangeTblRef ¶

type RangeTblRef struct {
	Rtindex int `json:"rtindex"`
}

* RangeTblRef - reference to an entry in the query's rangetable * * We could use direct pointers to the RT entries and skip having these * nodes, but multiple pointers to the same node in a querytree cause * lots of headaches, so it seems better to store an index into the RT.

func (RangeTblRef) Deparse ¶

func (node RangeTblRef) Deparse(ctx Context) (*string, error)

func (RangeTblRef) Fingerprint ¶

func (node RangeTblRef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeTblRef) MarshalJSON ¶

func (node RangeTblRef) MarshalJSON() ([]byte, error)

func (*RangeTblRef) UnmarshalJSON ¶

func (node *RangeTblRef) UnmarshalJSON(input []byte) (err error)

type RangeVar ¶

type RangeVar struct {
	Catalogname *string `json:"catalogname"` /* the catalog (database) name, or NULL */
	Schemaname  *string `json:"schemaname"`  /* the schema name, or NULL */
	Relname     *string `json:"relname"`     /* the relation/sequence name */
	Inh         bool    `json:"inh"`         /* expand rel by inheritance? recursively act
	 * on children? */

	Relpersistence byte   `json:"relpersistence"` /* see RELPERSISTENCE_* in pg_class.h */
	Alias          *Alias `json:"alias"`          /* table alias & optional column aliases */
	Location       int    `json:"location"`       /* token location, or -1 if unknown */
}

* RangeVar - range variable, used in FROM clauses * * Also used to represent table names in utility statements; there, the alias * field is not used, and inh tells whether to apply the operation * recursively to child tables. In some contexts it is also useful to carry * a TEMP table indication here.

func (RangeVar) Deparse ¶

func (node RangeVar) Deparse(ctx Context) (*string, error)

func (RangeVar) Fingerprint ¶

func (node RangeVar) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RangeVar) MarshalJSON ¶

func (node RangeVar) MarshalJSON() ([]byte, error)

func (*RangeVar) UnmarshalJSON ¶

func (node *RangeVar) UnmarshalJSON(input []byte) (err error)

type RawStmt ¶

type RawStmt struct {
	Stmt         Node `json:"stmt"`          /* raw parse tree */
	StmtLocation int  `json:"stmt_location"` /* start location, or -1 if unknown */
	StmtLen      int  `json:"stmt_len"`      /* length in bytes; 0 means "rest of string" */
}

* RawStmt --- container for any one statement's raw parse tree * * Parse analysis converts a raw parse tree headed by a RawStmt node into * an analyzed statement headed by a Query node. For optimizable statements, * the conversion is complex. For utility statements, the parser usually just * transfers the raw parse tree (sans RawStmt) into the utilityStmt field of * the Query node, and all the useful work happens at execution time. * * stmt_location/stmt_len identify the portion of the source text string * containing this raw statement (useful for multi-statement strings).

func (RawStmt) Deparse ¶

func (node RawStmt) Deparse(ctx Context) (*string, error)

func (RawStmt) Fingerprint ¶

func (node RawStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RawStmt) MarshalJSON ¶

func (node RawStmt) MarshalJSON() ([]byte, error)

func (*RawStmt) UnmarshalJSON ¶

func (node *RawStmt) UnmarshalJSON(input []byte) (err error)

type ReassignOwnedStmt ¶

type ReassignOwnedStmt struct {
	Roles   List      `json:"roles"`
	Newrole *RoleSpec `json:"newrole"`
}

* REASSIGN OWNED statement

func (ReassignOwnedStmt) Deparse ¶

func (node ReassignOwnedStmt) Deparse(ctx Context) (*string, error)

func (ReassignOwnedStmt) Fingerprint ¶

func (node ReassignOwnedStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ReassignOwnedStmt) MarshalJSON ¶

func (node ReassignOwnedStmt) MarshalJSON() ([]byte, error)

func (*ReassignOwnedStmt) UnmarshalJSON ¶

func (node *ReassignOwnedStmt) UnmarshalJSON(input []byte) (err error)

type RefreshMatViewStmt ¶

type RefreshMatViewStmt struct {
	Concurrent bool      `json:"concurrent"` /* allow concurrent access? */
	SkipData   bool      `json:"skipData"`   /* true for WITH NO DATA */
	Relation   *RangeVar `json:"relation"`   /* relation to insert into */
}

---------------------- * REFRESH MATERIALIZED VIEW Statement * ----------------------

func (RefreshMatViewStmt) Deparse ¶

func (node RefreshMatViewStmt) Deparse(ctx Context) (*string, error)

func (RefreshMatViewStmt) Fingerprint ¶

func (node RefreshMatViewStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RefreshMatViewStmt) MarshalJSON ¶

func (node RefreshMatViewStmt) MarshalJSON() ([]byte, error)

func (*RefreshMatViewStmt) UnmarshalJSON ¶

func (node *RefreshMatViewStmt) UnmarshalJSON(input []byte) (err error)

type RegProcedure ¶

type RegProcedure regproc

type ReindexObjectType ¶

type ReindexObjectType uint

Reindex options

const (
	REINDEX_OBJECT_INDEX    ReindexObjectType = iota /* index */
	REINDEX_OBJECT_TABLE                             /* table or materialized view */
	REINDEX_OBJECT_SCHEMA                            /* schema */
	REINDEX_OBJECT_SYSTEM                            /* system catalogs */
	REINDEX_OBJECT_DATABASE                          /* database */
)

type ReindexStmt ¶

type ReindexStmt struct {
	Kind ReindexObjectType `json:"kind"` /* REINDEX_OBJECT_INDEX, REINDEX_OBJECT_TABLE,
	 * etc. */

	Relation *RangeVar `json:"relation"` /* Table or index to reindex */
	Name     *string   `json:"name"`     /* name of database to reindex */
	Options  int       `json:"options"`  /* Reindex options flags */
}

func (ReindexStmt) Deparse ¶

func (node ReindexStmt) Deparse(ctx Context) (*string, error)

func (ReindexStmt) Fingerprint ¶

func (node ReindexStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ReindexStmt) MarshalJSON ¶

func (node ReindexStmt) MarshalJSON() ([]byte, error)

func (*ReindexStmt) UnmarshalJSON ¶

func (node *ReindexStmt) UnmarshalJSON(input []byte) (err error)

type RelabelType ¶

type RelabelType struct {
	Xpr           Node         `json:"xpr"`
	Arg           Node         `json:"arg"`           /* input expression */
	Resulttype    Oid          `json:"resulttype"`    /* output type of coercion expression */
	Resulttypmod  int32        `json:"resulttypmod"`  /* output typmod (usually -1) */
	Resultcollid  Oid          `json:"resultcollid"`  /* OID of collation, or InvalidOid if none */
	Relabelformat CoercionForm `json:"relabelformat"` /* how to display this node */
	Location      int          `json:"location"`      /* token location, or -1 if unknown */
}

---------------- * RelabelType * * RelabelType represents a "dummy" type coercion between two binary- * compatible datatypes, such as reinterpreting the result of an OID * expression as an int4. It is a no-op at runtime; we only need it * to provide a place to store the correct type to be attributed to * the expression result during type resolution. (We can't get away * with just overwriting the type field of the input expression node, * so we need a separate node to show the coercion's result type.) * ----------------

func (RelabelType) Deparse ¶

func (node RelabelType) Deparse(ctx Context) (*string, error)

func (RelabelType) Fingerprint ¶

func (node RelabelType) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RelabelType) MarshalJSON ¶

func (node RelabelType) MarshalJSON() ([]byte, error)

func (*RelabelType) UnmarshalJSON ¶

func (node *RelabelType) UnmarshalJSON(input []byte) (err error)

type RenameStmt ¶

type RenameStmt struct {
	RenameType   ObjectType `json:"renameType"`   /* OBJECT_TABLE, OBJECT_COLUMN, etc */
	RelationType ObjectType `json:"relationType"` /* if column name, associated relation type */
	Relation     *RangeVar  `json:"relation"`     /* in case it's a table */
	Object       Node       `json:"object"`       /* in case it's some other object */
	Subname      *string    `json:"subname"`      /* name of contained object (column, rule,
	 * trigger, etc) */

	Newname   *string      `json:"newname"`    /* the new name */
	Behavior  DropBehavior `json:"behavior"`   /* RESTRICT or CASCADE behavior */
	MissingOk bool         `json:"missing_ok"` /* skip error if missing? */
}

---------------------- * Alter Object Rename Statement * ----------------------

func (RenameStmt) Deparse ¶

func (node RenameStmt) Deparse(ctx Context) (*string, error)

func (RenameStmt) Fingerprint ¶

func (node RenameStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RenameStmt) MarshalJSON ¶

func (node RenameStmt) MarshalJSON() ([]byte, error)

func (*RenameStmt) UnmarshalJSON ¶

func (node *RenameStmt) UnmarshalJSON(input []byte) (err error)

type ReplicaIdentityStmt ¶

type ReplicaIdentityStmt struct {
	IdentityType byte    `json:"identity_type"`
	Name         *string `json:"name"`
}

---------------------- * Alter Table * ----------------------

func (ReplicaIdentityStmt) Deparse ¶

func (node ReplicaIdentityStmt) Deparse(ctx Context) (*string, error)

func (ReplicaIdentityStmt) Fingerprint ¶

func (node ReplicaIdentityStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ReplicaIdentityStmt) MarshalJSON ¶

func (node ReplicaIdentityStmt) MarshalJSON() ([]byte, error)

func (*ReplicaIdentityStmt) UnmarshalJSON ¶

func (node *ReplicaIdentityStmt) UnmarshalJSON(input []byte) (err error)

type ResTarget ¶

type ResTarget struct {
	Name        *string `json:"name"`        /* column name or NULL */
	Indirection List    `json:"indirection"` /* subscripts, field names, and '*', or NIL */
	Val         Node    `json:"val"`         /* the value expression to compute or assign */
	Location    int     `json:"location"`    /* token location, or -1 if unknown */
}

* ResTarget - * result target (used in target list of pre-transformed parse trees) * * In a SELECT target list, 'name' is the column label from an * 'AS ColumnLabel' clause, or NULL if there was none, and 'val' is the * value expression itself. The 'indirection' field is not used. * * INSERT uses ResTarget in its target-column-names list. Here, 'name' is * the name of the destination column, 'indirection' stores any subscripts * attached to the destination, and 'val' is not used. * * In an UPDATE target list, 'name' is the name of the destination column, * 'indirection' stores any subscripts attached to the destination, and * 'val' is the expression to assign. * * See A_Indirection for more info about what can appear in 'indirection'.

func (ResTarget) Deparse ¶

func (node ResTarget) Deparse(ctx Context) (*string, error)

func (ResTarget) Fingerprint ¶

func (node ResTarget) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ResTarget) MarshalJSON ¶

func (node ResTarget) MarshalJSON() ([]byte, error)

func (*ResTarget) UnmarshalJSON ¶

func (node *ResTarget) UnmarshalJSON(input []byte) (err error)

type RoleSpec ¶

type RoleSpec struct {
	Roletype RoleSpecType `json:"roletype"` /* Type of this rolespec */
	Rolename *string      `json:"rolename"` /* filled only for ROLESPEC_CSTRING */
	Location int          `json:"location"` /* token location, or -1 if unknown */
}

func (RoleSpec) Deparse ¶

func (node RoleSpec) Deparse(ctx Context) (*string, error)

func (RoleSpec) Fingerprint ¶

func (node RoleSpec) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RoleSpec) MarshalJSON ¶

func (node RoleSpec) MarshalJSON() ([]byte, error)

func (*RoleSpec) UnmarshalJSON ¶

func (node *RoleSpec) UnmarshalJSON(input []byte) (err error)

type RoleSpecType ¶

type RoleSpecType uint

* RoleSpec - a role name or one of a few special values.

const (
	ROLESPEC_CSTRING      RoleSpecType = iota /* role name is stored as a C string */
	ROLESPEC_CURRENT_USER                     /* role spec is CURRENT_USER */
	ROLESPEC_SESSION_USER                     /* role spec is SESSION_USER */
	ROLESPEC_PUBLIC                           /* role name is "public" */
)

type RoleStmtType ¶

type RoleStmtType uint

---------------------- * Create/Alter/Drop Role Statements * * Note: these node types are also used for the backwards-compatible * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases * there's really no need to distinguish what the original spelling was, * but for CREATE we mark the type because the defaults vary. * ----------------------

const (
	ROLESTMT_ROLE RoleStmtType = iota
	ROLESTMT_USER
	ROLESTMT_GROUP
)

type RowCompareExpr ¶

type RowCompareExpr struct {
	Xpr          Node           `json:"xpr"`
	Rctype       RowCompareType `json:"rctype"`       /* LT LE GE or GT, never EQ or NE */
	Opnos        List           `json:"opnos"`        /* OID list of pairwise comparison ops */
	Opfamilies   List           `json:"opfamilies"`   /* OID list of containing operator families */
	Inputcollids List           `json:"inputcollids"` /* OID list of collations for comparisons */
	Largs        List           `json:"largs"`        /* the left-hand input arguments */
	Rargs        List           `json:"rargs"`        /* the right-hand input arguments */
}

* RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2) * * We support row comparison for any operator that can be determined to * act like =, <>, <, <=, >, or >= (we determine this by looking for the * operator in btree opfamilies). Note that the same operator name might * map to a different operator for each pair of row elements, since the * element datatypes can vary. * * A RowCompareExpr node is only generated for the < <= > >= cases; * the = and <> cases are translated to simple AND or OR combinations * of the pairwise comparisons. However, we include = and <> in the * RowCompareType enum for the convenience of parser logic.

func (RowCompareExpr) Deparse ¶

func (node RowCompareExpr) Deparse(ctx Context) (*string, error)

func (RowCompareExpr) Fingerprint ¶

func (node RowCompareExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RowCompareExpr) MarshalJSON ¶

func (node RowCompareExpr) MarshalJSON() ([]byte, error)

func (*RowCompareExpr) UnmarshalJSON ¶

func (node *RowCompareExpr) UnmarshalJSON(input []byte) (err error)

type RowCompareType ¶

type RowCompareType uint

* RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2) * * We support row comparison for any operator that can be determined to * act like =, <>, <, <=, >, or >= (we determine this by looking for the * operator in btree opfamilies). Note that the same operator name might * map to a different operator for each pair of row elements, since the * element datatypes can vary. * * A RowCompareExpr node is only generated for the < <= > >= cases; * the = and <> cases are translated to simple AND or OR combinations * of the pairwise comparisons. However, we include = and <> in the * RowCompareType enum for the convenience of parser logic.

const (
	/* Values of this enum are chosen to match btree strategy numbers */
	ROWCOMPARE_LT RowCompareType = iota
	ROWCOMPARE_LE
	ROWCOMPARE_EQ
	ROWCOMPARE_GE
	ROWCOMPARE_GT
	ROWCOMPARE_NE
)

type RowExpr ¶

type RowExpr struct {
	Xpr       Node `json:"xpr"`
	Args      List `json:"args"`       /* the fields */
	RowTypeid Oid  `json:"row_typeid"` /* RECORDOID or a composite type's ID */

	/*
	 * Note: we deliberately do NOT store a typmod.  Although a typmod will be
	 * associated with specific RECORD types at runtime, it will differ for
	 * different backends, and so cannot safely be stored in stored
	 * parsetrees.  We must assume typmod -1 for a RowExpr node.
	 *
	 * We don't need to store a collation either.  The result type is
	 * necessarily composite, and composite types never have a collation.
	 */
	RowFormat CoercionForm `json:"row_format"` /* how to display this node */
	Colnames  List         `json:"colnames"`   /* list of String, or NIL */
	Location  int          `json:"location"`   /* token location, or -1 if unknown */
}

* RowExpr - a ROW() expression * * Note: the list of fields must have a one-for-one correspondence with * physical fields of the associated rowtype, although it is okay for it * to be shorter than the rowtype. That is, the N'th list element must * match up with the N'th physical field. When the N'th physical field * is a dropped column (attisdropped) then the N'th list element can just * be a NULL constant. (This case can only occur for named composite types, * not RECORD types, since those are built from the RowExpr itself rather * than vice versa.) It is important not to assume that length(args) is * the same as the number of columns logically present in the rowtype. * * colnames provides field names in cases where the names can't easily be * obtained otherwise. Names *must* be provided if row_typeid is RECORDOID. * If row_typeid identifies a known composite type, colnames can be NIL to * indicate the type's cataloged field names apply. Note that colnames can * be non-NIL even for a composite type, and typically is when the RowExpr * was created by expanding a whole-row Var. This is so that we can retain * the column alias names of the RTE that the Var referenced (which would * otherwise be very difficult to extract from the parsetree). Like the * args list, colnames is one-for-one with physical fields of the rowtype.

func (RowExpr) Deparse ¶

func (node RowExpr) Deparse(ctx Context) (*string, error)

func (RowExpr) Fingerprint ¶

func (node RowExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RowExpr) MarshalJSON ¶

func (node RowExpr) MarshalJSON() ([]byte, error)

func (*RowExpr) UnmarshalJSON ¶

func (node *RowExpr) UnmarshalJSON(input []byte) (err error)

type RowMarkClause ¶

type RowMarkClause struct {
	Rti        Index              `json:"rti"` /* range table index of target relation */
	Strength   LockClauseStrength `json:"strength"`
	WaitPolicy LockWaitPolicy     `json:"waitPolicy"` /* NOWAIT and SKIP LOCKED */
	PushedDown bool               `json:"pushedDown"` /* pushed down from higher query level? */
}

* RowMarkClause - * parser output representation of FOR [KEY] UPDATE/SHARE clauses * * Query.rowMarks contains a separate RowMarkClause node for each relation * identified as a FOR [KEY] UPDATE/SHARE target. If one of these clauses * is applied to a subquery, we generate RowMarkClauses for all normal and * subquery rels in the subquery, but they are marked pushedDown = true to * distinguish them from clauses that were explicitly written at this query * level. Also, Query.hasForUpdate tells whether there were explicit FOR * UPDATE/SHARE/KEY SHARE clauses in the current query level.

func (RowMarkClause) Deparse ¶

func (node RowMarkClause) Deparse(ctx Context) (*string, error)

func (RowMarkClause) Fingerprint ¶

func (node RowMarkClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RowMarkClause) MarshalJSON ¶

func (node RowMarkClause) MarshalJSON() ([]byte, error)

func (*RowMarkClause) UnmarshalJSON ¶

func (node *RowMarkClause) UnmarshalJSON(input []byte) (err error)

type RuleStmt ¶

type RuleStmt struct {
	Relation    *RangeVar `json:"relation"`    /* relation the rule is for */
	Rulename    *string   `json:"rulename"`    /* name of the rule */
	WhereClause Node      `json:"whereClause"` /* qualifications */
	Event       CmdType   `json:"event"`       /* SELECT, INSERT, etc */
	Instead     bool      `json:"instead"`     /* is a 'do instead'? */
	Actions     List      `json:"actions"`     /* the action statements */
	Replace     bool      `json:"replace"`     /* OR REPLACE */
}

---------------------- * Create Rule Statement * ----------------------

func (RuleStmt) Deparse ¶

func (node RuleStmt) Deparse(ctx Context) (*string, error)

func (RuleStmt) Fingerprint ¶

func (node RuleStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (RuleStmt) MarshalJSON ¶

func (node RuleStmt) MarshalJSON() ([]byte, error)

func (*RuleStmt) UnmarshalJSON ¶

func (node *RuleStmt) UnmarshalJSON(input []byte) (err error)

type SQLValueFunction ¶

type SQLValueFunction struct {
	Xpr      Node               `json:"xpr"`
	Op       SQLValueFunctionOp `json:"op"`   /* which function this is */
	Type     Oid                `json:"type"` /* result type/typmod */
	Typmod   int32              `json:"typmod"`
	Location int                `json:"location"` /* token location, or -1 if unknown */
}

func (SQLValueFunction) Deparse ¶

func (node SQLValueFunction) Deparse(ctx Context) (*string, error)

func (SQLValueFunction) Fingerprint ¶

func (node SQLValueFunction) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SQLValueFunction) MarshalJSON ¶

func (node SQLValueFunction) MarshalJSON() ([]byte, error)

func (*SQLValueFunction) UnmarshalJSON ¶

func (node *SQLValueFunction) UnmarshalJSON(input []byte) (err error)

type SQLValueFunctionOp ¶

type SQLValueFunctionOp uint

* SQLValueFunction - parameterless functions with special grammar productions * * The SQL standard categorizes some of these as <datetime value function> * and others as <general value specification>. We call 'em SQLValueFunctions * for lack of a better term. We store type and typmod of the result so that * some code doesn't need to know each function individually, and because * we would need to store typmod anyway for some of the datetime functions. * Note that currently, all variants return non-collating datatypes, so we do * not need a collation field; also, all these functions are stable.

const (
	SVFOP_CURRENT_DATE SQLValueFunctionOp = iota
	SVFOP_CURRENT_TIME
	SVFOP_CURRENT_TIME_N
	SVFOP_CURRENT_TIMESTAMP
	SVFOP_CURRENT_TIMESTAMP_N
	SVFOP_LOCALTIME
	SVFOP_LOCALTIME_N
	SVFOP_LOCALTIMESTAMP
	SVFOP_LOCALTIMESTAMP_N
	SVFOP_CURRENT_ROLE
	SVFOP_CURRENT_USER
	SVFOP_USER
	SVFOP_SESSION_USER
	SVFOP_CURRENT_CATALOG
	SVFOP_CURRENT_SCHEMA
)

type ScalarArrayOpExpr ¶

type ScalarArrayOpExpr struct {
	Xpr         Node `json:"xpr"`
	Opno        Oid  `json:"opno"`        /* PG_OPERATOR OID of the operator */
	Opfuncid    Oid  `json:"opfuncid"`    /* PG_PROC OID of underlying function */
	UseOr       bool `json:"useOr"`       /* true for ANY, false for ALL */
	Inputcollid Oid  `json:"inputcollid"` /* OID of collation that operator should use */
	Args        List `json:"args"`        /* the scalar and array operands */
	Location    int  `json:"location"`    /* token location, or -1 if unknown */
}

* ScalarArrayOpExpr - expression node for "scalar op ANY/ALL (array)" * * The operator must yield boolean. It is applied to the left operand * and each element of the righthand array, and the results are combined * with OR or AND (for ANY or ALL respectively). The node representation * is almost the same as for the underlying operator, but we need a useOr * flag to remember whether it's ANY or ALL, and we don't have to store * the result type (or the collation) because it must be boolean.

func (ScalarArrayOpExpr) Deparse ¶

func (node ScalarArrayOpExpr) Deparse(ctx Context) (*string, error)

func (ScalarArrayOpExpr) Fingerprint ¶

func (node ScalarArrayOpExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ScalarArrayOpExpr) MarshalJSON ¶

func (node ScalarArrayOpExpr) MarshalJSON() ([]byte, error)

func (*ScalarArrayOpExpr) UnmarshalJSON ¶

func (node *ScalarArrayOpExpr) UnmarshalJSON(input []byte) (err error)

type ScanDirection ¶

type ScanDirection uint

* ScanDirection was an int8 for no apparent reason. I kept the original * values because I'm not sure if I'll break anything otherwise. -ay 2/95

const (
	BackwardScanDirection ScanDirection = iota
	NoMovementScanDirection
	ForwardScanDirection
)

type SecLabelStmt ¶

type SecLabelStmt struct {
	Objtype  ObjectType `json:"objtype"`  /* Object's type */
	Object   Node       `json:"object"`   /* Qualified name of the object */
	Provider *string    `json:"provider"` /* Label provider (or NULL) */
	Label    *string    `json:"label"`    /* New security label to be assigned */
}

---------------------- * SECURITY LABEL Statement * ----------------------

func (SecLabelStmt) Deparse ¶

func (node SecLabelStmt) Deparse(ctx Context) (*string, error)

func (SecLabelStmt) Fingerprint ¶

func (node SecLabelStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SecLabelStmt) MarshalJSON ¶

func (node SecLabelStmt) MarshalJSON() ([]byte, error)

func (*SecLabelStmt) UnmarshalJSON ¶

func (node *SecLabelStmt) UnmarshalJSON(input []byte) (err error)

type SelectStmt ¶

type SelectStmt struct {
	/*
	 * These fields are used only in "leaf" SelectStmts.
	 */
	DistinctClause List `json:"distinctClause"` /* NULL, list of DISTINCT ON exprs, or
	 * lcons(NIL,NIL) for all (SELECT DISTINCT) */

	IntoClause   *IntoClause `json:"intoClause"`   /* target for SELECT INTO */
	TargetList   List        `json:"targetList"`   /* the target list (of ResTarget) */
	FromClause   List        `json:"fromClause"`   /* the FROM clause */
	WhereClause  Node        `json:"whereClause"`  /* WHERE qualification */
	GroupClause  List        `json:"groupClause"`  /* GROUP BY clauses */
	HavingClause Node        `json:"havingClause"` /* HAVING conditional-expression */
	WindowClause List        `json:"windowClause"` /* WINDOW window_name AS (...), ... */

	/*
	 * In a "leaf" node representing a VALUES list, the above fields are all
	 * null, and instead this field is set.  Note that the elements of the
	 * sublists are just expressions, without ResTarget decoration. Also note
	 * that a list element can be DEFAULT (represented as a SetToDefault
	 * node), regardless of the context of the VALUES list. It's up to parse
	 * analysis to reject that where not valid.
	 */
	ValuesLists [][]Node `json:"valuesLists"` /* untransformed list of expression lists */

	/*
	 * These fields are used in both "leaf" SelectStmts and upper-level
	 * SelectStmts.
	 */
	SortClause    List        `json:"sortClause"`    /* sort clause (a list of SortBy's) */
	LimitOffset   Node        `json:"limitOffset"`   /* # of result tuples to skip */
	LimitCount    Node        `json:"limitCount"`    /* # of result tuples to return */
	LockingClause List        `json:"lockingClause"` /* FOR UPDATE (list of LockingClause's) */
	WithClause    *WithClause `json:"withClause"`    /* WITH clause */

	/*
	 * These fields are used only in upper-level SelectStmts.
	 */
	Op   SetOperation `json:"op"`   /* type of set op */
	All  bool         `json:"all"`  /* ALL specified? */
	Larg *SelectStmt  `json:"larg"` /* left child */
	Rarg *SelectStmt  `json:"rarg"` /* right child */

}

---------------------- * Select Statement * * A "simple" SELECT is represented in the output of gram.y by a single * SelectStmt node; so is a VALUES construct. A query containing set * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt * nodes, in which the leaf nodes are component SELECTs and the internal nodes * represent UNION, INTERSECT, or EXCEPT operators. Using the same node * type for both leaf and internal nodes allows gram.y to stick ORDER BY, * LIMIT, etc, clause values into a SELECT statement without worrying * whether it is a simple or compound SELECT. * ----------------------

func (SelectStmt) Deparse ¶

func (node SelectStmt) Deparse(ctx Context) (*string, error)

func (SelectStmt) Fingerprint ¶

func (node SelectStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SelectStmt) MarshalJSON ¶

func (node SelectStmt) MarshalJSON() ([]byte, error)

func (SelectStmt) StatementTag ¶

func (node SelectStmt) StatementTag() string

func (SelectStmt) StatementType ¶

func (node SelectStmt) StatementType() StmtType

func (*SelectStmt) UnmarshalJSON ¶

func (node *SelectStmt) UnmarshalJSON(input []byte) (err error)

type Selectivity ¶

type Selectivity float64

type SetOpCmd ¶

type SetOpCmd uint

* SetOpCmd and SetOpStrategy - * overall semantics and execution strategies for SetOp plan nodes * * This is needed in both plannodes.h and relation.h, so put it here...

const (
	SETOPCMD_INTERSECT SetOpCmd = iota
	SETOPCMD_INTERSECT_ALL
	SETOPCMD_EXCEPT
	SETOPCMD_EXCEPT_ALL
)

type SetOpStrategy ¶

type SetOpStrategy uint
const (
	SETOP_SORTED SetOpStrategy = iota /* input must be sorted */
	SETOP_HASHED                      /* use internal hashtable */
)

type SetOperation ¶

type SetOperation uint

---------------------- * Select Statement * * A "simple" SELECT is represented in the output of gram.y by a single * SelectStmt node; so is a VALUES construct. A query containing set * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt * nodes, in which the leaf nodes are component SELECTs and the internal nodes * represent UNION, INTERSECT, or EXCEPT operators. Using the same node * type for both leaf and internal nodes allows gram.y to stick ORDER BY, * LIMIT, etc, clause values into a SELECT statement without worrying * whether it is a simple or compound SELECT. * ----------------------

const (
	SETOP_NONE SetOperation = iota
	SETOP_UNION
	SETOP_INTERSECT
	SETOP_EXCEPT
)

type SetOperationStmt ¶

type SetOperationStmt struct {
	Op   SetOperation `json:"op"`   /* type of set op */
	All  bool         `json:"all"`  /* ALL specified? */
	Larg Node         `json:"larg"` /* left child */
	Rarg Node         `json:"rarg"` /* right child */

	/* Fields derived during parse analysis: */
	ColTypes      List `json:"colTypes"`      /* OID list of output column type OIDs */
	ColTypmods    List `json:"colTypmods"`    /* integer list of output column typmods */
	ColCollations List `json:"colCollations"` /* OID list of output column collation OIDs */
	GroupClauses  List `json:"groupClauses"`  /* a list of SortGroupClause's */

}

---------------------- * Set Operation node for post-analysis query trees * * After parse analysis, a SELECT with set operations is represented by a * top-level Query node containing the leaf SELECTs as subqueries in its * range table. Its setOperations field shows the tree of set operations, * with leaf SelectStmt nodes replaced by RangeTblRef nodes, and internal * nodes replaced by SetOperationStmt nodes. Information about the output * column types is added, too. (Note that the child nodes do not necessarily * produce these types directly, but we've checked that their output types * can be coerced to the output column type.) Also, if it's not UNION ALL, * information about the types' sort/group semantics is provided in the form * of a SortGroupClause list (same representation as, eg, DISTINCT). * The resolved common column collations are provided too; but note that if * it's not UNION ALL, it's okay for a column to not have a common collation, * so a member of the colCollations list could be InvalidOid even though the * column has a collatable type. * ----------------------

func (SetOperationStmt) Deparse ¶

func (node SetOperationStmt) Deparse(ctx Context) (*string, error)

func (SetOperationStmt) Fingerprint ¶

func (node SetOperationStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SetOperationStmt) MarshalJSON ¶

func (node SetOperationStmt) MarshalJSON() ([]byte, error)

func (*SetOperationStmt) UnmarshalJSON ¶

func (node *SetOperationStmt) UnmarshalJSON(input []byte) (err error)

type SetToDefault ¶

type SetToDefault struct {
	Xpr       Node  `json:"xpr"`
	TypeId    Oid   `json:"typeId"`    /* type for substituted value */
	TypeMod   int32 `json:"typeMod"`   /* typemod for substituted value */
	Collation Oid   `json:"collation"` /* collation for the substituted value */
	Location  int   `json:"location"`  /* token location, or -1 if unknown */
}

* Placeholder node for a DEFAULT marker in an INSERT or UPDATE command. * * This is not an executable expression: it must be replaced by the actual * column default expression during rewriting. But it is convenient to * treat it as an expression node during parsing and rewriting.

func (SetToDefault) Deparse ¶

func (node SetToDefault) Deparse(ctx Context) (*string, error)

func (SetToDefault) Fingerprint ¶

func (node SetToDefault) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SetToDefault) MarshalJSON ¶

func (node SetToDefault) MarshalJSON() ([]byte, error)

func (*SetToDefault) UnmarshalJSON ¶

func (node *SetToDefault) UnmarshalJSON(input []byte) (err error)

type SortBy ¶

type SortBy struct {
	Node        Node        `json:"node"`         /* expression to sort on */
	SortbyDir   SortByDir   `json:"sortby_dir"`   /* ASC/DESC/USING/default */
	SortbyNulls SortByNulls `json:"sortby_nulls"` /* NULLS FIRST/LAST */
	UseOp       List        `json:"useOp"`        /* name of op to use, if SORTBY_USING */
	Location    int         `json:"location"`     /* operator location, or -1 if none/unknown */
}

* SortBy - for ORDER BY clause

func (SortBy) Deparse ¶

func (node SortBy) Deparse(ctx Context) (*string, error)

func (SortBy) Fingerprint ¶

func (node SortBy) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SortBy) MarshalJSON ¶

func (node SortBy) MarshalJSON() ([]byte, error)

func (*SortBy) UnmarshalJSON ¶

func (node *SortBy) UnmarshalJSON(input []byte) (err error)

type SortByDir ¶

type SortByDir uint

Sort ordering options for ORDER BY and CREATE INDEX

const (
	SORTBY_DEFAULT SortByDir = iota
	SORTBY_ASC
	SORTBY_DESC
	SORTBY_USING /* not allowed in CREATE INDEX ... */
)

type SortByNulls ¶

type SortByNulls uint
const (
	SORTBY_NULLS_DEFAULT SortByNulls = iota
	SORTBY_NULLS_FIRST
	SORTBY_NULLS_LAST
)

type SortGroupClause ¶

type SortGroupClause struct {
	TleSortGroupRef Index `json:"tleSortGroupRef"` /* reference into targetlist */
	Eqop            Oid   `json:"eqop"`            /* the equality operator ('=' op) */
	Sortop          Oid   `json:"sortop"`          /* the ordering operator ('<' op), or 0 */
	NullsFirst      bool  `json:"nulls_first"`     /* do NULLs come before normal values? */
	Hashable        bool  `json:"hashable"`        /* can eqop be implemented by hashing? */
}

* SortGroupClause - * representation of ORDER BY, GROUP BY, PARTITION BY, * DISTINCT, DISTINCT ON items * * You might think that ORDER BY is only interested in defining ordering, * and GROUP/DISTINCT are only interested in defining equality. However, * one way to implement grouping is to sort and then apply a "uniq"-like * filter. So it's also interesting to keep track of possible sort operators * for GROUP/DISTINCT, and in particular to try to sort for the grouping * in a way that will also yield a requested ORDER BY ordering. So we need * to be able to compare ORDER BY and GROUP/DISTINCT lists, which motivates * the decision to give them the same representation. * * tleSortGroupRef must match ressortgroupref of exactly one entry of the * query's targetlist; that is the expression to be sorted or grouped by. * eqop is the OID of the equality operator. * sortop is the OID of the ordering operator (a "<" or ">" operator), * or InvalidOid if not available. * nulls_first means about what you'd expect. If sortop is InvalidOid * then nulls_first is meaningless and should be set to false. * hashable is TRUE if eqop is hashable (note this condition also depends * on the datatype of the input expression). * * In an ORDER BY item, all fields must be valid. (The eqop isn't essential * here, but it's cheap to get it along with the sortop, and requiring it * to be valid eases comparisons to grouping items.) Note that this isn't * actually enough information to determine an ordering: if the sortop is * collation-sensitive, a collation OID is needed too. We don't store the * collation in SortGroupClause because it's not available at the time the * parser builds the SortGroupClause; instead, consult the exposed collation * of the referenced targetlist expression to find out what it is. * * In a grouping item, eqop must be valid. If the eqop is a btree equality * operator, then sortop should be set to a compatible ordering operator. * We prefer to set eqop/sortop/nulls_first to match any ORDER BY item that * the query presents for the same tlist item. If there is none, we just * use the default ordering op for the datatype. * * If the tlist item's type has a hash opclass but no btree opclass, then * we will set eqop to the hash equality operator, sortop to InvalidOid, * and nulls_first to false. A grouping item of this kind can only be * implemented by hashing, and of course it'll never match an ORDER BY item. * * The hashable flag is provided since we generally have the requisite * information readily available when the SortGroupClause is constructed, * and it's relatively expensive to get it again later. Note there is no * need for a "sortable" flag since OidIsValid(sortop) serves the purpose. * * A query might have both ORDER BY and DISTINCT (or DISTINCT ON) clauses. * In SELECT DISTINCT, the distinctClause list is as long or longer than the * sortClause list, while in SELECT DISTINCT ON it's typically shorter. * The two lists must match up to the end of the shorter one --- the parser * rearranges the distinctClause if necessary to make this true. (This * restriction ensures that only one sort step is needed to both satisfy the * ORDER BY and set up for the Unique step. This is semantically necessary * for DISTINCT ON, and presents no real drawback for DISTINCT.)

func (SortGroupClause) Deparse ¶

func (node SortGroupClause) Deparse(ctx Context) (*string, error)

func (SortGroupClause) Fingerprint ¶

func (node SortGroupClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SortGroupClause) MarshalJSON ¶

func (node SortGroupClause) MarshalJSON() ([]byte, error)

func (*SortGroupClause) UnmarshalJSON ¶

func (node *SortGroupClause) UnmarshalJSON(input []byte) (err error)

type Stmt ¶

type Stmt interface {
	StatementType() StmtType
	StatementTag() string
	Deparse(ctx Context) (*string, error)
}

type StmtType ¶

type StmtType int
const (
	// Ack indicates that the statement does not have a meaningful
	// return. Examples include SET, BEGIN, COMMIT.
	Ack StmtType = iota
	// DDL indicates that the statement mutates the database schema.
	//
	// Note: this is the type indicated back to the client; it is not a
	// sufficient test for schema mutation for planning purposes. There
	// are schema-modifying statements (e.g. CREATE TABLE AS) which
	// report RowsAffected to the client, not DDL.
	// Use CanModifySchema() below instead.
	DDL
	// RowsAffected indicates that the statement returns the count of
	// affected rows.
	RowsAffected
	// Rows indicates that the statement returns the affected rows after
	// the statement was applied.
	Rows
	// CopyIn indicates a COPY FROM statement.
	CopyIn
	// Unknown indicates that the statement does not have a known
	// return style at the time of parsing. This is not first in the
	// enumeration because it is more convenient to have Ack as a zero
	// value, and because the use of Unknown should be an explicit choice.
	// The primary example of this statement type is EXECUTE, where the
	// statement type depends on the statement type of the prepared statement
	// being executed.
	Unknown
)

type String ¶

type String struct {
	Str string `json:"str"`
}

func (String) Deparse ¶

func (node String) Deparse(ctx Context) (*string, error)

func (String) Fingerprint ¶

func (node String) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (String) MarshalJSON ¶

func (node String) MarshalJSON() ([]byte, error)

func (*String) UnmarshalJSON ¶

func (node *String) UnmarshalJSON(input []byte) (err error)
type SubLink struct {
	Xpr         Node        `json:"xpr"`
	SubLinkType SubLinkType `json:"subLinkType"` /* see above */
	SubLinkId   int         `json:"subLinkId"`   /* ID (1..n); 0 if not MULTIEXPR */
	Testexpr    Node        `json:"testexpr"`    /* outer-query test for ALL/ANY/ROWCOMPARE */
	OperName    List        `json:"operName"`    /* originally specified operator name */
	Subselect   Node        `json:"subselect"`   /* subselect as Query* or raw parsetree */
	Location    int         `json:"location"`    /* token location, or -1 if unknown */
}

* SubLink * * A SubLink represents a subselect appearing in an expression, and in some * cases also the combining operator(s) just above it. The subLinkType * indicates the form of the expression represented: * EXISTS_SUBLINK EXISTS(SELECT ...) * ALL_SUBLINK (lefthand) op ALL (SELECT ...) * ANY_SUBLINK (lefthand) op ANY (SELECT ...) * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...) * EXPR_SUBLINK (SELECT with single targetlist item ...) * MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...) * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...) * CTE_SUBLINK WITH query (never actually part of an expression) * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the * same length as the subselect's targetlist. ROWCOMPARE will *always* have * a list with more than one entry; if the subselect has just one target * then the parser will create an EXPR_SUBLINK instead (and any operator * above the subselect will be represented separately). * ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most * one row (if it returns no rows, the result is NULL). * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean * results. ALL and ANY combine the per-row results using AND and OR * semantics respectively. * ARRAY requires just one target column, and creates an array of the target * column's type using any number of rows resulting from the subselect. * * SubLink is classed as an Expr node, but it is not actually executable; * it must be replaced in the expression tree by a SubPlan node during * planning. * * NOTE: in the raw output of gram.y, testexpr contains just the raw form * of the lefthand expression (if any), and operName is the String name of * the combining operator. Also, subselect is a raw parsetree. During parse * analysis, the parser transforms testexpr into a complete boolean expression * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the * output columns of the subselect. And subselect is transformed to a Query. * This is the representation seen in saved rules and in the rewriter. * * In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName * are unused and are always null. * * subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in * other SubLinks. This number identifies different multiple-assignment * subqueries within an UPDATE statement's SET list. It is unique only * within a particular targetlist. The output column(s) of the MULTIEXPR * are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist. * * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used * in SubPlans generated for WITH subqueries.

func (SubLink) Deparse ¶

func (node SubLink) Deparse(ctx Context) (*string, error)

func (SubLink) Fingerprint ¶

func (node SubLink) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SubLink) MarshalJSON ¶

func (node SubLink) MarshalJSON() ([]byte, error)

func (*SubLink) UnmarshalJSON ¶

func (node *SubLink) UnmarshalJSON(input []byte) (err error)

type SubLinkType ¶

type SubLinkType uint

* SubLink * * A SubLink represents a subselect appearing in an expression, and in some * cases also the combining operator(s) just above it. The subLinkType * indicates the form of the expression represented: * EXISTS_SUBLINK EXISTS(SELECT ...) * ALL_SUBLINK (lefthand) op ALL (SELECT ...) * ANY_SUBLINK (lefthand) op ANY (SELECT ...) * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...) * EXPR_SUBLINK (SELECT with single targetlist item ...) * MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...) * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...) * CTE_SUBLINK WITH query (never actually part of an expression) * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the * same length as the subselect's targetlist. ROWCOMPARE will *always* have * a list with more than one entry; if the subselect has just one target * then the parser will create an EXPR_SUBLINK instead (and any operator * above the subselect will be represented separately). * ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most * one row (if it returns no rows, the result is NULL). * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean * results. ALL and ANY combine the per-row results using AND and OR * semantics respectively. * ARRAY requires just one target column, and creates an array of the target * column's type using any number of rows resulting from the subselect. * * SubLink is classed as an Expr node, but it is not actually executable; * it must be replaced in the expression tree by a SubPlan node during * planning. * * NOTE: in the raw output of gram.y, testexpr contains just the raw form * of the lefthand expression (if any), and operName is the String name of * the combining operator. Also, subselect is a raw parsetree. During parse * analysis, the parser transforms testexpr into a complete boolean expression * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the * output columns of the subselect. And subselect is transformed to a Query. * This is the representation seen in saved rules and in the rewriter. * * In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName * are unused and are always null. * * subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in * other SubLinks. This number identifies different multiple-assignment * subqueries within an UPDATE statement's SET list. It is unique only * within a particular targetlist. The output column(s) of the MULTIEXPR * are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist. * * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used * in SubPlans generated for WITH subqueries.

const (
	EXISTS_SUBLINK SubLinkType = iota
	ALL_SUBLINK
	ANY_SUBLINK
	ROWCOMPARE_SUBLINK
	EXPR_SUBLINK
	MULTIEXPR_SUBLINK
	ARRAY_SUBLINK
	CTE_SUBLINK /* for SubPlans only */
)

type SubPlan ¶

type SubPlan struct {
	Xpr Node `json:"xpr"`

	/* Fields copied from original SubLink: */
	SubLinkType SubLinkType `json:"subLinkType"` /* see above */

	/* The combining operators, transformed to an executable expression: */
	Testexpr Node `json:"testexpr"` /* OpExpr or RowCompareExpr expression tree */
	ParamIds List `json:"paramIds"` /* IDs of Params embedded in the above */

	/* Identification of the Plan tree to use: */
	PlanId int `json:"plan_id"` /* Index (from 1) in PlannedStmt.subplans */

	/* Identification of the SubPlan for EXPLAIN and debugging purposes: */
	PlanName *string `json:"plan_name"` /* A name assigned during planning */

	/* Extra data useful for determining subplan's output type: */
	FirstColType      Oid   `json:"firstColType"`      /* Type of first column of subplan result */
	FirstColTypmod    int32 `json:"firstColTypmod"`    /* Typmod of first column of subplan result */
	FirstColCollation Oid   `json:"firstColCollation"` /* Collation of first column of subplan
	 * result */

	/* Information about execution strategy: */
	UseHashTable bool `json:"useHashTable"` /* TRUE to store subselect output in a hash
	 * table (implies we are doing "IN") */

	UnknownEqFalse bool `json:"unknownEqFalse"` /* TRUE if it's okay to return FALSE when the
	 * spec result is UNKNOWN; this allows much
	 * simpler handling of null values */

	ParallelSafe bool `json:"parallel_safe"` /* is the subplan parallel-safe? */

	/* setParam and parParam are lists of integers (param IDs) */
	SetParam List `json:"setParam"` /* initplan subqueries have to set these
	 * Params for parent plan */

	ParParam List `json:"parParam"` /* indices of input Params from parent plan */
	Args     List `json:"args"`     /* exprs to pass as parParam values */

	/* Estimated execution costs: */
	StartupCost Cost `json:"startup_cost"`  /* one-time setup cost */
	PerCallCost Cost `json:"per_call_cost"` /* cost for each subplan evaluation */
}

* SubPlan - executable expression node for a subplan (sub-SELECT) * * The planner replaces SubLink nodes in expression trees with SubPlan * nodes after it has finished planning the subquery. SubPlan references * a sub-plantree stored in the subplans list of the toplevel PlannedStmt. * (We avoid a direct link to make it easier to copy expression trees * without causing multiple processing of the subplan.) * * In an ordinary subplan, testexpr points to an executable expression * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining * operator(s); the left-hand arguments are the original lefthand expressions, * and the right-hand arguments are PARAM_EXEC Param nodes representing the * outputs of the sub-select. (NOTE: runtime coercion functions may be * inserted as well.) This is just the same expression tree as testexpr in * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by * suitably numbered PARAM_EXEC nodes. * * If the sub-select becomes an initplan rather than a subplan, the executable * expression is part of the outer plan's expression tree (and the SubPlan * node itself is not, but rather is found in the outer plan's initPlan * list). In this case testexpr is NULL to avoid duplication. * * The planner also derives lists of the values that need to be passed into * and out of the subplan. Input values are represented as a list "args" of * expressions to be evaluated in the outer-query context (currently these * args are always just Vars, but in principle they could be any expression). * The values are assigned to the global PARAM_EXEC params indexed by parParam * (the parParam and args lists must have the same ordering). setParam is a * list of the PARAM_EXEC params that are computed by the sub-select, if it * is an initplan; they are listed in order by sub-select output column * position. (parParam and setParam are integer Lists, not Bitmapsets, * because their ordering is significant.) * * Also, the planner computes startup and per-call costs for use of the * SubPlan. Note that these include the cost of the subquery proper, * evaluation of the testexpr if any, and any hashtable management overhead.

func (SubPlan) Deparse ¶

func (node SubPlan) Deparse(ctx Context) (*string, error)

func (SubPlan) Fingerprint ¶

func (node SubPlan) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (SubPlan) MarshalJSON ¶

func (node SubPlan) MarshalJSON() ([]byte, error)

func (*SubPlan) UnmarshalJSON ¶

func (node *SubPlan) UnmarshalJSON(input []byte) (err error)

type SubTransactionId ¶

type SubTransactionId uint32

type TableFunc ¶

type TableFunc struct {
	NsUris        List     `json:"ns_uris"`       /* list of namespace uri */
	NsNames       List     `json:"ns_names"`      /* list of namespace names */
	Docexpr       Node     `json:"docexpr"`       /* input document expression */
	Rowexpr       Node     `json:"rowexpr"`       /* row filter expression */
	Colnames      List     `json:"colnames"`      /* column names (list of String) */
	Coltypes      List     `json:"coltypes"`      /* OID list of column type OIDs */
	Coltypmods    List     `json:"coltypmods"`    /* integer list of column typmods */
	Colcollations List     `json:"colcollations"` /* OID list of column collation OIDs */
	Colexprs      List     `json:"colexprs"`      /* list of column filter expressions */
	Coldefexprs   List     `json:"coldefexprs"`   /* list of column default expressions */
	Notnulls      []uint32 `json:"notnulls"`      /* nullability flag for each output column */
	Ordinalitycol int      `json:"ordinalitycol"` /* counts from 0; -1 if none specified */
	Location      int      `json:"location"`      /* token location, or -1 if unknown */
}

* TableFunc - node for a table function, such as XMLTABLE.

func (TableFunc) Deparse ¶

func (node TableFunc) Deparse(ctx Context) (*string, error)

func (TableFunc) Fingerprint ¶

func (node TableFunc) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TableFunc) MarshalJSON ¶

func (node TableFunc) MarshalJSON() ([]byte, error)

func (*TableFunc) UnmarshalJSON ¶

func (node *TableFunc) UnmarshalJSON(input []byte) (err error)

type TableLikeClause ¶

type TableLikeClause struct {
	Relation *RangeVar `json:"relation"`
	Options  uint32    `json:"options"` /* OR of TableLikeOption flags */
}

* TableLikeClause - CREATE TABLE ( ... LIKE ... ) clause

func (TableLikeClause) Deparse ¶

func (node TableLikeClause) Deparse(ctx Context) (*string, error)

func (TableLikeClause) Fingerprint ¶

func (node TableLikeClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TableLikeClause) MarshalJSON ¶

func (node TableLikeClause) MarshalJSON() ([]byte, error)

func (*TableLikeClause) UnmarshalJSON ¶

func (node *TableLikeClause) UnmarshalJSON(input []byte) (err error)

type TableLikeOption ¶

type TableLikeOption uint
const (
	CREATE_TABLE_LIKE_DEFAULTS TableLikeOption = iota
	CREATE_TABLE_LIKE_CONSTRAINTS
	CREATE_TABLE_LIKE_IDENTITY
	CREATE_TABLE_LIKE_INDEXES
	CREATE_TABLE_LIKE_STORAGE
	CREATE_TABLE_LIKE_COMMENTS
	CREATE_TABLE_LIKE_ALL
)

type TableSampleClause ¶

type TableSampleClause struct {
	Tsmhandler Oid  `json:"tsmhandler"` /* OID of the tablesample handler function */
	Args       List `json:"args"`       /* tablesample argument expression(s) */
	Repeatable Node `json:"repeatable"` /* REPEATABLE expression, or NULL if none */
}

* TableSampleClause - TABLESAMPLE appearing in a transformed FROM clause * * Unlike RangeTableSample, this is a subnode of the relevant RangeTblEntry.

func (TableSampleClause) Deparse ¶

func (node TableSampleClause) Deparse(ctx Context) (*string, error)

func (TableSampleClause) Fingerprint ¶

func (node TableSampleClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TableSampleClause) MarshalJSON ¶

func (node TableSampleClause) MarshalJSON() ([]byte, error)

func (*TableSampleClause) UnmarshalJSON ¶

func (node *TableSampleClause) UnmarshalJSON(input []byte) (err error)

type TargetEntry ¶

type TargetEntry struct {
	Xpr             Node       `json:"xpr"`
	Expr            Node       `json:"expr"`            /* expression to evaluate */
	Resno           AttrNumber `json:"resno"`           /* attribute number (see notes above) */
	Resname         *string    `json:"resname"`         /* name of the column (could be NULL) */
	Ressortgroupref Index      `json:"ressortgroupref"` /* nonzero if referenced by a sort/group
	 * clause */

	Resorigtbl Oid        `json:"resorigtbl"` /* OID of column's source table */
	Resorigcol AttrNumber `json:"resorigcol"` /* column's number in source table */
	Resjunk    bool       `json:"resjunk"`    /* set to true to eliminate the attribute from
	 * final target list */
}

--------------------

  • TargetEntry -
  • a target entry (used in query target lists) *
  • Strictly speaking, a TargetEntry isn't an expression node (since it can't
  • be evaluated by ExecEvalExpr). But we treat it as one anyway, since in
  • very many places it's convenient to process a whole query targetlist as a
  • single expression tree. *
  • In a SELECT's targetlist, resno should always be equal to the item's
  • ordinal position (counting from 1). However, in an INSERT or UPDATE
  • targetlist, resno represents the attribute number of the destination
  • column for the item; so there may be missing or out-of-order resnos.
  • It is even legal to have duplicated resnos; consider
  • UPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ...
  • The two meanings come together in the executor, because the planner
  • transforms INSERT/UPDATE tlists into a normalized form with exactly
  • one entry for each column of the destination table. Before that's
  • happened, however, it is risky to assume that resno == position.
  • Generally get_tle_by_resno() should be used rather than list_nth()
  • to fetch tlist entries by resno, and only in SELECT should you assume
  • that resno is a unique identifier. *
  • resname is required to represent the correct column name in non-resjunk
  • entries of top-level SELECT targetlists, since it will be used as the
  • column title sent to the frontend. In most other contexts it is only
  • a debugging aid, and may be wrong or even NULL. (In particular, it may
  • be wrong in a tlist from a stored rule, if the referenced column has been
  • renamed by ALTER TABLE since the rule was made. Also, the planner tends
  • to store NULL rather than look up a valid name for tlist entries in
  • non-toplevel plan nodes.) In resjunk entries, resname should be either
  • a specific system-generated name (such as "ctid") or NULL; anything else
  • risks confusing ExecGetJunkAttribute! *
  • ressortgroupref is used in the representation of ORDER BY, GROUP BY, and
  • DISTINCT items. Targetlist entries with ressortgroupref=0 are not
  • sort/group items. If ressortgroupref>0, then this item is an ORDER BY,
  • GROUP BY, and/or DISTINCT target value. No two entries in a targetlist
  • may have the same nonzero ressortgroupref --- but there is no particular
  • meaning to the nonzero values, except as tags. (For example, one must
  • not assume that lower ressortgroupref means a more significant sort key.)
  • The order of the associated SortGroupClause lists determine the semantics. *
  • resorigtbl/resorigcol identify the source of the column, if it is a
  • simple reference to a column of a base table (or view). If it is not
  • a simple reference, these fields are zeroes. *
  • If resjunk is true then the column is a working column (such as a sort key)
  • that should be removed from the final output of the query. Resjunk columns
  • must have resnos that cannot duplicate any regular column's resno. Also
  • note that there are places that assume resjunk columns come after non-junk
  • columns. *--------------------

func (TargetEntry) Deparse ¶

func (node TargetEntry) Deparse(ctx Context) (*string, error)

func (TargetEntry) Fingerprint ¶

func (node TargetEntry) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TargetEntry) MarshalJSON ¶

func (node TargetEntry) MarshalJSON() ([]byte, error)

func (*TargetEntry) UnmarshalJSON ¶

func (node *TargetEntry) UnmarshalJSON(input []byte) (err error)

type TransactionId ¶

type TransactionId uint32

type TransactionStmt ¶

type TransactionStmt struct {
	Kind    TransactionStmtKind `json:"kind"`    /* see above */
	Options List                `json:"options"` /* for BEGIN/START and savepoint commands */
	Gid     *string             `json:"gid"`     /* for two-phase-commit related commands */
}

---------------------- * {Begin|Commit|Rollback} Transaction Statement * ----------------------

func (TransactionStmt) Deparse ¶

func (node TransactionStmt) Deparse(ctx Context) (*string, error)

func (TransactionStmt) Fingerprint ¶

func (node TransactionStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TransactionStmt) MarshalJSON ¶

func (node TransactionStmt) MarshalJSON() ([]byte, error)

func (TransactionStmt) StatementTag ¶

func (node TransactionStmt) StatementTag() string

func (TransactionStmt) StatementType ¶

func (node TransactionStmt) StatementType() StmtType

func (*TransactionStmt) UnmarshalJSON ¶

func (node *TransactionStmt) UnmarshalJSON(input []byte) (err error)

type TransactionStmtKind ¶

type TransactionStmtKind uint

---------------------- * {Begin|Commit|Rollback} Transaction Statement * ----------------------

const (
	TRANS_STMT_BEGIN TransactionStmtKind = iota
	TRANS_STMT_START                     /* semantically identical to BEGIN */
	TRANS_STMT_COMMIT
	TRANS_STMT_ROLLBACK
	TRANS_STMT_SAVEPOINT
	TRANS_STMT_RELEASE
	TRANS_STMT_ROLLBACK_TO
	TRANS_STMT_PREPARE
	TRANS_STMT_COMMIT_PREPARED
	TRANS_STMT_ROLLBACK_PREPARED
)

type TriggerTransition ¶

type TriggerTransition struct {
	Name    *string `json:"name"`
	IsNew   bool    `json:"isNew"`
	IsTable bool    `json:"isTable"`
}

* TriggerTransition - * representation of transition row or table naming clause * * Only transition tables are initially supported in the syntax, and only for * AFTER triggers, but other permutations are accepted by the parser so we can * give a meaningful message from C code.

func (TriggerTransition) Deparse ¶

func (node TriggerTransition) Deparse(ctx Context) (*string, error)

func (TriggerTransition) Fingerprint ¶

func (node TriggerTransition) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TriggerTransition) MarshalJSON ¶

func (node TriggerTransition) MarshalJSON() ([]byte, error)

func (*TriggerTransition) UnmarshalJSON ¶

func (node *TriggerTransition) UnmarshalJSON(input []byte) (err error)

type TruncateStmt ¶

type TruncateStmt struct {
	Relations   List         `json:"relations"`    /* relations (RangeVars) to be truncated */
	RestartSeqs bool         `json:"restart_seqs"` /* restart owned sequences? */
	Behavior    DropBehavior `json:"behavior"`     /* RESTRICT or CASCADE behavior */
}

---------------------- * Truncate Table Statement * ----------------------

func (TruncateStmt) Deparse ¶

func (node TruncateStmt) Deparse(ctx Context) (*string, error)

func (TruncateStmt) Fingerprint ¶

func (node TruncateStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TruncateStmt) MarshalJSON ¶

func (node TruncateStmt) MarshalJSON() ([]byte, error)

func (*TruncateStmt) UnmarshalJSON ¶

func (node *TruncateStmt) UnmarshalJSON(input []byte) (err error)

type TypeCast ¶

type TypeCast struct {
	Arg      Node      `json:"arg"`      /* the expression being casted */
	TypeName *TypeName `json:"typeName"` /* the target type */
	Location int       `json:"location"` /* token location, or -1 if unknown */
}

* TypeCast - a CAST expression

func (TypeCast) Deparse ¶

func (node TypeCast) Deparse(ctx Context) (*string, error)

func (TypeCast) Fingerprint ¶

func (node TypeCast) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TypeCast) MarshalJSON ¶

func (node TypeCast) MarshalJSON() ([]byte, error)

func (*TypeCast) UnmarshalJSON ¶

func (node *TypeCast) UnmarshalJSON(input []byte) (err error)

type TypeName ¶

type TypeName struct {
	Names       List  `json:"names"`       /* qualified name (list of Value strings) */
	TypeOid     Oid   `json:"typeOid"`     /* type identified by OID */
	Setof       bool  `json:"setof"`       /* is a set? */
	PctType     bool  `json:"pct_type"`    /* %TYPE specified? */
	Typmods     List  `json:"typmods"`     /* type modifier expression(s) */
	Typemod     int32 `json:"typemod"`     /* prespecified type modifier */
	ArrayBounds List  `json:"arrayBounds"` /* array bounds */
	Location    int   `json:"location"`    /* token location, or -1 if unknown */
}

* TypeName - specifies a type in definitions * * For TypeName structures generated internally, it is often easier to * specify the type by OID than by name. If "names" is NIL then the * actual type OID is given by typeOid, otherwise typeOid is unused. * Similarly, if "typmods" is NIL then the actual typmod is expected to * be prespecified in typemod, otherwise typemod is unused. * * If pct_type is TRUE, then names is actually a field name and we look up * the type of that field. Otherwise (the normal case), names is a type * name possibly qualified with schema and database name.

func (TypeName) Deparse ¶

func (node TypeName) Deparse(ctx Context) (*string, error)

func (TypeName) Fingerprint ¶

func (node TypeName) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (TypeName) MarshalJSON ¶

func (node TypeName) MarshalJSON() ([]byte, error)

func (*TypeName) UnmarshalJSON ¶

func (node *TypeName) UnmarshalJSON(input []byte) (err error)

type UnlistenStmt ¶

type UnlistenStmt struct {
	Conditionname *string `json:"conditionname"` /* name to unlisten on, or NULL for all */
}

---------------------- * Unlisten Statement * ----------------------

func (UnlistenStmt) Deparse ¶

func (node UnlistenStmt) Deparse(ctx Context) (*string, error)

func (UnlistenStmt) Fingerprint ¶

func (node UnlistenStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (UnlistenStmt) MarshalJSON ¶

func (node UnlistenStmt) MarshalJSON() ([]byte, error)

func (*UnlistenStmt) UnmarshalJSON ¶

func (node *UnlistenStmt) UnmarshalJSON(input []byte) (err error)

type UpdateStmt ¶

type UpdateStmt struct {
	Relation      *RangeVar   `json:"relation"`      /* relation to update */
	TargetList    List        `json:"targetList"`    /* the target list (of ResTarget) */
	WhereClause   Node        `json:"whereClause"`   /* qualifications */
	FromClause    List        `json:"fromClause"`    /* optional from clause for more tables */
	ReturningList List        `json:"returningList"` /* list of expressions to return */
	WithClause    *WithClause `json:"withClause"`    /* WITH clause */
}

---------------------- * Update Statement * ----------------------

func (UpdateStmt) Deparse ¶

func (node UpdateStmt) Deparse(ctx Context) (*string, error)

func (UpdateStmt) Fingerprint ¶

func (node UpdateStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (UpdateStmt) MarshalJSON ¶

func (node UpdateStmt) MarshalJSON() ([]byte, error)

func (UpdateStmt) StatementTag ¶

func (node UpdateStmt) StatementTag() string

func (UpdateStmt) StatementType ¶

func (node UpdateStmt) StatementType() StmtType

func (*UpdateStmt) UnmarshalJSON ¶

func (node *UpdateStmt) UnmarshalJSON(input []byte) (err error)

type VacuumOption ¶

type VacuumOption uint

---------------------- * Vacuum and Analyze Statements * * Even though these are nominally two statements, it's convenient to use * just one node type for both. Note that at least one of VACOPT_VACUUM * and VACOPT_ANALYZE must be set in options. * ----------------------

const (
	VACOPT_VACUUM VacuumOption = iota
	VACOPT_ANALYZE
	VACOPT_VERBOSE
	VACOPT_FREEZE
	VACOPT_FULL
	VACOPT_NOWAIT
	VACOPT_SKIPTOAST
	VACOPT_DISABLE_PAGE_SKIPPING
)

type VacuumStmt ¶

type VacuumStmt struct {
	Options  int       `json:"options"`  /* OR of VacuumOption flags */
	Relation *RangeVar `json:"relation"` /* single table to process, or NULL */
	VaCols   List      `json:"va_cols"`  /* list of column names, or NIL for all */
}

---------------------- * Vacuum and Analyze Statements * * Even though these are nominally two statements, it's convenient to use * just one node type for both. Note that at least one of VACOPT_VACUUM * and VACOPT_ANALYZE must be set in options. * ----------------------

func (VacuumStmt) Deparse ¶

func (node VacuumStmt) Deparse(ctx Context) (*string, error)

func (VacuumStmt) Fingerprint ¶

func (node VacuumStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (VacuumStmt) MarshalJSON ¶

func (node VacuumStmt) MarshalJSON() ([]byte, error)

func (*VacuumStmt) UnmarshalJSON ¶

func (node *VacuumStmt) UnmarshalJSON(input []byte) (err error)

type Var ¶

type Var struct {
	Xpr   Node  `json:"xpr"`
	Varno Index `json:"varno"` /* index of this var's relation in the range
	 * table, or INNER_VAR/OUTER_VAR/INDEX_VAR */

	Varattno AttrNumber `json:"varattno"` /* attribute number of this var, or zero for
	 * all */

	Vartype     Oid   `json:"vartype"`     /* pg_type OID for the type of this var */
	Vartypmod   int32 `json:"vartypmod"`   /* pg_attribute typmod value */
	Varcollid   Oid   `json:"varcollid"`   /* OID of collation, or InvalidOid if none */
	Varlevelsup Index `json:"varlevelsup"` /* for subquery variables referencing outer
	 * relations; 0 in a normal var, >0 means N
	 * levels up */

	Varnoold  Index      `json:"varnoold"`  /* original value of varno, for debugging */
	Varoattno AttrNumber `json:"varoattno"` /* original value of varattno */
	Location  int        `json:"location"`  /* token location, or -1 if unknown */
}

Symbols for the indexes of the special RTE entries in rules

func (Var) Deparse ¶

func (node Var) Deparse(ctx Context) (*string, error)

func (Var) Fingerprint ¶

func (node Var) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (Var) MarshalJSON ¶

func (node Var) MarshalJSON() ([]byte, error)

func (*Var) UnmarshalJSON ¶

func (node *Var) UnmarshalJSON(input []byte) (err error)

type VariableSetKind ¶

type VariableSetKind uint

---------------------- * SET Statement (includes RESET) * * "SET var TO DEFAULT" and "RESET var" are semantically equivalent, but we * preserve the distinction in VariableSetKind for CreateCommandTag(). * ----------------------

const (
	VAR_SET_VALUE   VariableSetKind = iota /* SET var = value */
	VAR_SET_DEFAULT                        /* SET var TO DEFAULT */
	VAR_SET_CURRENT                        /* SET var FROM CURRENT */
	VAR_SET_MULTI                          /* special case for SET TRANSACTION ... */
	VAR_RESET                              /* RESET var */
	VAR_RESET_ALL                          /* RESET ALL */
)

type VariableSetStmt ¶

type VariableSetStmt struct {
	Stmt
	Kind    VariableSetKind `json:"kind"`
	Name    *string         `json:"name"`     /* variable to be set */
	Args    List            `json:"args"`     /* List of A_Const nodes */
	IsLocal bool            `json:"is_local"` /* SET LOCAL? */
}

func (VariableSetStmt) Deparse ¶

func (node VariableSetStmt) Deparse(ctx Context) (*string, error)

func (VariableSetStmt) Fingerprint ¶

func (node VariableSetStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (VariableSetStmt) MarshalJSON ¶

func (node VariableSetStmt) MarshalJSON() ([]byte, error)

func (VariableSetStmt) StatementTag ¶

func (node VariableSetStmt) StatementTag() string

func (VariableSetStmt) StatementType ¶

func (node VariableSetStmt) StatementType() StmtType

func (*VariableSetStmt) UnmarshalJSON ¶

func (node *VariableSetStmt) UnmarshalJSON(input []byte) (err error)

type VariableShowStmt ¶

type VariableShowStmt struct {
	Stmt
	Name *string `json:"name"`
}

---------------------- * Show Statement * ----------------------

func (VariableShowStmt) Deparse ¶

func (node VariableShowStmt) Deparse(ctx Context) (*string, error)

func (VariableShowStmt) Fingerprint ¶

func (node VariableShowStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (VariableShowStmt) MarshalJSON ¶

func (node VariableShowStmt) MarshalJSON() ([]byte, error)

func (VariableShowStmt) StatementTag ¶

func (node VariableShowStmt) StatementTag() string

func (VariableShowStmt) StatementType ¶

func (node VariableShowStmt) StatementType() StmtType

func (*VariableShowStmt) UnmarshalJSON ¶

func (node *VariableShowStmt) UnmarshalJSON(input []byte) (err error)

type ViewCheckOption ¶

type ViewCheckOption uint

---------------------- * Create View Statement * ----------------------

const (
	NO_CHECK_OPTION ViewCheckOption = iota
	LOCAL_CHECK_OPTION
	CASCADED_CHECK_OPTION
)

type ViewStmt ¶

type ViewStmt struct {
	View            *RangeVar       `json:"view"`            /* the view to be created */
	Aliases         List            `json:"aliases"`         /* target column names */
	Query           Node            `json:"query"`           /* the SELECT query (as a raw parse tree) */
	Replace         bool            `json:"replace"`         /* replace an existing view? */
	Options         List            `json:"options"`         /* options from WITH clause */
	WithCheckOption ViewCheckOption `json:"withCheckOption"` /* WITH CHECK OPTION */
}

---------------------- * Create View Statement * ----------------------

func (ViewStmt) Deparse ¶

func (node ViewStmt) Deparse(ctx Context) (*string, error)

func (ViewStmt) Fingerprint ¶

func (node ViewStmt) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (ViewStmt) MarshalJSON ¶

func (node ViewStmt) MarshalJSON() ([]byte, error)

func (*ViewStmt) UnmarshalJSON ¶

func (node *ViewStmt) UnmarshalJSON(input []byte) (err error)

type WCOKind ¶

type WCOKind uint

* WithCheckOption - * representation of WITH CHECK OPTION checks to be applied to new tuples * when inserting/updating an auto-updatable view, or RLS WITH CHECK * policies to be applied when inserting/updating a relation with RLS.

const (
	WCO_VIEW_CHECK         WCOKind = iota /* WCO on an auto-updatable view */
	WCO_RLS_INSERT_CHECK                  /* RLS INSERT WITH CHECK policy */
	WCO_RLS_UPDATE_CHECK                  /* RLS UPDATE WITH CHECK policy */
	WCO_RLS_CONFLICT_CHECK                /* RLS ON CONFLICT DO UPDATE USING policy */
)

type WindowClause ¶

type WindowClause struct {
	Name            *string `json:"name"`            /* window name (NULL in an OVER clause) */
	Refname         *string `json:"refname"`         /* referenced window name, if any */
	PartitionClause List    `json:"partitionClause"` /* PARTITION BY list */
	OrderClause     List    `json:"orderClause"`     /* ORDER BY list */
	FrameOptions    int     `json:"frameOptions"`    /* frame_clause options, see WindowDef */
	StartOffset     Node    `json:"startOffset"`     /* expression for starting bound, if any */
	EndOffset       Node    `json:"endOffset"`       /* expression for ending bound, if any */
	Winref          Index   `json:"winref"`          /* ID referenced by window functions */
	CopiedOrder     bool    `json:"copiedOrder"`     /* did we copy orderClause from refname? */
}

* WindowClause - * transformed representation of WINDOW and OVER clauses * * A parsed Query's windowClause list contains these structs. "name" is set * if the clause originally came from WINDOW, and is NULL if it originally * was an OVER clause (but note that we collapse out duplicate OVERs). * partitionClause and orderClause are lists of SortGroupClause structs. * winref is an ID number referenced by WindowFunc nodes; it must be unique * among the members of a Query's windowClause list. * When refname isn't null, the partitionClause is always copied from there; * the orderClause might or might not be copied (see copiedOrder); the framing * options are never copied, per spec.

func (WindowClause) Deparse ¶

func (node WindowClause) Deparse(ctx Context) (*string, error)

func (WindowClause) Fingerprint ¶

func (node WindowClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (WindowClause) MarshalJSON ¶

func (node WindowClause) MarshalJSON() ([]byte, error)

func (*WindowClause) UnmarshalJSON ¶

func (node *WindowClause) UnmarshalJSON(input []byte) (err error)

type WindowDef ¶

type WindowDef struct {
	Name            *string `json:"name"`            /* window's own name */
	Refname         *string `json:"refname"`         /* referenced window name, if any */
	PartitionClause List    `json:"partitionClause"` /* PARTITION BY expression list */
	OrderClause     List    `json:"orderClause"`     /* ORDER BY (list of SortBy) */
	FrameOptions    int     `json:"frameOptions"`    /* frame_clause options, see below */
	StartOffset     Node    `json:"startOffset"`     /* expression for starting bound, if any */
	EndOffset       Node    `json:"endOffset"`       /* expression for ending bound, if any */
	Location        int     `json:"location"`        /* parse location, or -1 if none/unknown */
}

* WindowDef - raw representation of WINDOW and OVER clauses * * For entries in a WINDOW list, "name" is the window name being defined. * For OVER clauses, we use "name" for the "OVER window" syntax, or "refname" * for the "OVER (window)" syntax, which is subtly different --- the latter * implies overriding the window frame clause.

func (WindowDef) Deparse ¶

func (node WindowDef) Deparse(ctx Context) (*string, error)

func (WindowDef) Fingerprint ¶

func (node WindowDef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (WindowDef) MarshalJSON ¶

func (node WindowDef) MarshalJSON() ([]byte, error)

func (*WindowDef) UnmarshalJSON ¶

func (node *WindowDef) UnmarshalJSON(input []byte) (err error)

type WindowFunc ¶

type WindowFunc struct {
	Xpr         Node  `json:"xpr"`
	Winfnoid    Oid   `json:"winfnoid"`    /* pg_proc Oid of the function */
	Wintype     Oid   `json:"wintype"`     /* type Oid of result of the window function */
	Wincollid   Oid   `json:"wincollid"`   /* OID of collation of result */
	Inputcollid Oid   `json:"inputcollid"` /* OID of collation that function should use */
	Args        List  `json:"args"`        /* arguments to the window function */
	Aggfilter   Node  `json:"aggfilter"`   /* FILTER expression, if any */
	Winref      Index `json:"winref"`      /* index of associated WindowClause */
	Winstar     bool  `json:"winstar"`     /* TRUE if argument list was really '*' */
	Winagg      bool  `json:"winagg"`      /* is function a simple aggregate? */
	Location    int   `json:"location"`    /* token location, or -1 if unknown */
}

* WindowFunc

func (WindowFunc) Deparse ¶

func (node WindowFunc) Deparse(ctx Context) (*string, error)

func (WindowFunc) Fingerprint ¶

func (node WindowFunc) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (WindowFunc) MarshalJSON ¶

func (node WindowFunc) MarshalJSON() ([]byte, error)

func (*WindowFunc) UnmarshalJSON ¶

func (node *WindowFunc) UnmarshalJSON(input []byte) (err error)

type WithCheckOption ¶

type WithCheckOption struct {
	Kind     WCOKind `json:"kind"`     /* kind of WCO */
	Relname  *string `json:"relname"`  /* name of relation that specified the WCO */
	Polname  *string `json:"polname"`  /* name of RLS policy being checked */
	Qual     Node    `json:"qual"`     /* constraint qual to check */
	Cascaded bool    `json:"cascaded"` /* true for a cascaded WCO on a view */
}

func (WithCheckOption) Deparse ¶

func (node WithCheckOption) Deparse(ctx Context) (*string, error)

func (WithCheckOption) Fingerprint ¶

func (node WithCheckOption) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (WithCheckOption) MarshalJSON ¶

func (node WithCheckOption) MarshalJSON() ([]byte, error)

func (*WithCheckOption) UnmarshalJSON ¶

func (node *WithCheckOption) UnmarshalJSON(input []byte) (err error)

type WithClause ¶

type WithClause struct {
	Ctes      List `json:"ctes"`      /* list of CommonTableExprs */
	Recursive bool `json:"recursive"` /* true = WITH RECURSIVE */
	Location  int  `json:"location"`  /* token location, or -1 if unknown */
}

* WithClause - * representation of WITH clause * * Note: WithClause does not propagate into the Query representation; * but CommonTableExpr does.

func (WithClause) Deparse ¶

func (node WithClause) Deparse(ctx Context) (*string, error)

func (WithClause) Fingerprint ¶

func (node WithClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (WithClause) MarshalJSON ¶

func (node WithClause) MarshalJSON() ([]byte, error)

func (*WithClause) UnmarshalJSON ¶

func (node *WithClause) UnmarshalJSON(input []byte) (err error)

type XmlExpr ¶

type XmlExpr struct {
	Xpr       Node          `json:"xpr"`
	Op        XmlExprOp     `json:"op"`         /* xml function ID */
	Name      *string       `json:"name"`       /* name in xml(NAME foo ...) syntaxes */
	NamedArgs List          `json:"named_args"` /* non-XML expressions for xml_attributes */
	ArgNames  List          `json:"arg_names"`  /* parallel list of Value strings */
	Args      List          `json:"args"`       /* list of expressions */
	Xmloption XmlOptionType `json:"xmloption"`  /* DOCUMENT or CONTENT */
	Type      Oid           `json:"type"`       /* target type/typmod for XMLSERIALIZE */
	Typmod    int32         `json:"typmod"`
	Location  int           `json:"location"` /* token location, or -1 if unknown */
}

func (XmlExpr) Deparse ¶

func (node XmlExpr) Deparse(ctx Context) (*string, error)

func (XmlExpr) Fingerprint ¶

func (node XmlExpr) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (XmlExpr) MarshalJSON ¶

func (node XmlExpr) MarshalJSON() ([]byte, error)

func (*XmlExpr) UnmarshalJSON ¶

func (node *XmlExpr) UnmarshalJSON(input []byte) (err error)

type XmlExprOp ¶

type XmlExprOp uint

* XmlExpr - various SQL/XML functions requiring special grammar productions * * 'name' carries the "NAME foo" argument (already XML-escaped). * 'named_args' and 'arg_names' represent an xml_attribute list. * 'args' carries all other arguments. * * Note: result type/typmod/collation are not stored, but can be deduced * from the XmlExprOp. The type/typmod fields are just used for display * purposes, and are NOT necessarily the true result type of the node.

const (
	IS_XMLCONCAT    XmlExprOp = iota /* XMLCONCAT(args) */
	IS_XMLELEMENT                    /* XMLELEMENT(name, xml_attributes, args) */
	IS_XMLFOREST                     /* XMLFOREST(xml_attributes) */
	IS_XMLPARSE                      /* XMLPARSE(text, is_doc, preserve_ws) */
	IS_XMLPI                         /* XMLPI(name [, args]) */
	IS_XMLROOT                       /* XMLROOT(xml, version, standalone) */
	IS_XMLSERIALIZE                  /* XMLSERIALIZE(is_document, xmlval) */
	IS_DOCUMENT                      /* xmlval IS DOCUMENT */
)

type XmlOptionType ¶

type XmlOptionType uint
const (
	XMLOPTION_DOCUMENT XmlOptionType = iota
	XMLOPTION_CONTENT
)

type XmlSerialize ¶

type XmlSerialize struct {
	Xmloption XmlOptionType `json:"xmloption"` /* DOCUMENT or CONTENT */
	Expr      Node          `json:"expr"`
	TypeName  *TypeName     `json:"typeName"`
	Location  int           `json:"location"` /* token location, or -1 if unknown */
}

* XMLSERIALIZE (in raw parse tree only)

func (XmlSerialize) Deparse ¶

func (node XmlSerialize) Deparse(ctx Context) (*string, error)

func (XmlSerialize) Fingerprint ¶

func (node XmlSerialize) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string)

func (XmlSerialize) MarshalJSON ¶

func (node XmlSerialize) MarshalJSON() ([]byte, error)

func (*XmlSerialize) UnmarshalJSON ¶

func (node *XmlSerialize) UnmarshalJSON(input []byte) (err error)

Source Files ¶

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL