diff --git a/scripts/extract_headers.rb b/scripts/extract_headers.rb new file mode 100755 index 00000000..79919caa --- /dev/null +++ b/scripts/extract_headers.rb @@ -0,0 +1,238 @@ +#!/usr/bin/env ruby + +# You need to call this with the PostgreSQL source directory as the first commandline agument +# ./scripts/extract_headers.rb ./my_postgres_src_dir + +# rubocop:disable Style/PerlBackrefs, Metrics/AbcSize, Metrics/LineLength, Metrics/MethodLength, Style/WordArray, Metrics/ClassLength, Style/Documentation, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Style/TrailingComma, Style/RegexpLiteral + +require 'bundler' +require 'json' + +def underscore(str) + str + .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') + .gsub(/([a-z\d])([A-Z])/, '\1_\2') + .tr('-', '_') + .gsub(/\s/, '_') + .gsub(/__+/, '_') + .downcase +end + +def classify(str) + str + .gsub(/([A-Z]+)/, '_\1') + .split('_').collect(&:capitalize).join +end + +class Extractor + def initialize(pgdir) + @pgdir = pgdir + end + + def generate_nodetypes! + inside = false + @nodetypes = [] + + lines = File.read(File.join(@pgdir, '/src/include/nodes/nodes.h')) + lines.each_line do |line| + if inside + if line[/([A-z_]+)(\s+=\s+\d+)?,/] + @nodetypes << $1[2..-1] # Without T_ prefix + elsif line == "} NodeTag;\n" + inside = false + end + elsif line == "typedef enum NodeTag\n" + inside = true + end + end + end + + IGNORE_LIST = [ + 'Node', 'NodeTag', 'varlena', 'IntArray', 'nameData', 'bool', + 'sig_atomic_t', 'size_t', 'varatt_indirect', + ] + + def generate_defs! + @target_struct = nil + @open_comment = false + + @all_known_enums = [] + @enum_defs = {} + @struct_defs = {} + @typedefs = [] + + ['nodes/parsenodes', 'nodes/primnodes', + 'nodes/nodes', 'nodes/params', 'access/attnum', 'c', 'postgres', 'postgres_ext', + 'storage/block', 'access/sdir'].each do |group| + @target_group = group + @struct_defs[@target_group] = {} + @enum_defs[@target_group] = {} + @comment_text = nil + + lines = File.read(File.join(@pgdir, format('/src/include/%s.h', @target_group))) + lines.each_line do |line| + if !@current_struct_def.nil? + handle_struct(line) + elsif !@current_enum_def.nil? + handle_enum(line) + elsif line[/^typedef struct ([A-z]+)\s*(\/\*.+)?$/] + next if IGNORE_LIST.include?($1) + @current_struct_def = { fields: [], comment: @open_comment_text } + @open_comment_text = nil + elsif line[/^typedef enum( [A-z]+)?\s*(\/\*.+)?$/] + next if IGNORE_LIST.include?($1) + @current_enum_def = { values: [], comment: @open_comment_text } + @open_comment_text = nil + elsif line[/^typedef( struct)? ([A-z0-9\s_]+) \*?([A-z]+);/] + next if IGNORE_LIST.include?($2) || IGNORE_LIST.include?($3) + @typedefs << { new_type_name: $3, source_type: $2, comment: @open_comment_text } + @open_comment_text = nil + elsif line.strip.start_with?('/*') + @open_comment_text = line + @open_comment = !line.include?('*/') + elsif @open_comment + @open_comment_text += "\n" unless @open_comment_text.end_with?("\n") + @open_comment_text += line + @open_comment = !line.include?('*/') + end + end + end + end + + def handle_struct(line) + if line[/^\s+(struct |const )?([A-z0-9]+)\s+(\*){0,2}([A-z_]+);\s*(\/\*.+)?/] + name = $4 + c_type = $2 + $3.to_s + comment = $5 + + @current_struct_def[:fields] << { name: name, c_type: c_type, comment: comment } + + @open_comment = line.include?('/*') && !line.include?('*/') + elsif line[/^\}\s+([A-z]+);/] + @struct_defs[@target_group][$1] = @current_struct_def + @current_struct_def = nil + elsif line.strip.start_with?('/*') + @current_struct_def[:fields] << { comment: line } + @open_comment = !line.include?('*/') + elsif @open_comment + @current_struct_def[:fields].last[:comment] += "\n" unless @current_struct_def[:fields].last[:comment].end_with?("\n") + @current_struct_def[:fields].last[:comment] += line + @open_comment = !line.include?('*/') + elsif !@current_struct_def[:fields].empty? + @current_struct_def[:fields] << { comment: '' } + end + end + + def handle_enum(line) + if line[/^\s+([A-z0-9_]+),?\s*([A-z0-9_]+)?(\/\*.+)?/] + name = $1 + other_name = $2 + comment = $3 + + @current_enum_def[:values] << { name: name, comment: comment } + @current_enum_def[:values] << { name: other_name } if other_name + + @open_comment = line.include?('/*') && !line.include?('*/') + elsif line[/^\}\s+([A-z]+);/] + @all_known_enums << $1 + @enum_defs[@target_group][$1] = @current_enum_def + @current_enum_def = nil + elsif line.strip.start_with?('/*') + @current_enum_def[:values] << { comment: line } + @open_comment = !line.include?('*/') + elsif @open_comment + @current_enum_def[:values].last[:comment] += "\n" unless @current_enum_def[:values].last[:comment].end_with?("\n") + @current_enum_def[:values].last[:comment] += line + @open_comment = !line.include?('*/') + elsif !@current_enum_def.empty? + @current_enum_def[:values] << { comment: '' } + end + end + + # Top-of-struct comment special cases - we might want to merge these into the same output files at some point + COMMENT_ENUM_TO_STRUCT = { + 'nodes/parsenodes' => { + 'SelectStmt' => 'SetOperation', + 'CreateRoleStmt' => 'RoleStmtType', + 'AlterRoleStmt' => 'RoleStmtType', + 'AlterRoleSetStmt' => 'RoleStmtType', + 'DropRoleStmt' => 'RoleStmtType', + 'A_Expr' => 'A_Expr_Kind', + 'DefElem' => 'DefElemAction', + 'DiscardStmt' => 'DiscardMode', + 'FetchStmt' => 'FetchDirection', + 'GrantStmt' => 'GrantTargetType', + 'PrivGrantee' => 'GrantTargetType', + 'LockingClause' => 'LockClauseStrength', + 'RangeTblEntry' => 'RTEKind', + 'TransactionStmt' => 'TransactionStmtKind', + 'VacuumStmt' => 'VacuumOption', + 'ViewStmt' => 'ViewCheckOption', + }, + 'nodes/primnodes' => { + 'MinMaxExpr' => 'MinMaxOp', + 'Param' => 'ParamKind', + 'RowCompareExpr' => 'RowCompareType', + 'SubLink' => 'SubLinkType', + 'BooleanTest' => 'BoolTestType', + 'NullTest' => 'NullTestType', + } + } + COMMENT_STRUCT_TO_STRUCT = { + 'nodes/parsenodes' => { + 'AlterDatabaseSetStmt' => 'AlterDatabaseStmt', + # 'AlterExtensionStmt' => 'CreateExtensionStmt', # FIXME: This overrides an existing sub-comment + 'AlterExtensionContentsStmt' => 'CreateExtensionStmt', + 'AlterFdwStmt' => 'CreateFdwStmt', + 'AlterForeignServerStmt' => 'CreateForeignServerStmt', + 'AlterFunctionStmt' => 'CreateFunctionStmt', + 'AlterSeqStmt' => 'CreateSeqStmt', + 'AlterTableCmd' => 'AlterTableStmt', + 'ReplicaIdentityStmt' => 'AlterTableStmt', + 'AlterUserMappingStmt' => 'CreateUserMappingStmt', + 'DropUserMappingStmt' => 'CreateUserMappingStmt', + 'CreateOpClassItem' => 'CreateOpClassStmt', + 'DropTableSpaceStmt' => 'CreateTableSpaceStmt', + 'FunctionParameter' => 'CreateFunctionStmt', + 'InlineCodeBlock' => 'DoStmt', + }, + 'nodes/params' => { + 'ParamListInfoData' => 'ParamExternData', + }, + } + def transform_toplevel_comments! + COMMENT_ENUM_TO_STRUCT.each do |file, mapping| + mapping.each do |target, source| + @struct_defs[file][target][:comment] = @enum_defs[file][source][:comment] + end + end + + COMMENT_STRUCT_TO_STRUCT.each do |file, mapping| + mapping.each do |target, source| + @struct_defs[file][target][:comment] = @struct_defs[file][source][:comment] + end + end + end + + def extract! + generate_nodetypes! + generate_defs! + transform_toplevel_comments! + + @struct_defs['nodes/value'] = {} + @struct_defs['nodes/value']['Integer'] = { fields: [{ name: 'ival', c_type: 'long' }] } + @struct_defs['nodes/value']['Float'] = { fields: [{ name: 'str', c_type: 'char*' }] } + @struct_defs['nodes/value']['String'] = { fields: [{ name: 'str', c_type: 'char*' }] } + @struct_defs['nodes/value']['BitString'] = { fields: [{ name: 'str', c_type: 'char*' }] } + @struct_defs['nodes/pg_list'] = { 'List' => { fields: [{ name: 'items', c_type: '[]Node' }] } } + @struct_defs['nodes/value']['Null'] = { fields: [] } + + File.write('./srcdata/nodetypes.json', JSON.pretty_generate(@nodetypes)) + File.write('./srcdata/all_known_enums.json', JSON.pretty_generate(@all_known_enums)) + File.write('./srcdata/struct_defs.json', JSON.pretty_generate(@struct_defs)) + File.write('./srcdata/enum_defs.json', JSON.pretty_generate(@enum_defs)) + File.write('./srcdata/typedefs.json', JSON.pretty_generate(@typedefs)) + end +end + +Extractor.new(ARGV[0]).extract! diff --git a/pg_query_json_generator.rb b/scripts/generate_json_outfuncs.rb old mode 100644 new mode 100755 similarity index 50% rename from pg_query_json_generator.rb rename to scripts/generate_json_outfuncs.rb index b22d909e..5d35f3e6 --- a/pg_query_json_generator.rb +++ b/scripts/generate_json_outfuncs.rb @@ -1,28 +1,15 @@ +#!/usr/bin/env ruby + # rubocop:disable Metrics/MethodLength, Style/WordArray, Metrics/LineLength, Style/Documentation, Style/PerlBackrefs, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity require 'bundler' +require 'json' class Generator - def initialize(pgdir) - @pgdir = pgdir - end - - def generate_nodetypes! - inside = false - @nodetypes = [] - - lines = File.read(File.join(@pgdir, '/src/include/nodes/nodes.h')) - lines.each_line do |line| - if inside - if line[/([A-z_]+)(\s+=\s+\d+)?,/] - @nodetypes << $1[2..-1] # Without T_ prefix - elsif line == "} NodeTag;\n" - inside = false - end - elsif line == "typedef enum NodeTag\n" - inside = true - end - end + def initialize + @nodetypes = JSON.parse(File.read('./srcdata/nodetypes.json')) + @struct_defs = JSON.parse(File.read('./srcdata/struct_defs.json')) + @typedefs = JSON.parse(File.read('./srcdata/typedefs.json')) end TYPE_OVERRIDES = { @@ -31,55 +18,54 @@ def generate_nodetypes! } def generate_outmethods! - source = target = nil @outmethods = {} - # Note: We intentionally don't read relation.h & plannodes.h since we're only - # interesting in parsing (not planning) queries - lines = File.read(File.join(@pgdir, '/src/include/nodes/parsenodes.h')) + - File.read(File.join(@pgdir, '/src/include/nodes/primnodes.h')) + - File.read(File.join(@pgdir, '/src/include/nodes/value.h')) - lines.each_line do |line| - if source - if line[/^\s+(struct |const )?([A-z0-9]+)\s+(\*)?([A-z_]+);/] - name = $4 - orig_type = $2 + $3.to_s - type = TYPE_OVERRIDES[[source, name]] || orig_type + ['nodes/parsenodes', 'nodes/primnodes'].each do |group| + @struct_defs[group].each do |node_type, struct_def| + @outmethods[node_type] = format(" WRITE_NODE_TYPE(\"%s\");\n\n", node_type) + + struct_def['fields'].each do |field_def| + name = field_def['name'] + orig_type = field_def['c_type'] + + next unless name && orig_type + + type = TYPE_OVERRIDES[[node_type, name]] || orig_type + if type == :skip || type == 'Expr' # Ignore elsif type == 'NodeTag' # Nothing elsif ['bool', 'long', 'char'].include?(type) - @outmethods[target] += format(" WRITE_%s_FIELD(%s);\n", type.upcase, name) + @outmethods[node_type] += format(" WRITE_%s_FIELD(%s);\n", type.upcase, name) elsif ['int', 'int16', 'int32', 'AttrNumber'].include?(type) - @outmethods[target] += format(" WRITE_INT_FIELD(%s);\n", name) + @outmethods[node_type] += format(" WRITE_INT_FIELD(%s);\n", name) elsif ['uint', 'uint16', 'uint32', 'Index', 'bits32', 'Oid'].include?(type) - @outmethods[target] += format(" WRITE_UINT_FIELD(%s);\n", name) + @outmethods[node_type] += format(" WRITE_UINT_FIELD(%s);\n", name) elsif type == 'char*' - @outmethods[target] += format(" WRITE_STRING_FIELD(%s);\n", name) + @outmethods[node_type] += format(" WRITE_STRING_FIELD(%s);\n", name) elsif ['float', 'double', 'Cost', 'Selectivity'].include?(type) - @outmethods[target] += format(" WRITE_FLOAT_FIELD(%s);\n", name) + @outmethods[node_type] += format(" WRITE_FLOAT_FIELD(%s);\n", name) elsif ['Bitmapset*', 'Relids'].include?(type) - @outmethods[target] += format(" WRITE_BITMAPSET_FIELD(%s);\n", name) + @outmethods[node_type] += format(" WRITE_BITMAPSET_FIELD(%s);\n", name) elsif ['Value', 'CreateStmt'].include?(type) - @outmethods[target] += format(" WRITE_NODE_FIELD(%s);\n", name) + @outmethods[node_type] += format(" WRITE_NODE_FIELD(%s);\n", name) elsif type == 'Node*' || @nodetypes.include?(type[0..-2]) - @outmethods[target] += format(" WRITE_NODE_PTR_FIELD(%s);\n", name) + @outmethods[node_type] += format(" WRITE_NODE_PTR_FIELD(%s);\n", name) elsif type.end_with?('*') puts format('ERR: %s %s', name, type) else # Enum - @outmethods[target] += format(" WRITE_ENUM_FIELD(%s, %s);\n", name, type) + @outmethods[node_type] += format(" WRITE_ENUM_FIELD(%s, %s);\n", name, type) end - elsif line == format("} %s;\n", source) - source = target = nil end - elsif line[/typedef struct ([A-z]+)/] - source = target = $1 - @outmethods[target] = format(" WRITE_NODE_TYPE(\"%s\");\n\n", target) - elsif line[/^typedef ([A-z]+) ([A-z]+);/] - @outmethods[$2] = @outmethods[$1] end end + + @typedefs.each do |typedef| + next unless @outmethods[typedef['source_type']] + + @outmethods[typedef['new_type_name']] = @outmethods[typedef['source_type']] + end end IGNORE_LIST = [ @@ -88,7 +74,6 @@ def generate_outmethods! 'Const', # Only needed in post-parse analysis (and it introduces Datums, which we can't output) ] def generate! - generate_nodetypes! generate_outmethods! defs = '' @@ -116,4 +101,4 @@ def generate! end end -Generator.new('./postgres').generate! +Generator.new.generate! diff --git a/srcdata/all_known_enums.json b/srcdata/all_known_enums.json new file mode 100644 index 00000000..12d1f30e --- /dev/null +++ b/srcdata/all_known_enums.json @@ -0,0 +1,43 @@ +[ + "QuerySource", + "SortByDir", + "SortByNulls", + "A_Expr_Kind", + "TableLikeOption", + "DefElemAction", + "LockClauseStrength", + "RTEKind", + "SetOperation", + "ObjectType", + "DropBehavior", + "AlterTableType", + "GrantTargetType", + "GrantObjectType", + "VariableSetKind", + "ConstrType", + "RoleStmtType", + "FetchDirection", + "FunctionParameterMode", + "TransactionStmtKind", + "ViewCheckOption", + "VacuumOption", + "DiscardMode", + "InhOption", + "OnCommitAction", + "ParamKind", + "CoercionContext", + "CoercionForm", + "BoolExprType", + "SubLinkType", + "RowCompareType", + "MinMaxOp", + "XmlExprOp", + "XmlOptionType", + "NullTestType", + "BoolTestType", + "NodeTag", + "CmdType", + "JoinType", + "vartag_external", + "ScanDirection" +] \ No newline at end of file diff --git a/srcdata/enum_defs.json b/srcdata/enum_defs.json new file mode 100644 index 00000000..53106b0e --- /dev/null +++ b/srcdata/enum_defs.json @@ -0,0 +1,2932 @@ +{ + "nodes/parsenodes": { + "QuerySource": { + "values": [ + { + "comment": "" + }, + { + "name": "QSRC_ORIGINAL", + "comment": "/* original parsetree (explicit query) */" + }, + { + "name": "QSRC_PARSER", + "comment": "/* added by parse analysis (now unused) */" + }, + { + "name": "QSRC_INSTEAD_RULE", + "comment": "/* added by unconditional INSTEAD rule */" + }, + { + "name": "QSRC_QUAL_INSTEAD_RULE", + "comment": "/* added by conditional INSTEAD rule */" + }, + { + "name": "QSRC_NON_INSTEAD_RULE", + "comment": "/* added by non-INSTEAD rule */" + } + ], + "comment": "/* Possible sources of a Query */\n" + }, + "SortByDir": { + "values": [ + { + "comment": "" + }, + { + "name": "SORTBY_DEFAULT", + "comment": null + }, + { + "name": "SORTBY_ASC", + "comment": null + }, + { + "name": "SORTBY_DESC", + "comment": null + }, + { + "name": "SORTBY_USING", + "comment": "/* not allowed in CREATE INDEX ... */" + } + ], + "comment": "/* Sort ordering options for ORDER BY and CREATE INDEX */\n" + }, + "SortByNulls": { + "values": [ + { + "comment": "" + }, + { + "name": "SORTBY_NULLS_DEFAULT", + "comment": null + }, + { + "name": "SORTBY_NULLS_FIRST", + "comment": null + }, + { + "name": "SORTBY_NULLS_LAST", + "comment": null + } + ], + "comment": null + }, + "A_Expr_Kind": { + "values": [ + { + "comment": "" + }, + { + "name": "AEXPR_OP", + "comment": "/* normal operator */" + }, + { + "name": "AEXPR_AND", + "comment": "/* booleans - name field is unused */" + }, + { + "name": "AEXPR_OR", + "comment": null + }, + { + "name": "AEXPR_NOT", + "comment": null + }, + { + "name": "AEXPR_OP_ANY", + "comment": "/* scalar op ANY (array) */" + }, + { + "name": "AEXPR_OP_ALL", + "comment": "/* scalar op ALL (array) */" + }, + { + "name": "AEXPR_DISTINCT", + "comment": "/* IS DISTINCT FROM - name must be \"=\" */" + }, + { + "name": "AEXPR_NULLIF", + "comment": "/* NULLIF - name must be \"=\" */" + }, + { + "name": "AEXPR_OF", + "comment": "/* IS [NOT] OF - name must be \"=\" or \"<>\" */" + }, + { + "name": "AEXPR_IN", + "comment": "/* [NOT] IN - name must be \"=\" or \"<>\" */" + } + ], + "comment": "/*\n * A_Expr - infix, prefix, and postfix expressions\n */\n" + }, + "TableLikeOption": { + "values": [ + { + "comment": "" + }, + { + "name": "CREATE_TABLE_LIKE_DEFAULTS", + "comment": null + }, + { + "name": "CREATE_TABLE_LIKE_CONSTRAINTS", + "comment": null + }, + { + "name": "CREATE_TABLE_LIKE_INDEXES", + "comment": null + }, + { + "name": "CREATE_TABLE_LIKE_STORAGE", + "comment": null + }, + { + "name": "CREATE_TABLE_LIKE_COMMENTS", + "comment": null + }, + { + "name": "CREATE_TABLE_LIKE_ALL", + "comment": null + } + ], + "comment": null + }, + "DefElemAction": { + "values": [ + { + "comment": "" + }, + { + "name": "DEFELEM_UNSPEC", + "comment": "/* no action given */" + }, + { + "name": "DEFELEM_SET", + "comment": null + }, + { + "name": "DEFELEM_ADD", + "comment": null + }, + { + "name": "DEFELEM_DROP", + "comment": null + } + ], + "comment": "/*\n * DefElem - a generic \"name = value\" option definition\n *\n * In some contexts the name can be qualified. Also, certain SQL commands\n * allow a SET/ADD/DROP action to be attached to option settings, so it's\n * convenient to carry a field for that too. (Note: currently, it is our\n * practice that the grammar allows namespace and action only in statements\n * where they are relevant; C code can just ignore those fields in other\n * statements.)\n */\n" + }, + "LockClauseStrength": { + "values": [ + { + "comment": "" + }, + { + "comment": "\t/* order is important -- see applyLockingClause */\n" + }, + { + "name": "LCS_FORKEYSHARE", + "comment": null + }, + { + "name": "LCS_FORSHARE", + "comment": null + }, + { + "name": "LCS_FORNOKEYUPDATE", + "comment": null + }, + { + "name": "LCS_FORUPDATE", + "comment": null + } + ], + "comment": "/*\n * LockingClause - raw representation of FOR [NO KEY] UPDATE/[KEY] SHARE\n *\t\toptions\n *\n * Note: lockedRels == NIL means \"all relations in query\". Otherwise it\n * is a list of RangeVar nodes. (We use RangeVar mainly because it carries\n * a location field --- currently, parse analysis insists on unqualified\n * names in LockingClause.)\n */\n" + }, + "RTEKind": { + "values": [ + { + "comment": "" + }, + { + "name": "RTE_RELATION", + "comment": "/* ordinary relation reference */" + }, + { + "name": "RTE_SUBQUERY", + "comment": "/* subquery in FROM */" + }, + { + "name": "RTE_JOIN", + "comment": "/* join */" + }, + { + "name": "RTE_FUNCTION", + "comment": "/* function in FROM */" + }, + { + "name": "RTE_VALUES", + "comment": "/* VALUES (), (), ... */" + }, + { + "name": "RTE_CTE", + "comment": "/* common table expr (WITH list element) */" + } + ], + "comment": "/*--------------------\n * RangeTblEntry -\n *\t A range table is a List of RangeTblEntry nodes.\n *\n *\t A range table entry may represent a plain relation, a sub-select in\n *\t FROM, or the result of a JOIN clause. (Only explicit JOIN syntax\n *\t produces an RTE, not the implicit join resulting from multiple FROM\n *\t items. This is because we only need the RTE to deal with SQL features\n *\t like outer joins and join-output-column aliasing.) Other special\n *\t RTE types also exist, as indicated by RTEKind.\n *\n *\t Note that we consider RTE_RELATION to cover anything that has a pg_class\n *\t entry. relkind distinguishes the sub-cases.\n *\n *\t alias is an Alias node representing the AS alias-clause attached to the\n *\t FROM expression, or NULL if no clause.\n *\n *\t eref is the table reference name and column reference names (either\n *\t real or aliases). Note that system columns (OID etc) are not included\n *\t in the column list.\n *\t eref->aliasname is required to be present, and should generally be used\n *\t to identify the RTE for error messages etc.\n *\n *\t In RELATION RTEs, the colnames in both alias and eref are indexed by\n *\t physical attribute number; this means there must be colname entries for\n *\t dropped columns. When building an RTE we insert empty strings (\"\") for\n *\t dropped columns. Note however that a stored rule may have nonempty\n *\t colnames for columns dropped since the rule was created (and for that\n *\t matter the colnames might be out of date due to column renamings).\n *\t The same comments apply to FUNCTION RTEs when a function's return type\n *\t is a named composite type.\n *\n *\t In JOIN RTEs, the colnames in both alias and eref are one-to-one with\n *\t joinaliasvars entries. A JOIN RTE will omit columns of its inputs when\n *\t those columns are known to be dropped at parse time. Again, however,\n *\t a stored rule might contain entries for columns dropped since the rule\n *\t was created. (This is only possible for columns not actually referenced\n *\t in the rule.) When loading a stored rule, we replace the joinaliasvars\n *\t items for any such columns with null pointers. (We can't simply delete\n *\t them from the joinaliasvars list, because that would affect the attnums\n *\t of Vars referencing the rest of the list.)\n *\n *\t inh is TRUE for relation references that should be expanded to include\n *\t inheritance children, if the rel has any. This *must* be FALSE for\n *\t RTEs other than RTE_RELATION entries.\n *\n *\t inFromCl marks those range variables that are listed in the FROM clause.\n *\t It's false for RTEs that are added to a query behind the scenes, such\n *\t as the NEW and OLD variables for a rule, or the subqueries of a UNION.\n *\t This flag is not used anymore during parsing, since the parser now uses\n *\t a separate \"namespace\" data structure to control visibility, but it is\n *\t needed by ruleutils.c to determine whether RTEs should be shown in\n *\t decompiled queries.\n *\n *\t requiredPerms and checkAsUser specify run-time access permissions\n *\t checks to be performed at query startup. The user must have *all*\n *\t of the permissions that are OR'd together in requiredPerms (zero\n *\t indicates no permissions checking). If checkAsUser is not zero,\n *\t then do the permissions checks using the access rights of that user,\n *\t not the current effective user ID. (This allows rules to act as\n *\t setuid gateways.) Permissions checks only apply to RELATION RTEs.\n *\n *\t For SELECT/INSERT/UPDATE permissions, if the user doesn't have\n *\t table-wide permissions then it is sufficient to have the permissions\n *\t on all columns identified in selectedCols (for SELECT) and/or\n *\t modifiedCols (for INSERT/UPDATE; we can tell which from the query type).\n *\t selectedCols and modifiedCols are bitmapsets, which cannot have negative\n *\t integer members, so we subtract FirstLowInvalidHeapAttributeNumber from\n *\t column numbers before storing them in these fields. A whole-row Var\n *\t reference is represented by setting the bit for InvalidAttrNumber.\n *--------------------\n */\n" + }, + "SetOperation": { + "values": [ + { + "comment": "" + }, + { + "name": "SETOP_NONE", + "comment": null + }, + { + "name": "SETOP_UNION", + "comment": null + }, + { + "name": "SETOP_INTERSECT", + "comment": null + }, + { + "name": "SETOP_EXCEPT", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\tSelect Statement\n *\n * A \"simple\" SELECT is represented in the output of gram.y by a single\n * SelectStmt node; so is a VALUES construct. A query containing set\n * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt\n * nodes, in which the leaf nodes are component SELECTs and the internal nodes\n * represent UNION, INTERSECT, or EXCEPT operators. Using the same node\n * type for both leaf and internal nodes allows gram.y to stick ORDER BY,\n * LIMIT, etc, clause values into a SELECT statement without worrying\n * whether it is a simple or compound SELECT.\n * ----------------------\n */\n" + }, + "ObjectType": { + "values": [ + { + "comment": "" + }, + { + "name": "OBJECT_AGGREGATE", + "comment": null + }, + { + "name": "OBJECT_ATTRIBUTE", + "comment": "/* type's attribute, when distinct from column */" + }, + { + "name": "OBJECT_CAST", + "comment": null + }, + { + "name": "OBJECT_COLUMN", + "comment": null + }, + { + "name": "OBJECT_CONSTRAINT", + "comment": null + }, + { + "name": "OBJECT_COLLATION", + "comment": null + }, + { + "name": "OBJECT_CONVERSION", + "comment": null + }, + { + "name": "OBJECT_DATABASE", + "comment": null + }, + { + "name": "OBJECT_DOMAIN", + "comment": null + }, + { + "name": "OBJECT_EVENT_TRIGGER", + "comment": null + }, + { + "name": "OBJECT_EXTENSION", + "comment": null + }, + { + "name": "OBJECT_FDW", + "comment": null + }, + { + "name": "OBJECT_FOREIGN_SERVER", + "comment": null + }, + { + "name": "OBJECT_FOREIGN_TABLE", + "comment": null + }, + { + "name": "OBJECT_FUNCTION", + "comment": null + }, + { + "name": "OBJECT_INDEX", + "comment": null + }, + { + "name": "OBJECT_LANGUAGE", + "comment": null + }, + { + "name": "OBJECT_LARGEOBJECT", + "comment": null + }, + { + "name": "OBJECT_MATVIEW", + "comment": null + }, + { + "name": "OBJECT_OPCLASS", + "comment": null + }, + { + "name": "OBJECT_OPERATOR", + "comment": null + }, + { + "name": "OBJECT_OPFAMILY", + "comment": null + }, + { + "name": "OBJECT_ROLE", + "comment": null + }, + { + "name": "OBJECT_RULE", + "comment": null + }, + { + "name": "OBJECT_SCHEMA", + "comment": null + }, + { + "name": "OBJECT_SEQUENCE", + "comment": null + }, + { + "name": "OBJECT_TABLE", + "comment": null + }, + { + "name": "OBJECT_TABLESPACE", + "comment": null + }, + { + "name": "OBJECT_TRIGGER", + "comment": null + }, + { + "name": "OBJECT_TSCONFIGURATION", + "comment": null + }, + { + "name": "OBJECT_TSDICTIONARY", + "comment": null + }, + { + "name": "OBJECT_TSPARSER", + "comment": null + }, + { + "name": "OBJECT_TSTEMPLATE", + "comment": null + }, + { + "name": "OBJECT_TYPE", + "comment": null + }, + { + "name": "OBJECT_VIEW", + "comment": null + } + ], + "comment": "/*\n * When a command can act on several kinds of objects with only one\n * parse structure required, use these constants to designate the\n * object type. Note that commands typically don't support all the types.\n */\n" + }, + "DropBehavior": { + "values": [ + { + "comment": "" + }, + { + "name": "DROP_RESTRICT", + "comment": "/* drop fails if any dependent objects */" + }, + { + "name": "DROP_CASCADE", + "comment": "/* remove dependent objects too */" + } + ], + "comment": null + }, + "AlterTableType": { + "values": [ + { + "comment": "" + }, + { + "name": "AT_AddColumn", + "comment": "/* add column */" + }, + { + "name": "AT_AddColumnRecurse", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_AddColumnToView", + "comment": "/* implicitly via CREATE OR REPLACE VIEW */" + }, + { + "name": "AT_ColumnDefault", + "comment": "/* alter column default */" + }, + { + "name": "AT_DropNotNull", + "comment": "/* alter column drop not null */" + }, + { + "name": "AT_SetNotNull", + "comment": "/* alter column set not null */" + }, + { + "name": "AT_SetStatistics", + "comment": "/* alter column set statistics */" + }, + { + "name": "AT_SetOptions", + "comment": "/* alter column set ( options ) */" + }, + { + "name": "AT_ResetOptions", + "comment": "/* alter column reset ( options ) */" + }, + { + "name": "AT_SetStorage", + "comment": "/* alter column set storage */" + }, + { + "name": "AT_DropColumn", + "comment": "/* drop column */" + }, + { + "name": "AT_DropColumnRecurse", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_AddIndex", + "comment": "/* add index */" + }, + { + "name": "AT_ReAddIndex", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_AddConstraint", + "comment": "/* add constraint */" + }, + { + "name": "AT_AddConstraintRecurse", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_ReAddConstraint", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_AlterConstraint", + "comment": "/* alter constraint */" + }, + { + "name": "AT_ValidateConstraint", + "comment": "/* validate constraint */" + }, + { + "name": "AT_ValidateConstraintRecurse", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_ProcessedConstraint", + "comment": "/* pre-processed add constraint (local in\n\t\t\t\t\t\t\t\t * parser/parse_utilcmd.c) */\n" + }, + { + "name": "AT_AddIndexConstraint", + "comment": "/* add constraint using existing index */" + }, + { + "name": "AT_DropConstraint", + "comment": "/* drop constraint */" + }, + { + "name": "AT_DropConstraintRecurse", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_AlterColumnType", + "comment": "/* alter column type */" + }, + { + "name": "AT_AlterColumnGenericOptions", + "comment": "/* alter column OPTIONS (...) */" + }, + { + "name": "AT_ChangeOwner", + "comment": "/* change owner */" + }, + { + "name": "AT_ClusterOn", + "comment": "/* CLUSTER ON */" + }, + { + "name": "AT_DropCluster", + "comment": "/* SET WITHOUT CLUSTER */" + }, + { + "name": "AT_AddOids", + "comment": "/* SET WITH OIDS */" + }, + { + "name": "AT_AddOidsRecurse", + "comment": "/* internal to commands/tablecmds.c */" + }, + { + "name": "AT_DropOids", + "comment": "/* SET WITHOUT OIDS */" + }, + { + "name": "AT_SetTableSpace", + "comment": "/* SET TABLESPACE */" + }, + { + "name": "AT_SetRelOptions", + "comment": "/* SET (...) -- AM specific parameters */" + }, + { + "name": "AT_ResetRelOptions", + "comment": "/* RESET (...) -- AM specific parameters */" + }, + { + "name": "AT_ReplaceRelOptions", + "comment": "/* replace reloption list in its entirety */" + }, + { + "name": "AT_EnableTrig", + "comment": "/* ENABLE TRIGGER name */" + }, + { + "name": "AT_EnableAlwaysTrig", + "comment": "/* ENABLE ALWAYS TRIGGER name */" + }, + { + "name": "AT_EnableReplicaTrig", + "comment": "/* ENABLE REPLICA TRIGGER name */" + }, + { + "name": "AT_DisableTrig", + "comment": "/* DISABLE TRIGGER name */" + }, + { + "name": "AT_EnableTrigAll", + "comment": "/* ENABLE TRIGGER ALL */" + }, + { + "name": "AT_DisableTrigAll", + "comment": "/* DISABLE TRIGGER ALL */" + }, + { + "name": "AT_EnableTrigUser", + "comment": "/* ENABLE TRIGGER USER */" + }, + { + "name": "AT_DisableTrigUser", + "comment": "/* DISABLE TRIGGER USER */" + }, + { + "name": "AT_EnableRule", + "comment": "/* ENABLE RULE name */" + }, + { + "name": "AT_EnableAlwaysRule", + "comment": "/* ENABLE ALWAYS RULE name */" + }, + { + "name": "AT_EnableReplicaRule", + "comment": "/* ENABLE REPLICA RULE name */" + }, + { + "name": "AT_DisableRule", + "comment": "/* DISABLE RULE name */" + }, + { + "name": "AT_AddInherit", + "comment": "/* INHERIT parent */" + }, + { + "name": "AT_DropInherit", + "comment": "/* NO INHERIT parent */" + }, + { + "name": "AT_AddOf", + "comment": "/* OF */" + }, + { + "name": "AT_DropOf", + "comment": "/* NOT OF */" + }, + { + "name": "AT_ReplicaIdentity", + "comment": "/* REPLICA IDENTITY */" + }, + { + "name": "AT_GenericOptions", + "comment": "/* OPTIONS (...) */" + } + ], + "comment": null + }, + "GrantTargetType": { + "values": [ + { + "comment": "" + }, + { + "name": "ACL_TARGET_OBJECT", + "comment": "/* grant on specific named object(s) */" + }, + { + "name": "ACL_TARGET_ALL_IN_SCHEMA", + "comment": "/* grant on all objects in given schema(s) */" + }, + { + "name": "ACL_TARGET_DEFAULTS", + "comment": "/* ALTER DEFAULT PRIVILEGES */" + } + ], + "comment": "/* ----------------------\n *\t\tGrant|Revoke Statement\n * ----------------------\n */\n" + }, + "GrantObjectType": { + "values": [ + { + "comment": "" + }, + { + "name": "ACL_OBJECT_COLUMN", + "comment": "/* column */" + }, + { + "name": "ACL_OBJECT_RELATION", + "comment": "/* table, view */" + }, + { + "name": "ACL_OBJECT_SEQUENCE", + "comment": "/* sequence */" + }, + { + "name": "ACL_OBJECT_DATABASE", + "comment": "/* database */" + }, + { + "name": "ACL_OBJECT_DOMAIN", + "comment": "/* domain */" + }, + { + "name": "ACL_OBJECT_FDW", + "comment": "/* foreign-data wrapper */" + }, + { + "name": "ACL_OBJECT_FOREIGN_SERVER", + "comment": "/* foreign server */" + }, + { + "name": "ACL_OBJECT_FUNCTION", + "comment": "/* function */" + }, + { + "name": "ACL_OBJECT_LANGUAGE", + "comment": "/* procedural language */" + }, + { + "name": "ACL_OBJECT_LARGEOBJECT", + "comment": "/* largeobject */" + }, + { + "name": "ACL_OBJECT_NAMESPACE", + "comment": "/* namespace */" + }, + { + "name": "ACL_OBJECT_TABLESPACE", + "comment": "/* tablespace */" + }, + { + "name": "ACL_OBJECT_TYPE", + "comment": "/* type */" + } + ], + "comment": null + }, + "VariableSetKind": { + "values": [ + { + "comment": "" + }, + { + "name": "VAR_SET_VALUE", + "comment": "/* SET var = value */" + }, + { + "name": "VAR_SET_DEFAULT", + "comment": "/* SET var TO DEFAULT */" + }, + { + "name": "VAR_SET_CURRENT", + "comment": "/* SET var FROM CURRENT */" + }, + { + "name": "VAR_SET_MULTI", + "comment": "/* special case for SET TRANSACTION ... */" + }, + { + "name": "VAR_RESET", + "comment": "/* RESET var */" + }, + { + "name": "VAR_RESET_ALL", + "comment": "/* RESET ALL */" + } + ], + "comment": "/* ----------------------\n * SET Statement (includes RESET)\n *\n * \"SET var TO DEFAULT\" and \"RESET var\" are semantically equivalent, but we\n * preserve the distinction in VariableSetKind for CreateCommandTag().\n * ----------------------\n */\n" + }, + "ConstrType": { + "values": [ + { + "comment": "" + }, + { + "name": "CONSTR_NULL", + "comment": "/* not standard SQL, but a lot of people\n\t\t\t\t\t\t\t\t * expect it */\n" + }, + { + "name": "CONSTR_NOTNULL", + "comment": null + }, + { + "name": "CONSTR_DEFAULT", + "comment": null + }, + { + "name": "CONSTR_CHECK", + "comment": null + }, + { + "name": "CONSTR_PRIMARY", + "comment": null + }, + { + "name": "CONSTR_UNIQUE", + "comment": null + }, + { + "name": "CONSTR_EXCLUSION", + "comment": null + }, + { + "name": "CONSTR_FOREIGN", + "comment": null + }, + { + "name": "CONSTR_ATTR_DEFERRABLE", + "comment": "/* attributes for previous constraint node */" + }, + { + "name": "CONSTR_ATTR_NOT_DEFERRABLE", + "comment": null + }, + { + "name": "CONSTR_ATTR_DEFERRED", + "comment": null + }, + { + "name": "CONSTR_ATTR_IMMEDIATE", + "comment": null + } + ], + "comment": "/* ----------\n * Definitions for constraints in CreateStmt\n *\n * Note that column defaults are treated as a type of constraint,\n * even though that's a bit odd semantically.\n *\n * For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT)\n * we may have the expression in either \"raw\" form (an untransformed\n * parse tree) or \"cooked\" form (the nodeToString representation of\n * an executable expression tree), depending on how this Constraint\n * node was created (by parsing, or by inheritance from an existing\n * relation). We should never have both in the same node!\n *\n * FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype\n * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are\n * stored into pg_constraint.confmatchtype. Changing the code values may\n * require an initdb!\n *\n * If skip_validation is true then we skip checking that the existing rows\n * in the table satisfy the constraint, and just install the catalog entries\n * for the constraint. A new FK constraint is marked as valid iff\n * initially_valid is true. (Usually skip_validation and initially_valid\n * are inverses, but we can set both true if the table is known empty.)\n *\n * Constraint attributes (DEFERRABLE etc) are initially represented as\n * separate Constraint nodes for simplicity of parsing. parse_utilcmd.c makes\n * a pass through the constraints list to insert the info into the appropriate\n * Constraint node.\n * ----------\n */\n" + }, + "RoleStmtType": { + "values": [ + { + "comment": "" + }, + { + "name": "ROLESTMT_ROLE", + "comment": null + }, + { + "name": "ROLESTMT_USER", + "comment": null + }, + { + "name": "ROLESTMT_GROUP", + "comment": null + } + ], + "comment": "/* ----------------------\n *\tCreate/Alter/Drop Role Statements\n *\n * Note: these node types are also used for the backwards-compatible\n * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases\n * there's really no need to distinguish what the original spelling was,\n * but for CREATE we mark the type because the defaults vary.\n * ----------------------\n */\n" + }, + "FetchDirection": { + "values": [ + { + "comment": "" + }, + { + "comment": "\t/* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */\n" + }, + { + "name": "FETCH_FORWARD", + "comment": null + }, + { + "name": "FETCH_BACKWARD", + "comment": null + }, + { + "comment": "\t/* for these, howMany indicates a position; only one row is fetched */\n" + }, + { + "name": "FETCH_ABSOLUTE", + "comment": null + }, + { + "name": "FETCH_RELATIVE", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\tFetch Statement (also Move)\n * ----------------------\n */\n" + }, + "FunctionParameterMode": { + "values": [ + { + "comment": "" + }, + { + "comment": "\t/* the assigned enum values appear in pg_proc, don't change 'em! */\n" + }, + { + "name": "FUNC_PARAM_IN", + "comment": null + }, + { + "name": "FUNC_PARAM_OUT", + "comment": null + }, + { + "name": "FUNC_PARAM_INOUT", + "comment": null + }, + { + "name": "FUNC_PARAM_VARIADIC", + "comment": null + }, + { + "name": "FUNC_PARAM_TABLE", + "comment": null + } + ], + "comment": null + }, + "TransactionStmtKind": { + "values": [ + { + "comment": "" + }, + { + "name": "TRANS_STMT_BEGIN", + "comment": null + }, + { + "name": "TRANS_STMT_START", + "comment": "/* semantically identical to BEGIN */" + }, + { + "name": "TRANS_STMT_COMMIT", + "comment": null + }, + { + "name": "TRANS_STMT_ROLLBACK", + "comment": null + }, + { + "name": "TRANS_STMT_SAVEPOINT", + "comment": null + }, + { + "name": "TRANS_STMT_RELEASE", + "comment": null + }, + { + "name": "TRANS_STMT_ROLLBACK_TO", + "comment": null + }, + { + "name": "TRANS_STMT_PREPARE", + "comment": null + }, + { + "name": "TRANS_STMT_COMMIT_PREPARED", + "comment": null + }, + { + "name": "TRANS_STMT_ROLLBACK_PREPARED", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\t{Begin|Commit|Rollback} Transaction Statement\n * ----------------------\n */\n" + }, + "ViewCheckOption": { + "values": [ + { + "comment": "" + }, + { + "name": "NO_CHECK_OPTION", + "comment": null + }, + { + "name": "LOCAL_CHECK_OPTION", + "comment": null + }, + { + "name": "CASCADED_CHECK_OPTION", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\tCreate View Statement\n * ----------------------\n */\n" + }, + "VacuumOption": { + "values": [ + { + "comment": "" + }, + { + "name": "VACOPT_VACUUM", + "comment": null + }, + { + "name": "VACOPT_ANALYZE", + "comment": null + }, + { + "name": "VACOPT_VERBOSE", + "comment": null + }, + { + "name": "VACOPT_FREEZE", + "comment": null + }, + { + "name": "VACOPT_FULL", + "comment": null + }, + { + "name": "VACOPT_NOWAIT", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\tVacuum and Analyze Statements\n *\n * Even though these are nominally two statements, it's convenient to use\n * just one node type for both. Note that at least one of VACOPT_VACUUM\n * and VACOPT_ANALYZE must be set in options. VACOPT_FREEZE is an internal\n * convenience for the grammar and is not examined at runtime --- the\n * freeze_min_age and freeze_table_age fields are what matter.\n * ----------------------\n */\n" + }, + "DiscardMode": { + "values": [ + { + "comment": "" + }, + { + "name": "DISCARD_ALL", + "comment": null + }, + { + "name": "DISCARD_PLANS", + "comment": null + }, + { + "name": "DISCARD_SEQUENCES", + "comment": null + }, + { + "name": "DISCARD_TEMP", + "comment": null + } + ], + "comment": "/* ----------------------\n * Discard Statement\n * ----------------------\n */\n" + } + }, + "nodes/primnodes": { + "InhOption": { + "values": [ + { + "comment": "" + }, + { + "name": "INH_NO", + "comment": "/* Do NOT scan child tables */" + }, + { + "name": "INH_YES", + "comment": "/* DO scan child tables */" + }, + { + "name": "INH_DEFAULT", + "comment": "/* Use current SQL_inheritance option */" + } + ], + "comment": null + }, + "OnCommitAction": { + "values": [ + { + "comment": "" + }, + { + "name": "ONCOMMIT_NOOP", + "comment": "/* No ON COMMIT clause (do nothing) */" + }, + { + "name": "ONCOMMIT_PRESERVE_ROWS", + "comment": "/* ON COMMIT PRESERVE ROWS (do nothing) */" + }, + { + "name": "ONCOMMIT_DELETE_ROWS", + "comment": "/* ON COMMIT DELETE ROWS */" + }, + { + "name": "ONCOMMIT_DROP", + "comment": "/* ON COMMIT DROP */" + } + ], + "comment": "/* What to do at commit time for temporary relations */\n" + }, + "ParamKind": { + "values": [ + { + "comment": "" + }, + { + "name": "PARAM_EXTERN", + "comment": null + }, + { + "name": "PARAM_EXEC", + "comment": null + }, + { + "name": "PARAM_SUBLINK", + "comment": null + } + ], + "comment": "/* ----------------\n * Param\n *\t\tparamkind - specifies the kind of parameter. The possible values\n *\t\tfor this field are:\n *\n *\t\tPARAM_EXTERN: The parameter value is supplied from outside the plan.\n *\t\t\t\tSuch parameters are numbered from 1 to n.\n *\n *\t\tPARAM_EXEC: The parameter is an internal executor parameter, used\n *\t\t\t\tfor passing values into and out of sub-queries or from\n *\t\t\t\tnestloop joins to their inner scans.\n *\t\t\t\tFor historical reasons, such parameters are numbered from 0.\n *\t\t\t\tThese numbers are independent of PARAM_EXTERN numbers.\n *\n *\t\tPARAM_SUBLINK:\tThe parameter represents an output column of a SubLink\n *\t\t\t\tnode's sub-select. The column number is contained in the\n *\t\t\t\t`paramid' field. (This type of Param is converted to\n *\t\t\t\tPARAM_EXEC during planning.)\n *\n * Note: currently, paramtypmod is valid for PARAM_SUBLINK Params, and for\n * PARAM_EXEC Params generated from them; it is always -1 for PARAM_EXTERN\n * params, since the APIs that supply values for such parameters don't carry\n * any typmod info.\n * ----------------\n */\n" + }, + "CoercionContext": { + "values": [ + { + "comment": "" + }, + { + "name": "COERCION_IMPLICIT", + "comment": "/* coercion in context of expression */" + }, + { + "name": "COERCION_ASSIGNMENT", + "comment": "/* coercion in context of assignment */" + }, + { + "name": "COERCION_EXPLICIT", + "comment": "/* explicit cast operation */" + } + ], + "comment": "/*\n * CoercionContext - distinguishes the allowed set of type casts\n *\n * NB: ordering of the alternatives is significant; later (larger) values\n * allow more casts than earlier ones.\n */\n" + }, + "CoercionForm": { + "values": [ + { + "comment": "" + }, + { + "name": "COERCE_EXPLICIT_CALL", + "comment": "/* display as a function call */" + }, + { + "name": "COERCE_EXPLICIT_CAST", + "comment": "/* display as an explicit cast */" + }, + { + "name": "COERCE_IMPLICIT_CAST", + "comment": "/* implicit cast, so hide it */" + } + ], + "comment": "/*\n * CoercionForm - how to display a node that could have come from a cast\n *\n * NB: equal() ignores CoercionForm fields, therefore this *must* not carry\n * any semantically significant information. We need that behavior so that\n * the planner will consider equivalent implicit and explicit casts to be\n * equivalent. In cases where those actually behave differently, the coercion\n * function's arguments will be different.\n */\n" + }, + "BoolExprType": { + "values": [ + { + "comment": "" + }, + { + "name": "AND_EXPR", + "comment": null + }, + { + "name": "OR_EXPR" + } + ], + "comment": "/*\n * BoolExpr - expression node for the basic Boolean operators AND, OR, NOT\n *\n * Notice the arguments are given as a List. For NOT, of course the list\n * must always have exactly one element. For AND and OR, the executor can\n * handle any number of arguments. The parser generally treats AND and OR\n * as binary and so it typically only produces two-element lists, but the\n * optimizer will flatten trees of AND and OR nodes to produce longer lists\n * when possible. There are also a few special cases where more arguments\n * can appear before optimization.\n */\n" + }, + "SubLinkType": { + "values": [ + { + "comment": "" + }, + { + "name": "EXISTS_SUBLINK", + "comment": null + }, + { + "name": "ALL_SUBLINK", + "comment": null + }, + { + "name": "ANY_SUBLINK", + "comment": null + }, + { + "name": "ROWCOMPARE_SUBLINK", + "comment": null + }, + { + "name": "EXPR_SUBLINK", + "comment": null + }, + { + "name": "ARRAY_SUBLINK", + "comment": null + }, + { + "name": "CTE_SUBLINK", + "comment": "/* for SubPlans only */" + } + ], + "comment": "/*\n * SubLink\n *\n * A SubLink represents a subselect appearing in an expression, and in some\n * cases also the combining operator(s) just above it. The subLinkType\n * indicates the form of the expression represented:\n *\tEXISTS_SUBLINK\t\tEXISTS(SELECT ...)\n *\tALL_SUBLINK\t\t\t(lefthand) op ALL (SELECT ...)\n *\tANY_SUBLINK\t\t\t(lefthand) op ANY (SELECT ...)\n *\tROWCOMPARE_SUBLINK\t(lefthand) op (SELECT ...)\n *\tEXPR_SUBLINK\t\t(SELECT with single targetlist item ...)\n *\tARRAY_SUBLINK\t\tARRAY(SELECT with single targetlist item ...)\n *\tCTE_SUBLINK\t\t\tWITH query (never actually part of an expression)\n * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the\n * same length as the subselect's targetlist. ROWCOMPARE will *always* have\n * a list with more than one entry; if the subselect has just one target\n * then the parser will create an EXPR_SUBLINK instead (and any operator\n * above the subselect will be represented separately). Note that both\n * ROWCOMPARE and EXPR require the subselect to deliver only one row.\n * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean\n * results. ALL and ANY combine the per-row results using AND and OR\n * semantics respectively.\n * ARRAY requires just one target column, and creates an array of the target\n * column's type using any number of rows resulting from the subselect.\n *\n * SubLink is classed as an Expr node, but it is not actually executable;\n * it must be replaced in the expression tree by a SubPlan node during\n * planning.\n *\n * NOTE: in the raw output of gram.y, testexpr contains just the raw form\n * of the lefthand expression (if any), and operName is the String name of\n * the combining operator. Also, subselect is a raw parsetree. During parse\n * analysis, the parser transforms testexpr into a complete boolean expression\n * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the\n * output columns of the subselect. And subselect is transformed to a Query.\n * This is the representation seen in saved rules and in the rewriter.\n *\n * In EXISTS, EXPR, and ARRAY SubLinks, testexpr and operName are unused and\n * are always null.\n *\n * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used\n * in SubPlans generated for WITH subqueries.\n */\n" + }, + "RowCompareType": { + "values": [ + { + "comment": "" + }, + { + "comment": "\t/* Values of this enum are chosen to match btree strategy numbers */\n" + }, + { + "name": "ROWCOMPARE_LT", + "comment": null + }, + { + "name": "ROWCOMPARE_LE", + "comment": null + }, + { + "name": "ROWCOMPARE_EQ", + "comment": null + }, + { + "name": "ROWCOMPARE_GE", + "comment": null + }, + { + "name": "ROWCOMPARE_GT", + "comment": null + }, + { + "name": "ROWCOMPARE_NE", + "comment": null + } + ], + "comment": "/*\n * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2)\n *\n * We support row comparison for any operator that can be determined to\n * act like =, <>, <, <=, >, or >= (we determine this by looking for the\n * operator in btree opfamilies). Note that the same operator name might\n * map to a different operator for each pair of row elements, since the\n * element datatypes can vary.\n *\n * A RowCompareExpr node is only generated for the < <= > >= cases;\n * the = and <> cases are translated to simple AND or OR combinations\n * of the pairwise comparisons. However, we include = and <> in the\n * RowCompareType enum for the convenience of parser logic.\n */\n" + }, + "MinMaxOp": { + "values": [ + { + "comment": "" + }, + { + "name": "IS_GREATEST", + "comment": null + }, + { + "name": "IS_LEAST", + "comment": null + } + ], + "comment": "/*\n * MinMaxExpr - a GREATEST or LEAST function\n */\n" + }, + "XmlExprOp": { + "values": [ + { + "comment": "" + }, + { + "name": "IS_XMLCONCAT", + "comment": "/* XMLCONCAT(args) */" + }, + { + "name": "IS_XMLELEMENT", + "comment": "/* XMLELEMENT(name, xml_attributes, args) */" + }, + { + "name": "IS_XMLFOREST", + "comment": "/* XMLFOREST(xml_attributes) */" + }, + { + "name": "IS_XMLPARSE", + "comment": "/* XMLPARSE(text, is_doc, preserve_ws) */" + }, + { + "name": "IS_XMLPI", + "comment": "/* XMLPI(name [, args]) */" + }, + { + "name": "IS_XMLROOT", + "comment": "/* XMLROOT(xml, version, standalone) */" + }, + { + "name": "IS_XMLSERIALIZE", + "comment": "/* XMLSERIALIZE(is_document, xmlval) */" + }, + { + "name": "IS_DOCUMENT", + "comment": "/* xmlval IS DOCUMENT */" + } + ], + "comment": "/*\n * XmlExpr - various SQL/XML functions requiring special grammar productions\n *\n * 'name' carries the \"NAME foo\" argument (already XML-escaped).\n * 'named_args' and 'arg_names' represent an xml_attribute list.\n * 'args' carries all other arguments.\n *\n * Note: result type/typmod/collation are not stored, but can be deduced\n * from the XmlExprOp. The type/typmod fields are just used for display\n * purposes, and are NOT necessarily the true result type of the node.\n * (We also use type == InvalidOid to mark a not-yet-parse-analyzed XmlExpr.)\n */\n" + }, + "XmlOptionType": { + "values": [ + { + "comment": "" + }, + { + "name": "XMLOPTION_DOCUMENT", + "comment": null + }, + { + "name": "XMLOPTION_CONTENT", + "comment": null + } + ], + "comment": null + }, + "NullTestType": { + "values": [ + { + "comment": "" + }, + { + "name": "IS_NULL", + "comment": null + }, + { + "name": "IS_NOT_NULL" + } + ], + "comment": "/* ----------------\n * NullTest\n *\n * NullTest represents the operation of testing a value for NULLness.\n * The appropriate test is performed and returned as a boolean Datum.\n *\n * NOTE: the semantics of this for rowtype inputs are noticeably different\n * from the scalar case. We provide an \"argisrow\" flag to reflect that.\n * ----------------\n */\n" + }, + "BoolTestType": { + "values": [ + { + "comment": "" + }, + { + "name": "IS_TRUE", + "comment": null + }, + { + "name": "IS_NOT_TRUE" + } + ], + "comment": "/*\n * BooleanTest\n *\n * BooleanTest represents the operation of determining whether a boolean\n * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations\n * are supported. Note that a NULL input does *not* cause a NULL result.\n * The appropriate test is performed and returned as a boolean Datum.\n */\n" + } + }, + "nodes/nodes": { + "NodeTag": { + "values": [ + { + "comment": "" + }, + { + "name": "T_Invalid", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR EXECUTOR NODES (execnodes.h)\n\t */\n" + }, + { + "name": "T_IndexInfo", + "comment": null + }, + { + "name": "T_ExprContext", + "comment": null + }, + { + "name": "T_ProjectionInfo", + "comment": null + }, + { + "name": "T_JunkFilter", + "comment": null + }, + { + "name": "T_ResultRelInfo", + "comment": null + }, + { + "name": "T_EState", + "comment": null + }, + { + "name": "T_TupleTableSlot", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR PLAN NODES (plannodes.h)\n\t */\n" + }, + { + "name": "T_Plan", + "comment": null + }, + { + "name": "T_Result", + "comment": null + }, + { + "name": "T_ModifyTable", + "comment": null + }, + { + "name": "T_Append", + "comment": null + }, + { + "name": "T_MergeAppend", + "comment": null + }, + { + "name": "T_RecursiveUnion", + "comment": null + }, + { + "name": "T_BitmapAnd", + "comment": null + }, + { + "name": "T_BitmapOr", + "comment": null + }, + { + "name": "T_Scan", + "comment": null + }, + { + "name": "T_SeqScan", + "comment": null + }, + { + "name": "T_IndexScan", + "comment": null + }, + { + "name": "T_IndexOnlyScan", + "comment": null + }, + { + "name": "T_BitmapIndexScan", + "comment": null + }, + { + "name": "T_BitmapHeapScan", + "comment": null + }, + { + "name": "T_TidScan", + "comment": null + }, + { + "name": "T_SubqueryScan", + "comment": null + }, + { + "name": "T_FunctionScan", + "comment": null + }, + { + "name": "T_ValuesScan", + "comment": null + }, + { + "name": "T_CteScan", + "comment": null + }, + { + "name": "T_WorkTableScan", + "comment": null + }, + { + "name": "T_ForeignScan", + "comment": null + }, + { + "name": "T_Join", + "comment": null + }, + { + "name": "T_NestLoop", + "comment": null + }, + { + "name": "T_MergeJoin", + "comment": null + }, + { + "name": "T_HashJoin", + "comment": null + }, + { + "name": "T_Material", + "comment": null + }, + { + "name": "T_Sort", + "comment": null + }, + { + "name": "T_Group", + "comment": null + }, + { + "name": "T_Agg", + "comment": null + }, + { + "name": "T_WindowAgg", + "comment": null + }, + { + "name": "T_Unique", + "comment": null + }, + { + "name": "T_Hash", + "comment": null + }, + { + "name": "T_SetOp", + "comment": null + }, + { + "name": "T_LockRows", + "comment": null + }, + { + "name": "T_Limit", + "comment": null + }, + { + "comment": "\t/* these aren't subclasses of Plan: */\n" + }, + { + "name": "T_NestLoopParam", + "comment": null + }, + { + "name": "T_PlanRowMark", + "comment": null + }, + { + "name": "T_PlanInvalItem", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR PLAN STATE NODES (execnodes.h)\n\t *\n\t * These should correspond one-to-one with Plan node types.\n\t */\n" + }, + { + "name": "T_PlanState", + "comment": null + }, + { + "name": "T_ResultState", + "comment": null + }, + { + "name": "T_ModifyTableState", + "comment": null + }, + { + "name": "T_AppendState", + "comment": null + }, + { + "name": "T_MergeAppendState", + "comment": null + }, + { + "name": "T_RecursiveUnionState", + "comment": null + }, + { + "name": "T_BitmapAndState", + "comment": null + }, + { + "name": "T_BitmapOrState", + "comment": null + }, + { + "name": "T_ScanState", + "comment": null + }, + { + "name": "T_SeqScanState", + "comment": null + }, + { + "name": "T_IndexScanState", + "comment": null + }, + { + "name": "T_IndexOnlyScanState", + "comment": null + }, + { + "name": "T_BitmapIndexScanState", + "comment": null + }, + { + "name": "T_BitmapHeapScanState", + "comment": null + }, + { + "name": "T_TidScanState", + "comment": null + }, + { + "name": "T_SubqueryScanState", + "comment": null + }, + { + "name": "T_FunctionScanState", + "comment": null + }, + { + "name": "T_ValuesScanState", + "comment": null + }, + { + "name": "T_CteScanState", + "comment": null + }, + { + "name": "T_WorkTableScanState", + "comment": null + }, + { + "name": "T_ForeignScanState", + "comment": null + }, + { + "name": "T_JoinState", + "comment": null + }, + { + "name": "T_NestLoopState", + "comment": null + }, + { + "name": "T_MergeJoinState", + "comment": null + }, + { + "name": "T_HashJoinState", + "comment": null + }, + { + "name": "T_MaterialState", + "comment": null + }, + { + "name": "T_SortState", + "comment": null + }, + { + "name": "T_GroupState", + "comment": null + }, + { + "name": "T_AggState", + "comment": null + }, + { + "name": "T_WindowAggState", + "comment": null + }, + { + "name": "T_UniqueState", + "comment": null + }, + { + "name": "T_HashState", + "comment": null + }, + { + "name": "T_SetOpState", + "comment": null + }, + { + "name": "T_LockRowsState", + "comment": null + }, + { + "name": "T_LimitState", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR PRIMITIVE NODES (primnodes.h)\n\t */\n" + }, + { + "name": "T_Alias", + "comment": null + }, + { + "name": "T_RangeVar", + "comment": null + }, + { + "name": "T_Expr", + "comment": null + }, + { + "name": "T_Var", + "comment": null + }, + { + "name": "T_Const", + "comment": null + }, + { + "name": "T_Param", + "comment": null + }, + { + "name": "T_Aggref", + "comment": null + }, + { + "name": "T_WindowFunc", + "comment": null + }, + { + "name": "T_ArrayRef", + "comment": null + }, + { + "name": "T_FuncExpr", + "comment": null + }, + { + "name": "T_NamedArgExpr", + "comment": null + }, + { + "name": "T_OpExpr", + "comment": null + }, + { + "name": "T_DistinctExpr", + "comment": null + }, + { + "name": "T_NullIfExpr", + "comment": null + }, + { + "name": "T_ScalarArrayOpExpr", + "comment": null + }, + { + "name": "T_BoolExpr", + "comment": null + }, + { + "name": "T_SubLink", + "comment": null + }, + { + "name": "T_SubPlan", + "comment": null + }, + { + "name": "T_AlternativeSubPlan", + "comment": null + }, + { + "name": "T_FieldSelect", + "comment": null + }, + { + "name": "T_FieldStore", + "comment": null + }, + { + "name": "T_RelabelType", + "comment": null + }, + { + "name": "T_CoerceViaIO", + "comment": null + }, + { + "name": "T_ArrayCoerceExpr", + "comment": null + }, + { + "name": "T_ConvertRowtypeExpr", + "comment": null + }, + { + "name": "T_CollateExpr", + "comment": null + }, + { + "name": "T_CaseExpr", + "comment": null + }, + { + "name": "T_CaseWhen", + "comment": null + }, + { + "name": "T_CaseTestExpr", + "comment": null + }, + { + "name": "T_ArrayExpr", + "comment": null + }, + { + "name": "T_RowExpr", + "comment": null + }, + { + "name": "T_RowCompareExpr", + "comment": null + }, + { + "name": "T_CoalesceExpr", + "comment": null + }, + { + "name": "T_MinMaxExpr", + "comment": null + }, + { + "name": "T_XmlExpr", + "comment": null + }, + { + "name": "T_NullTest", + "comment": null + }, + { + "name": "T_BooleanTest", + "comment": null + }, + { + "name": "T_CoerceToDomain", + "comment": null + }, + { + "name": "T_CoerceToDomainValue", + "comment": null + }, + { + "name": "T_SetToDefault", + "comment": null + }, + { + "name": "T_CurrentOfExpr", + "comment": null + }, + { + "name": "T_TargetEntry", + "comment": null + }, + { + "name": "T_RangeTblRef", + "comment": null + }, + { + "name": "T_JoinExpr", + "comment": null + }, + { + "name": "T_FromExpr", + "comment": null + }, + { + "name": "T_IntoClause", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR EXPRESSION STATE NODES (execnodes.h)\n\t *\n\t * These correspond (not always one-for-one) to primitive nodes derived\n\t * from Expr.\n\t */\n" + }, + { + "name": "T_ExprState", + "comment": null + }, + { + "name": "T_GenericExprState", + "comment": null + }, + { + "name": "T_WholeRowVarExprState", + "comment": null + }, + { + "name": "T_AggrefExprState", + "comment": null + }, + { + "name": "T_WindowFuncExprState", + "comment": null + }, + { + "name": "T_ArrayRefExprState", + "comment": null + }, + { + "name": "T_FuncExprState", + "comment": null + }, + { + "name": "T_ScalarArrayOpExprState", + "comment": null + }, + { + "name": "T_BoolExprState", + "comment": null + }, + { + "name": "T_SubPlanState", + "comment": null + }, + { + "name": "T_AlternativeSubPlanState", + "comment": null + }, + { + "name": "T_FieldSelectState", + "comment": null + }, + { + "name": "T_FieldStoreState", + "comment": null + }, + { + "name": "T_CoerceViaIOState", + "comment": null + }, + { + "name": "T_ArrayCoerceExprState", + "comment": null + }, + { + "name": "T_ConvertRowtypeExprState", + "comment": null + }, + { + "name": "T_CaseExprState", + "comment": null + }, + { + "name": "T_CaseWhenState", + "comment": null + }, + { + "name": "T_ArrayExprState", + "comment": null + }, + { + "name": "T_RowExprState", + "comment": null + }, + { + "name": "T_RowCompareExprState", + "comment": null + }, + { + "name": "T_CoalesceExprState", + "comment": null + }, + { + "name": "T_MinMaxExprState", + "comment": null + }, + { + "name": "T_XmlExprState", + "comment": null + }, + { + "name": "T_NullTestState", + "comment": null + }, + { + "name": "T_CoerceToDomainState", + "comment": null + }, + { + "name": "T_DomainConstraintState", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR PLANNER NODES (relation.h)\n\t */\n" + }, + { + "name": "T_PlannerInfo", + "comment": null + }, + { + "name": "T_PlannerGlobal", + "comment": null + }, + { + "name": "T_RelOptInfo", + "comment": null + }, + { + "name": "T_IndexOptInfo", + "comment": null + }, + { + "name": "T_ParamPathInfo", + "comment": null + }, + { + "name": "T_Path", + "comment": null + }, + { + "name": "T_IndexPath", + "comment": null + }, + { + "name": "T_BitmapHeapPath", + "comment": null + }, + { + "name": "T_BitmapAndPath", + "comment": null + }, + { + "name": "T_BitmapOrPath", + "comment": null + }, + { + "name": "T_NestPath", + "comment": null + }, + { + "name": "T_MergePath", + "comment": null + }, + { + "name": "T_HashPath", + "comment": null + }, + { + "name": "T_TidPath", + "comment": null + }, + { + "name": "T_ForeignPath", + "comment": null + }, + { + "name": "T_AppendPath", + "comment": null + }, + { + "name": "T_MergeAppendPath", + "comment": null + }, + { + "name": "T_ResultPath", + "comment": null + }, + { + "name": "T_MaterialPath", + "comment": null + }, + { + "name": "T_UniquePath", + "comment": null + }, + { + "name": "T_EquivalenceClass", + "comment": null + }, + { + "name": "T_EquivalenceMember", + "comment": null + }, + { + "name": "T_PathKey", + "comment": null + }, + { + "name": "T_RestrictInfo", + "comment": null + }, + { + "name": "T_PlaceHolderVar", + "comment": null + }, + { + "name": "T_SpecialJoinInfo", + "comment": null + }, + { + "name": "T_LateralJoinInfo", + "comment": null + }, + { + "name": "T_AppendRelInfo", + "comment": null + }, + { + "name": "T_PlaceHolderInfo", + "comment": null + }, + { + "name": "T_MinMaxAggInfo", + "comment": null + }, + { + "name": "T_PlannerParamItem", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR MEMORY NODES (memnodes.h)\n\t */\n" + }, + { + "name": "T_MemoryContext", + "comment": null + }, + { + "name": "T_AllocSetContext", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR VALUE NODES (value.h)\n\t */\n" + }, + { + "name": "T_Value", + "comment": null + }, + { + "name": "T_Integer", + "comment": null + }, + { + "name": "T_Float", + "comment": null + }, + { + "name": "T_String", + "comment": null + }, + { + "name": "T_BitString", + "comment": null + }, + { + "name": "T_Null", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR LIST NODES (pg_list.h)\n\t */\n" + }, + { + "name": "T_List", + "comment": null + }, + { + "name": "T_IntList", + "comment": null + }, + { + "name": "T_OidList", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR STATEMENT NODES (mostly in parsenodes.h)\n\t */\n" + }, + { + "name": "T_Query", + "comment": null + }, + { + "name": "T_PlannedStmt", + "comment": null + }, + { + "name": "T_InsertStmt", + "comment": null + }, + { + "name": "T_DeleteStmt", + "comment": null + }, + { + "name": "T_UpdateStmt", + "comment": null + }, + { + "name": "T_SelectStmt", + "comment": null + }, + { + "name": "T_AlterTableStmt", + "comment": null + }, + { + "name": "T_AlterTableCmd", + "comment": null + }, + { + "name": "T_AlterDomainStmt", + "comment": null + }, + { + "name": "T_SetOperationStmt", + "comment": null + }, + { + "name": "T_GrantStmt", + "comment": null + }, + { + "name": "T_GrantRoleStmt", + "comment": null + }, + { + "name": "T_AlterDefaultPrivilegesStmt", + "comment": null + }, + { + "name": "T_ClosePortalStmt", + "comment": null + }, + { + "name": "T_ClusterStmt", + "comment": null + }, + { + "name": "T_CopyStmt", + "comment": null + }, + { + "name": "T_CreateStmt", + "comment": null + }, + { + "name": "T_DefineStmt", + "comment": null + }, + { + "name": "T_DropStmt", + "comment": null + }, + { + "name": "T_TruncateStmt", + "comment": null + }, + { + "name": "T_CommentStmt", + "comment": null + }, + { + "name": "T_FetchStmt", + "comment": null + }, + { + "name": "T_IndexStmt", + "comment": null + }, + { + "name": "T_CreateFunctionStmt", + "comment": null + }, + { + "name": "T_AlterFunctionStmt", + "comment": null + }, + { + "name": "T_DoStmt", + "comment": null + }, + { + "name": "T_RenameStmt", + "comment": null + }, + { + "name": "T_RuleStmt", + "comment": null + }, + { + "name": "T_NotifyStmt", + "comment": null + }, + { + "name": "T_ListenStmt", + "comment": null + }, + { + "name": "T_UnlistenStmt", + "comment": null + }, + { + "name": "T_TransactionStmt", + "comment": null + }, + { + "name": "T_ViewStmt", + "comment": null + }, + { + "name": "T_LoadStmt", + "comment": null + }, + { + "name": "T_CreateDomainStmt", + "comment": null + }, + { + "name": "T_CreatedbStmt", + "comment": null + }, + { + "name": "T_DropdbStmt", + "comment": null + }, + { + "name": "T_VacuumStmt", + "comment": null + }, + { + "name": "T_ExplainStmt", + "comment": null + }, + { + "name": "T_CreateTableAsStmt", + "comment": null + }, + { + "name": "T_CreateSeqStmt", + "comment": null + }, + { + "name": "T_AlterSeqStmt", + "comment": null + }, + { + "name": "T_VariableSetStmt", + "comment": null + }, + { + "name": "T_VariableShowStmt", + "comment": null + }, + { + "name": "T_DiscardStmt", + "comment": null + }, + { + "name": "T_CreateTrigStmt", + "comment": null + }, + { + "name": "T_CreatePLangStmt", + "comment": null + }, + { + "name": "T_CreateRoleStmt", + "comment": null + }, + { + "name": "T_AlterRoleStmt", + "comment": null + }, + { + "name": "T_DropRoleStmt", + "comment": null + }, + { + "name": "T_LockStmt", + "comment": null + }, + { + "name": "T_ConstraintsSetStmt", + "comment": null + }, + { + "name": "T_ReindexStmt", + "comment": null + }, + { + "name": "T_CheckPointStmt", + "comment": null + }, + { + "name": "T_CreateSchemaStmt", + "comment": null + }, + { + "name": "T_AlterDatabaseStmt", + "comment": null + }, + { + "name": "T_AlterDatabaseSetStmt", + "comment": null + }, + { + "name": "T_AlterRoleSetStmt", + "comment": null + }, + { + "name": "T_CreateConversionStmt", + "comment": null + }, + { + "name": "T_CreateCastStmt", + "comment": null + }, + { + "name": "T_CreateOpClassStmt", + "comment": null + }, + { + "name": "T_CreateOpFamilyStmt", + "comment": null + }, + { + "name": "T_AlterOpFamilyStmt", + "comment": null + }, + { + "name": "T_PrepareStmt", + "comment": null + }, + { + "name": "T_ExecuteStmt", + "comment": null + }, + { + "name": "T_DeallocateStmt", + "comment": null + }, + { + "name": "T_DeclareCursorStmt", + "comment": null + }, + { + "name": "T_CreateTableSpaceStmt", + "comment": null + }, + { + "name": "T_DropTableSpaceStmt", + "comment": null + }, + { + "name": "T_AlterObjectSchemaStmt", + "comment": null + }, + { + "name": "T_AlterOwnerStmt", + "comment": null + }, + { + "name": "T_DropOwnedStmt", + "comment": null + }, + { + "name": "T_ReassignOwnedStmt", + "comment": null + }, + { + "name": "T_CompositeTypeStmt", + "comment": null + }, + { + "name": "T_CreateEnumStmt", + "comment": null + }, + { + "name": "T_CreateRangeStmt", + "comment": null + }, + { + "name": "T_AlterEnumStmt", + "comment": null + }, + { + "name": "T_AlterTSDictionaryStmt", + "comment": null + }, + { + "name": "T_AlterTSConfigurationStmt", + "comment": null + }, + { + "name": "T_CreateFdwStmt", + "comment": null + }, + { + "name": "T_AlterFdwStmt", + "comment": null + }, + { + "name": "T_CreateForeignServerStmt", + "comment": null + }, + { + "name": "T_AlterForeignServerStmt", + "comment": null + }, + { + "name": "T_CreateUserMappingStmt", + "comment": null + }, + { + "name": "T_AlterUserMappingStmt", + "comment": null + }, + { + "name": "T_DropUserMappingStmt", + "comment": null + }, + { + "name": "T_AlterTableSpaceOptionsStmt", + "comment": null + }, + { + "name": "T_AlterTableMoveAllStmt", + "comment": null + }, + { + "name": "T_SecLabelStmt", + "comment": null + }, + { + "name": "T_CreateForeignTableStmt", + "comment": null + }, + { + "name": "T_CreateExtensionStmt", + "comment": null + }, + { + "name": "T_AlterExtensionStmt", + "comment": null + }, + { + "name": "T_AlterExtensionContentsStmt", + "comment": null + }, + { + "name": "T_CreateEventTrigStmt", + "comment": null + }, + { + "name": "T_AlterEventTrigStmt", + "comment": null + }, + { + "name": "T_RefreshMatViewStmt", + "comment": null + }, + { + "name": "T_ReplicaIdentityStmt", + "comment": null + }, + { + "name": "T_AlterSystemStmt", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR PARSE TREE NODES (parsenodes.h)\n\t */\n" + }, + { + "name": "T_A_Expr", + "comment": null + }, + { + "name": "T_ColumnRef", + "comment": null + }, + { + "name": "T_ParamRef", + "comment": null + }, + { + "name": "T_A_Const", + "comment": null + }, + { + "name": "T_FuncCall", + "comment": null + }, + { + "name": "T_A_Star", + "comment": null + }, + { + "name": "T_A_Indices", + "comment": null + }, + { + "name": "T_A_Indirection", + "comment": null + }, + { + "name": "T_A_ArrayExpr", + "comment": null + }, + { + "name": "T_ResTarget", + "comment": null + }, + { + "name": "T_TypeCast", + "comment": null + }, + { + "name": "T_CollateClause", + "comment": null + }, + { + "name": "T_SortBy", + "comment": null + }, + { + "name": "T_WindowDef", + "comment": null + }, + { + "name": "T_RangeSubselect", + "comment": null + }, + { + "name": "T_RangeFunction", + "comment": null + }, + { + "name": "T_TypeName", + "comment": null + }, + { + "name": "T_ColumnDef", + "comment": null + }, + { + "name": "T_IndexElem", + "comment": null + }, + { + "name": "T_Constraint", + "comment": null + }, + { + "name": "T_DefElem", + "comment": null + }, + { + "name": "T_RangeTblEntry", + "comment": null + }, + { + "name": "T_RangeTblFunction", + "comment": null + }, + { + "name": "T_WithCheckOption", + "comment": null + }, + { + "name": "T_SortGroupClause", + "comment": null + }, + { + "name": "T_WindowClause", + "comment": null + }, + { + "name": "T_PrivGrantee", + "comment": null + }, + { + "name": "T_FuncWithArgs", + "comment": null + }, + { + "name": "T_AccessPriv", + "comment": null + }, + { + "name": "T_CreateOpClassItem", + "comment": null + }, + { + "name": "T_TableLikeClause", + "comment": null + }, + { + "name": "T_FunctionParameter", + "comment": null + }, + { + "name": "T_LockingClause", + "comment": null + }, + { + "name": "T_RowMarkClause", + "comment": null + }, + { + "name": "T_XmlSerialize", + "comment": null + }, + { + "name": "T_WithClause", + "comment": null + }, + { + "name": "T_CommonTableExpr", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR REPLICATION GRAMMAR PARSE NODES (replnodes.h)\n\t */\n" + }, + { + "name": "T_IdentifySystemCmd", + "comment": null + }, + { + "name": "T_BaseBackupCmd", + "comment": null + }, + { + "name": "T_CreateReplicationSlotCmd", + "comment": null + }, + { + "name": "T_DropReplicationSlotCmd", + "comment": null + }, + { + "name": "T_StartReplicationCmd", + "comment": null + }, + { + "name": "T_TimeLineHistoryCmd", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * TAGS FOR RANDOM OTHER STUFF\n\t *\n\t * These are objects that aren't part of parse/plan/execute node tree\n\t * structures, but we give them NodeTags anyway for identification\n\t * purposes (usually because they are involved in APIs where we want to\n\t * pass multiple object types through the same pointer).\n\t */\n" + }, + { + "name": "T_TriggerData", + "comment": null + }, + { + "name": "T_EventTriggerData", + "comment": "/* in commands/event_trigger.h */" + }, + { + "name": "T_ReturnSetInfo", + "comment": "/* in nodes/execnodes.h */" + }, + { + "name": "T_WindowObjectData", + "comment": "/* private in nodeWindowAgg.c */" + }, + { + "name": "T_TIDBitmap", + "comment": "/* in nodes/tidbitmap.h */" + }, + { + "name": "T_InlineCodeBlock", + "comment": "/* in nodes/parsenodes.h */" + }, + { + "name": "T_FdwRoutine", + "comment": "/* in foreign/fdwapi.h */" + } + ], + "comment": "/*\n * The first field of every node is NodeTag. Each node created (with makeNode)\n * will have one of the following tags as the value of its first field.\n *\n * Note that the numbers of the node tags are not contiguous. We left holes\n * here so that we can add more tags without changing the existing enum's.\n * (Since node tag numbers never exist outside backend memory, there's no\n * real harm in renumbering, it just costs a full rebuild ...)\n */\n" + }, + "CmdType": { + "values": [ + { + "comment": "" + }, + { + "name": "CMD_UNKNOWN", + "comment": null + }, + { + "name": "CMD_SELECT", + "comment": "/* select stmt */" + }, + { + "name": "CMD_UPDATE", + "comment": "/* update stmt */" + }, + { + "name": "CMD_INSERT", + "comment": "/* insert stmt */" + }, + { + "name": "CMD_DELETE", + "comment": null + }, + { + "name": "CMD_UTILITY", + "comment": "/* cmds like create, destroy, copy, vacuum,\n\t\t\t\t\t\t\t\t * etc. */\n" + }, + { + "name": "CMD_NOTHING", + "comment": "/* dummy command for instead nothing rules\n\t\t\t\t\t\t\t\t * with qual */\n" + } + ], + "comment": "/*\n * CmdType -\n *\t enums for type of operation represented by a Query or PlannedStmt\n *\n * This is needed in both parsenodes.h and plannodes.h, so put it here...\n */\n" + }, + "JoinType": { + "values": [ + { + "comment": "" + }, + { + "comment": "\t/*\n\t * The canonical kinds of joins according to the SQL JOIN syntax. Only\n\t * these codes can appear in parser output (e.g., JoinExpr nodes).\n\t */\n" + }, + { + "name": "JOIN_INNER", + "comment": "/* matching tuple pairs only */" + }, + { + "name": "JOIN_LEFT", + "comment": "/* pairs + unmatched LHS tuples */" + }, + { + "name": "JOIN_FULL", + "comment": "/* pairs + unmatched LHS + unmatched RHS */" + }, + { + "name": "JOIN_RIGHT", + "comment": "/* pairs + unmatched RHS tuples */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Semijoins and anti-semijoins (as defined in relational theory) do not\n\t * appear in the SQL JOIN syntax, but there are standard idioms for\n\t * representing them (e.g., using EXISTS). The planner recognizes these\n\t * cases and converts them to joins. So the planner and executor must\n\t * support these codes. NOTE: in JOIN_SEMI output, it is unspecified\n\t * which matching RHS row is joined to. In JOIN_ANTI output, the row is\n\t * guaranteed to be null-extended.\n\t */\n" + }, + { + "name": "JOIN_SEMI", + "comment": "/* 1 copy of each LHS row that has match(es) */" + }, + { + "name": "JOIN_ANTI", + "comment": "/* 1 copy of each LHS row that has no match */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * These codes are used internally in the planner, but are not supported\n\t * by the executor (nor, indeed, by most of the planner).\n\t */\n" + }, + { + "name": "JOIN_UNIQUE_OUTER", + "comment": "/* LHS path must be made unique */" + }, + { + "name": "JOIN_UNIQUE_INNER", + "comment": "/* RHS path must be made unique */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * We might need additional join types someday.\n\t */\n" + } + ], + "comment": "/*\n * JoinType -\n *\t enums for types of relation joins\n *\n * JoinType determines the exact semantics of joining two relations using\n * a matching qualification. For example, it tells what to do with a tuple\n * that has no match in the other relation.\n *\n * This is needed in both parsenodes.h and plannodes.h, so put it here...\n */\n" + } + }, + "nodes/params": { + }, + "access/attnum": { + }, + "c": { + }, + "postgres": { + "vartag_external": { + "values": [ + { + "comment": "" + }, + { + "name": "VARTAG_INDIRECT", + "comment": null + }, + { + "name": "VARTAG_ONDISK", + "comment": null + } + ], + "comment": "/*\n * Type tag for the various sorts of \"TOAST pointer\" datums. The peculiar\n * value for VARTAG_ONDISK comes from a requirement for on-disk compatibility\n * with a previous notion that the tag field was the pointer datum's length.\n */\n" + } + }, + "postgres_ext": { + }, + "storage/block": { + }, + "access/sdir": { + "ScanDirection": { + "values": [ + { + "comment": "" + }, + { + "name": "BackwardScanDirection", + "comment": null + }, + { + "name": "NoMovementScanDirection", + "comment": null + }, + { + "name": "ForwardScanDirection", + "comment": null + } + ], + "comment": "/*\n * ScanDirection was an int8 for no apparent reason. I kept the original\n * values because I'm not sure if I'll break anything otherwise. -ay 2/95\n */\n" + } + } +} \ No newline at end of file diff --git a/srcdata/nodetypes.json b/srcdata/nodetypes.json new file mode 100644 index 00000000..722d0f1b --- /dev/null +++ b/srcdata/nodetypes.json @@ -0,0 +1,346 @@ +[ + "Invalid", + "IndexInfo", + "ExprContext", + "ProjectionInfo", + "JunkFilter", + "ResultRelInfo", + "EState", + "TupleTableSlot", + "Plan", + "Result", + "ModifyTable", + "Append", + "MergeAppend", + "RecursiveUnion", + "BitmapAnd", + "BitmapOr", + "Scan", + "SeqScan", + "IndexScan", + "IndexOnlyScan", + "BitmapIndexScan", + "BitmapHeapScan", + "TidScan", + "SubqueryScan", + "FunctionScan", + "ValuesScan", + "CteScan", + "WorkTableScan", + "ForeignScan", + "Join", + "NestLoop", + "MergeJoin", + "HashJoin", + "Material", + "Sort", + "Group", + "Agg", + "WindowAgg", + "Unique", + "Hash", + "SetOp", + "LockRows", + "Limit", + "NestLoopParam", + "PlanRowMark", + "PlanInvalItem", + "PlanState", + "ResultState", + "ModifyTableState", + "AppendState", + "MergeAppendState", + "RecursiveUnionState", + "BitmapAndState", + "BitmapOrState", + "ScanState", + "SeqScanState", + "IndexScanState", + "IndexOnlyScanState", + "BitmapIndexScanState", + "BitmapHeapScanState", + "TidScanState", + "SubqueryScanState", + "FunctionScanState", + "ValuesScanState", + "CteScanState", + "WorkTableScanState", + "ForeignScanState", + "JoinState", + "NestLoopState", + "MergeJoinState", + "HashJoinState", + "MaterialState", + "SortState", + "GroupState", + "AggState", + "WindowAggState", + "UniqueState", + "HashState", + "SetOpState", + "LockRowsState", + "LimitState", + "Alias", + "RangeVar", + "Expr", + "Var", + "Const", + "Param", + "Aggref", + "WindowFunc", + "ArrayRef", + "FuncExpr", + "NamedArgExpr", + "OpExpr", + "DistinctExpr", + "NullIfExpr", + "ScalarArrayOpExpr", + "BoolExpr", + "SubLink", + "SubPlan", + "AlternativeSubPlan", + "FieldSelect", + "FieldStore", + "RelabelType", + "CoerceViaIO", + "ArrayCoerceExpr", + "ConvertRowtypeExpr", + "CollateExpr", + "CaseExpr", + "CaseWhen", + "CaseTestExpr", + "ArrayExpr", + "RowExpr", + "RowCompareExpr", + "CoalesceExpr", + "MinMaxExpr", + "XmlExpr", + "NullTest", + "BooleanTest", + "CoerceToDomain", + "CoerceToDomainValue", + "SetToDefault", + "CurrentOfExpr", + "TargetEntry", + "RangeTblRef", + "JoinExpr", + "FromExpr", + "IntoClause", + "ExprState", + "GenericExprState", + "WholeRowVarExprState", + "AggrefExprState", + "WindowFuncExprState", + "ArrayRefExprState", + "FuncExprState", + "ScalarArrayOpExprState", + "BoolExprState", + "SubPlanState", + "AlternativeSubPlanState", + "FieldSelectState", + "FieldStoreState", + "CoerceViaIOState", + "ArrayCoerceExprState", + "ConvertRowtypeExprState", + "CaseExprState", + "CaseWhenState", + "ArrayExprState", + "RowExprState", + "RowCompareExprState", + "CoalesceExprState", + "MinMaxExprState", + "XmlExprState", + "NullTestState", + "CoerceToDomainState", + "DomainConstraintState", + "PlannerInfo", + "PlannerGlobal", + "RelOptInfo", + "IndexOptInfo", + "ParamPathInfo", + "Path", + "IndexPath", + "BitmapHeapPath", + "BitmapAndPath", + "BitmapOrPath", + "NestPath", + "MergePath", + "HashPath", + "TidPath", + "ForeignPath", + "AppendPath", + "MergeAppendPath", + "ResultPath", + "MaterialPath", + "UniquePath", + "EquivalenceClass", + "EquivalenceMember", + "PathKey", + "RestrictInfo", + "PlaceHolderVar", + "SpecialJoinInfo", + "LateralJoinInfo", + "AppendRelInfo", + "PlaceHolderInfo", + "MinMaxAggInfo", + "PlannerParamItem", + "MemoryContext", + "AllocSetContext", + "Value", + "Integer", + "Float", + "String", + "BitString", + "Null", + "List", + "IntList", + "OidList", + "Query", + "PlannedStmt", + "InsertStmt", + "DeleteStmt", + "UpdateStmt", + "SelectStmt", + "AlterTableStmt", + "AlterTableCmd", + "AlterDomainStmt", + "SetOperationStmt", + "GrantStmt", + "GrantRoleStmt", + "AlterDefaultPrivilegesStmt", + "ClosePortalStmt", + "ClusterStmt", + "CopyStmt", + "CreateStmt", + "DefineStmt", + "DropStmt", + "TruncateStmt", + "CommentStmt", + "FetchStmt", + "IndexStmt", + "CreateFunctionStmt", + "AlterFunctionStmt", + "DoStmt", + "RenameStmt", + "RuleStmt", + "NotifyStmt", + "ListenStmt", + "UnlistenStmt", + "TransactionStmt", + "ViewStmt", + "LoadStmt", + "CreateDomainStmt", + "CreatedbStmt", + "DropdbStmt", + "VacuumStmt", + "ExplainStmt", + "CreateTableAsStmt", + "CreateSeqStmt", + "AlterSeqStmt", + "VariableSetStmt", + "VariableShowStmt", + "DiscardStmt", + "CreateTrigStmt", + "CreatePLangStmt", + "CreateRoleStmt", + "AlterRoleStmt", + "DropRoleStmt", + "LockStmt", + "ConstraintsSetStmt", + "ReindexStmt", + "CheckPointStmt", + "CreateSchemaStmt", + "AlterDatabaseStmt", + "AlterDatabaseSetStmt", + "AlterRoleSetStmt", + "CreateConversionStmt", + "CreateCastStmt", + "CreateOpClassStmt", + "CreateOpFamilyStmt", + "AlterOpFamilyStmt", + "PrepareStmt", + "ExecuteStmt", + "DeallocateStmt", + "DeclareCursorStmt", + "CreateTableSpaceStmt", + "DropTableSpaceStmt", + "AlterObjectSchemaStmt", + "AlterOwnerStmt", + "DropOwnedStmt", + "ReassignOwnedStmt", + "CompositeTypeStmt", + "CreateEnumStmt", + "CreateRangeStmt", + "AlterEnumStmt", + "AlterTSDictionaryStmt", + "AlterTSConfigurationStmt", + "CreateFdwStmt", + "AlterFdwStmt", + "CreateForeignServerStmt", + "AlterForeignServerStmt", + "CreateUserMappingStmt", + "AlterUserMappingStmt", + "DropUserMappingStmt", + "AlterTableSpaceOptionsStmt", + "AlterTableMoveAllStmt", + "SecLabelStmt", + "CreateForeignTableStmt", + "CreateExtensionStmt", + "AlterExtensionStmt", + "AlterExtensionContentsStmt", + "CreateEventTrigStmt", + "AlterEventTrigStmt", + "RefreshMatViewStmt", + "ReplicaIdentityStmt", + "AlterSystemStmt", + "A_Expr", + "ColumnRef", + "ParamRef", + "A_Const", + "FuncCall", + "A_Star", + "A_Indices", + "A_Indirection", + "A_ArrayExpr", + "ResTarget", + "TypeCast", + "CollateClause", + "SortBy", + "WindowDef", + "RangeSubselect", + "RangeFunction", + "TypeName", + "ColumnDef", + "IndexElem", + "Constraint", + "DefElem", + "RangeTblEntry", + "RangeTblFunction", + "WithCheckOption", + "SortGroupClause", + "WindowClause", + "PrivGrantee", + "FuncWithArgs", + "AccessPriv", + "CreateOpClassItem", + "TableLikeClause", + "FunctionParameter", + "LockingClause", + "RowMarkClause", + "XmlSerialize", + "WithClause", + "CommonTableExpr", + "IdentifySystemCmd", + "BaseBackupCmd", + "CreateReplicationSlotCmd", + "DropReplicationSlotCmd", + "StartReplicationCmd", + "TimeLineHistoryCmd", + "ructures", + "TriggerData", + "EventTriggerData", + "ReturnSetInfo", + "WindowObjectData", + "TIDBitmap", + "InlineCodeBlock" +] \ No newline at end of file diff --git a/srcdata/struct_defs.json b/srcdata/struct_defs.json new file mode 100644 index 00000000..bfea1925 --- /dev/null +++ b/srcdata/struct_defs.json @@ -0,0 +1,6622 @@ +{ + "nodes/parsenodes": { + "Query": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "comment": "" + }, + { + "name": "commandType", + "c_type": "CmdType", + "comment": "/* select|insert|update|delete|utility */" + }, + { + "comment": "" + }, + { + "name": "querySource", + "c_type": "QuerySource", + "comment": "/* where did I come from? */" + }, + { + "comment": "" + }, + { + "name": "queryId", + "c_type": "uint32", + "comment": "/* query identifier (can be set by plugins) */" + }, + { + "comment": "" + }, + { + "name": "canSetTag", + "c_type": "bool", + "comment": "/* do I set the command result tag? */" + }, + { + "comment": "" + }, + { + "name": "utilityStmt", + "c_type": "Node*", + "comment": "/* non-null if this is DECLARE CURSOR or a\n\t\t\t\t\t\t\t\t * non-optimizable statement */\n" + }, + { + "comment": "" + }, + { + "name": "resultRelation", + "c_type": "int", + "comment": "/* rtable index of target relation for\n\t\t\t\t\t\t\t\t * INSERT/UPDATE/DELETE; 0 for SELECT */\n" + }, + { + "comment": "" + }, + { + "name": "hasAggs", + "c_type": "bool", + "comment": "/* has aggregates in tlist or havingQual */" + }, + { + "name": "hasWindowFuncs", + "c_type": "bool", + "comment": "/* has window functions in tlist */" + }, + { + "name": "hasSubLinks", + "c_type": "bool", + "comment": "/* has subquery SubLink */" + }, + { + "name": "hasDistinctOn", + "c_type": "bool", + "comment": "/* distinctClause is from DISTINCT ON */" + }, + { + "name": "hasRecursive", + "c_type": "bool", + "comment": "/* WITH RECURSIVE was specified */" + }, + { + "name": "hasModifyingCTE", + "c_type": "bool", + "comment": "/* has INSERT/UPDATE/DELETE in WITH */" + }, + { + "name": "hasForUpdate", + "c_type": "bool", + "comment": "/* FOR [KEY] UPDATE/SHARE was specified */" + }, + { + "comment": "" + }, + { + "name": "cteList", + "c_type": "List*", + "comment": "/* WITH list (of CommonTableExpr's) */" + }, + { + "comment": "" + }, + { + "name": "rtable", + "c_type": "List*", + "comment": "/* list of range table entries */" + }, + { + "name": "jointree", + "c_type": "FromExpr*", + "comment": "/* table join tree (FROM and WHERE clauses) */" + }, + { + "comment": "" + }, + { + "name": "targetList", + "c_type": "List*", + "comment": "/* target list (of TargetEntry) */" + }, + { + "comment": "" + }, + { + "name": "withCheckOptions", + "c_type": "List*", + "comment": "/* a list of WithCheckOption's */" + }, + { + "comment": "" + }, + { + "name": "returningList", + "c_type": "List*", + "comment": "/* return-values list (of TargetEntry) */" + }, + { + "comment": "" + }, + { + "name": "groupClause", + "c_type": "List*", + "comment": "/* a list of SortGroupClause's */" + }, + { + "comment": "" + }, + { + "name": "havingQual", + "c_type": "Node*", + "comment": "/* qualifications applied to groups */" + }, + { + "comment": "" + }, + { + "name": "windowClause", + "c_type": "List*", + "comment": "/* a list of WindowClause's */" + }, + { + "comment": "" + }, + { + "name": "distinctClause", + "c_type": "List*", + "comment": "/* a list of SortGroupClause's */" + }, + { + "comment": "" + }, + { + "name": "sortClause", + "c_type": "List*", + "comment": "/* a list of SortGroupClause's */" + }, + { + "comment": "" + }, + { + "name": "limitOffset", + "c_type": "Node*", + "comment": "/* # of result tuples to skip (int8 expr) */" + }, + { + "name": "limitCount", + "c_type": "Node*", + "comment": "/* # of result tuples to return (int8 expr) */" + }, + { + "comment": "" + }, + { + "name": "rowMarks", + "c_type": "List*", + "comment": "/* a list of RowMarkClause's */" + }, + { + "comment": "" + }, + { + "name": "setOperations", + "c_type": "Node*", + "comment": "/* set-operation tree if this is top level of\n\t\t\t\t\t\t\t\t * a UNION/INTERSECT/EXCEPT query */\n" + }, + { + "comment": "" + }, + { + "name": "constraintDeps", + "c_type": "List*", + "comment": "/* a list of pg_constraint OIDs that the query\n\t\t\t\t\t\t\t\t * depends on to be semantically valid */\n" + } + ], + "comment": "/*\n * Query -\n *\t Parse analysis turns all statements into a Query tree\n *\t for further processing by the rewriter and planner.\n *\n *\t Utility statements (i.e. non-optimizable statements) have the\n *\t utilityStmt field set, and the Query itself is mostly dummy.\n *\t DECLARE CURSOR is a special case: it is represented like a SELECT,\n *\t but the original DeclareCursorStmt is stored in utilityStmt.\n *\n *\t Planning converts a Query tree into a Plan tree headed by a PlannedStmt\n *\t node --- the Query structure is not used by the executor.\n */\n" + }, + "TypeName": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "names", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "typeOid", + "c_type": "Oid", + "comment": "/* type identified by OID */" + }, + { + "name": "setof", + "c_type": "bool", + "comment": "/* is a set? */" + }, + { + "name": "pct_type", + "c_type": "bool", + "comment": "/* %TYPE specified? */" + }, + { + "name": "typmods", + "c_type": "List*", + "comment": "/* type modifier expression(s) */" + }, + { + "name": "typemod", + "c_type": "int32", + "comment": "/* prespecified type modifier */" + }, + { + "name": "arrayBounds", + "c_type": "List*", + "comment": "/* array bounds */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * TypeName - specifies a type in definitions\n *\n * For TypeName structures generated internally, it is often easier to\n * specify the type by OID than by name. If \"names\" is NIL then the\n * actual type OID is given by typeOid, otherwise typeOid is unused.\n * Similarly, if \"typmods\" is NIL then the actual typmod is expected to\n * be prespecified in typemod, otherwise typemod is unused.\n *\n * If pct_type is TRUE, then names is actually a field name and we look up\n * the type of that field. Otherwise (the normal case), names is a type\n * name possibly qualified with schema and database name.\n */\n" + }, + "ColumnRef": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "fields", + "c_type": "List*", + "comment": "/* field names (Value strings) or A_Star */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * ColumnRef - specifies a reference to a column, or possibly a whole tuple\n *\n * The \"fields\" list must be nonempty. It can contain string Value nodes\n * (representing names) and A_Star nodes (representing occurrence of a '*').\n * Currently, A_Star must appear only as the last list element --- the grammar\n * is responsible for enforcing this!\n *\n * Note: any array subscripting or selection of fields from composite columns\n * is represented by an A_Indirection node above the ColumnRef. However,\n * for simplicity in the normal case, initial field selection from a table\n * name is represented within ColumnRef and not by adding A_Indirection.\n */\n" + }, + "ParamRef": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "number", + "c_type": "int", + "comment": "/* the number of the parameter */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * ParamRef - specifies a $n parameter reference\n */\n" + }, + "A_Expr": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "kind", + "c_type": "A_Expr_Kind", + "comment": "/* see above */" + }, + { + "name": "name", + "c_type": "List*", + "comment": "/* possibly-qualified name of operator */" + }, + { + "name": "lexpr", + "c_type": "Node*", + "comment": "/* left argument, or NULL if none */" + }, + { + "name": "rexpr", + "c_type": "Node*", + "comment": "/* right argument, or NULL if none */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * A_Expr - infix, prefix, and postfix expressions\n */\n" + }, + "A_Const": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "val", + "c_type": "Value", + "comment": "/* value (includes type info, see value.h) */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * A_Const - a literal constant\n */\n" + }, + "TypeCast": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "arg", + "c_type": "Node*", + "comment": "/* the expression being casted */" + }, + { + "name": "typeName", + "c_type": "TypeName*", + "comment": "/* the target type */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * TypeCast - a CAST expression\n */\n" + }, + "CollateClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "arg", + "c_type": "Node*", + "comment": "/* input expression */" + }, + { + "name": "collname", + "c_type": "List*", + "comment": "/* possibly-qualified collation name */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * CollateClause - a COLLATE expression\n */\n" + }, + "FuncCall": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "funcname", + "c_type": "List*", + "comment": "/* qualified name of function */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* the arguments (list of exprs) */" + }, + { + "name": "agg_order", + "c_type": "List*", + "comment": "/* ORDER BY (list of SortBy) */" + }, + { + "name": "agg_filter", + "c_type": "Node*", + "comment": "/* FILTER clause, if any */" + }, + { + "name": "agg_within_group", + "c_type": "bool", + "comment": "/* ORDER BY appeared in WITHIN GROUP */" + }, + { + "name": "agg_star", + "c_type": "bool", + "comment": "/* argument was really '*' */" + }, + { + "name": "agg_distinct", + "c_type": "bool", + "comment": "/* arguments were labeled DISTINCT */" + }, + { + "name": "func_variadic", + "c_type": "bool", + "comment": "/* last argument was labeled VARIADIC */" + }, + { + "name": "over", + "c_type": "WindowDef*", + "comment": "/* OVER clause, if any */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * FuncCall - a function or aggregate invocation\n *\n * agg_order (if not NIL) indicates we saw 'foo(... ORDER BY ...)', or if\n * agg_within_group is true, it was 'foo(...) WITHIN GROUP (ORDER BY ...)'.\n * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct\n * indicates we saw 'foo(DISTINCT ...)'. In any of these cases, the\n * construct *must* be an aggregate call. Otherwise, it might be either an\n * aggregate or some other kind of function. However, if FILTER or OVER is\n * present it had better be an aggregate or window function.\n *\n * Normally, you'd initialize this via makeFuncCall() and then only change the\n * parts of the struct its defaults don't match afterwards, as needed.\n */\n" + }, + "A_Star": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + } + ], + "comment": "/*\n * A_Star - '*' representing all columns of a table or compound field\n *\n * This can appear within ColumnRef.fields, A_Indirection.indirection, and\n * ResTarget.indirection lists.\n */\n" + }, + "A_Indices": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "lidx", + "c_type": "Node*", + "comment": "/* NULL if it's a single subscript */" + }, + { + "name": "uidx", + "c_type": "Node*", + "comment": null + } + ], + "comment": "/*\n * A_Indices - array subscript or slice bounds ([lidx:uidx] or [uidx])\n */\n" + }, + "A_Indirection": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "arg", + "c_type": "Node*", + "comment": "/* the thing being selected from */" + }, + { + "name": "indirection", + "c_type": "List*", + "comment": "/* subscripts and/or field names and/or * */" + } + ], + "comment": "/*\n * A_Indirection - select a field and/or array element from an expression\n *\n * The indirection list can contain A_Indices nodes (representing\n * subscripting), string Value nodes (representing field selection --- the\n * string value is the name of the field to select), and A_Star nodes\n * (representing selection of all fields of a composite type).\n * For example, a complex selection operation like\n *\t\t\t\t(foo).field1[42][7].field2\n * would be represented with a single A_Indirection node having a 4-element\n * indirection list.\n *\n * Currently, A_Star must appear only as the last list element --- the grammar\n * is responsible for enforcing this!\n */\n" + }, + "A_ArrayExpr": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "elements", + "c_type": "List*", + "comment": "/* array element expressions */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * A_ArrayExpr - an ARRAY[] construct\n */\n" + }, + "ResTarget": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* column name or NULL */" + }, + { + "name": "indirection", + "c_type": "List*", + "comment": "/* subscripts, field names, and '*', or NIL */" + }, + { + "name": "val", + "c_type": "Node*", + "comment": "/* the value expression to compute or assign */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * ResTarget -\n *\t result target (used in target list of pre-transformed parse trees)\n *\n * In a SELECT target list, 'name' is the column label from an\n * 'AS ColumnLabel' clause, or NULL if there was none, and 'val' is the\n * value expression itself. The 'indirection' field is not used.\n *\n * INSERT uses ResTarget in its target-column-names list. Here, 'name' is\n * the name of the destination column, 'indirection' stores any subscripts\n * attached to the destination, and 'val' is not used.\n *\n * In an UPDATE target list, 'name' is the name of the destination column,\n * 'indirection' stores any subscripts attached to the destination, and\n * 'val' is the expression to assign.\n *\n * See A_Indirection for more info about what can appear in 'indirection'.\n */\n" + }, + "SortBy": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "node", + "c_type": "Node*", + "comment": "/* expression to sort on */" + }, + { + "name": "sortby_dir", + "c_type": "SortByDir", + "comment": "/* ASC/DESC/USING/default */" + }, + { + "name": "sortby_nulls", + "c_type": "SortByNulls", + "comment": "/* NULLS FIRST/LAST */" + }, + { + "name": "useOp", + "c_type": "List*", + "comment": "/* name of op to use, if SORTBY_USING */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* operator location, or -1 if none/unknown */" + } + ], + "comment": "/*\n * SortBy - for ORDER BY clause\n */\n" + }, + "WindowDef": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* window's own name */" + }, + { + "name": "refname", + "c_type": "char*", + "comment": "/* referenced window name, if any */" + }, + { + "name": "partitionClause", + "c_type": "List*", + "comment": "/* PARTITION BY expression list */" + }, + { + "name": "orderClause", + "c_type": "List*", + "comment": "/* ORDER BY (list of SortBy) */" + }, + { + "name": "frameOptions", + "c_type": "int", + "comment": "/* frame_clause options, see below */" + }, + { + "name": "startOffset", + "c_type": "Node*", + "comment": "/* expression for starting bound, if any */" + }, + { + "name": "endOffset", + "c_type": "Node*", + "comment": "/* expression for ending bound, if any */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* parse location, or -1 if none/unknown */" + } + ], + "comment": "/*\n * WindowDef - raw representation of WINDOW and OVER clauses\n *\n * For entries in a WINDOW list, \"name\" is the window name being defined.\n * For OVER clauses, we use \"name\" for the \"OVER window\" syntax, or \"refname\"\n * for the \"OVER (window)\" syntax, which is subtly different --- the latter\n * implies overriding the window frame clause.\n */\n" + }, + "RangeSubselect": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "lateral", + "c_type": "bool", + "comment": "/* does it have LATERAL prefix? */" + }, + { + "name": "subquery", + "c_type": "Node*", + "comment": "/* the untransformed sub-select clause */" + }, + { + "name": "alias", + "c_type": "Alias*", + "comment": "/* table alias & optional column aliases */" + } + ], + "comment": "/*\n * RangeSubselect - subquery appearing in a FROM clause\n */\n" + }, + "RangeFunction": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "lateral", + "c_type": "bool", + "comment": "/* does it have LATERAL prefix? */" + }, + { + "name": "ordinality", + "c_type": "bool", + "comment": "/* does it have WITH ORDINALITY suffix? */" + }, + { + "name": "is_rowsfrom", + "c_type": "bool", + "comment": "/* is result of ROWS FROM() syntax? */" + }, + { + "name": "functions", + "c_type": "List*", + "comment": "/* per-function information, see above */" + }, + { + "name": "alias", + "c_type": "Alias*", + "comment": "/* table alias & optional column aliases */" + }, + { + "name": "coldeflist", + "c_type": "List*", + "comment": "/* list of ColumnDef nodes to describe result\n\t\t\t\t\t\t\t\t * of function returning RECORD */\n" + } + ], + "comment": "/*\n * RangeFunction - function call appearing in a FROM clause\n *\n * functions is a List because we use this to represent the construct\n * ROWS FROM(func1(...), func2(...), ...). Each element of this list is a\n * two-element sublist, the first element being the untransformed function\n * call tree, and the second element being a possibly-empty list of ColumnDef\n * nodes representing any columndef list attached to that function within the\n * ROWS FROM() syntax.\n *\n * alias and coldeflist represent any alias and/or columndef list attached\n * at the top level. (We disallow coldeflist appearing both here and\n * per-function, but that's checked in parse analysis, not by the grammar.)\n */\n" + }, + "ColumnDef": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "colname", + "c_type": "char*", + "comment": "/* name of column */" + }, + { + "name": "typeName", + "c_type": "TypeName*", + "comment": "/* type of column */" + }, + { + "name": "inhcount", + "c_type": "int", + "comment": "/* number of times column is inherited */" + }, + { + "name": "is_local", + "c_type": "bool", + "comment": "/* column has local (non-inherited) def'n */" + }, + { + "name": "is_not_null", + "c_type": "bool", + "comment": "/* NOT NULL constraint specified? */" + }, + { + "name": "is_from_type", + "c_type": "bool", + "comment": "/* column definition came from table type */" + }, + { + "name": "storage", + "c_type": "char", + "comment": "/* attstorage setting, or 0 for default */" + }, + { + "name": "raw_default", + "c_type": "Node*", + "comment": "/* default value (untransformed parse tree) */" + }, + { + "name": "cooked_default", + "c_type": "Node*", + "comment": "/* default value (transformed expr tree) */" + }, + { + "name": "collClause", + "c_type": "CollateClause*", + "comment": "/* untransformed COLLATE spec, if any */" + }, + { + "name": "collOid", + "c_type": "Oid", + "comment": "/* collation OID (InvalidOid if not set) */" + }, + { + "name": "constraints", + "c_type": "List*", + "comment": "/* other constraints on column */" + }, + { + "name": "fdwoptions", + "c_type": "List*", + "comment": "/* per-column FDW options */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* parse location, or -1 if none/unknown */" + } + ], + "comment": "/*\n * ColumnDef - column definition (used in various creates)\n *\n * If the column has a default value, we may have the value expression\n * in either \"raw\" form (an untransformed parse tree) or \"cooked\" form\n * (a post-parse-analysis, executable expression tree), depending on\n * how this ColumnDef node was created (by parsing, or by inheritance\n * from an existing relation). We should never have both in the same node!\n *\n * Similarly, we may have a COLLATE specification in either raw form\n * (represented as a CollateClause with arg==NULL) or cooked form\n * (the collation's OID).\n *\n * The constraints list may contain a CONSTR_DEFAULT item in a raw\n * parsetree produced by gram.y, but transformCreateStmt will remove\n * the item and set raw_default instead. CONSTR_DEFAULT items\n * should not appear in any subsequent processing.\n */\n" + }, + "TableLikeClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": null + }, + { + "name": "options", + "c_type": "bits32", + "comment": "/* OR of TableLikeOption flags */" + } + ], + "comment": "/*\n * TableLikeClause - CREATE TABLE ( ... LIKE ... ) clause\n */\n" + }, + "IndexElem": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* name of attribute to index, or NULL */" + }, + { + "name": "expr", + "c_type": "Node*", + "comment": "/* expression to index, or NULL */" + }, + { + "name": "indexcolname", + "c_type": "char*", + "comment": "/* name for index column; NULL = default */" + }, + { + "name": "collation", + "c_type": "List*", + "comment": "/* name of collation; NIL = default */" + }, + { + "name": "opclass", + "c_type": "List*", + "comment": "/* name of desired opclass; NIL = default */" + }, + { + "name": "ordering", + "c_type": "SortByDir", + "comment": "/* ASC/DESC/default */" + }, + { + "name": "nulls_ordering", + "c_type": "SortByNulls", + "comment": "/* FIRST/LAST/default */" + } + ], + "comment": "/*\n * IndexElem - index parameters (used in CREATE INDEX)\n *\n * For a plain index attribute, 'name' is the name of the table column to\n * index, and 'expr' is NULL. For an index expression, 'name' is NULL and\n * 'expr' is the expression tree.\n */\n" + }, + "DefElem": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "defnamespace", + "c_type": "char*", + "comment": "/* NULL if unqualified name */" + }, + { + "name": "defname", + "c_type": "char*", + "comment": null + }, + { + "name": "arg", + "c_type": "Node*", + "comment": "/* a (Value *) or a (TypeName *) */" + }, + { + "name": "defaction", + "c_type": "DefElemAction", + "comment": "/* unspecified action, or SET/ADD/DROP */" + } + ], + "comment": "/*\n * DefElem - a generic \"name = value\" option definition\n *\n * In some contexts the name can be qualified. Also, certain SQL commands\n * allow a SET/ADD/DROP action to be attached to option settings, so it's\n * convenient to carry a field for that too. (Note: currently, it is our\n * practice that the grammar allows namespace and action only in statements\n * where they are relevant; C code can just ignore those fields in other\n * statements.)\n */\n" + }, + "LockingClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "lockedRels", + "c_type": "List*", + "comment": "/* FOR [KEY] UPDATE/SHARE relations */" + }, + { + "name": "strength", + "c_type": "LockClauseStrength", + "comment": null + }, + { + "name": "noWait", + "c_type": "bool", + "comment": "/* NOWAIT option */" + } + ], + "comment": "/*\n * LockingClause - raw representation of FOR [NO KEY] UPDATE/[KEY] SHARE\n *\t\toptions\n *\n * Note: lockedRels == NIL means \"all relations in query\". Otherwise it\n * is a list of RangeVar nodes. (We use RangeVar mainly because it carries\n * a location field --- currently, parse analysis insists on unqualified\n * names in LockingClause.)\n */\n" + }, + "XmlSerialize": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "xmloption", + "c_type": "XmlOptionType", + "comment": "/* DOCUMENT or CONTENT */" + }, + { + "name": "expr", + "c_type": "Node*", + "comment": null + }, + { + "name": "typeName", + "c_type": "TypeName*", + "comment": null + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * XMLSERIALIZE (in raw parse tree only)\n */\n" + }, + "RangeTblEntry": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "comment": "" + }, + { + "name": "rtekind", + "c_type": "RTEKind", + "comment": "/* see above */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * XXX the fields applicable to only some rte kinds should be merged into\n\t * a union. I didn't do this yet because the diffs would impact a lot of\n\t * code that is being actively worked on. FIXME someday.\n\t */\n" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Fields valid for a plain relation RTE (else zero):\n\t */\n" + }, + { + "name": "relid", + "c_type": "Oid", + "comment": "/* OID of the relation */" + }, + { + "name": "relkind", + "c_type": "char", + "comment": "/* relation kind (see pg_class.relkind) */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Fields valid for a subquery RTE (else NULL):\n\t */\n" + }, + { + "name": "subquery", + "c_type": "Query*", + "comment": "/* the sub-query */" + }, + { + "name": "security_barrier", + "c_type": "bool", + "comment": "/* is from security_barrier view? */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Fields valid for a join RTE (else NULL/zero):\n\t *\n\t * joinaliasvars is a list of (usually) Vars corresponding to the columns\n\t * of the join result. An alias Var referencing column K of the join\n\t * result can be replaced by the K'th element of joinaliasvars --- but to\n\t * simplify the task of reverse-listing aliases correctly, we do not do\n\t * that until planning time. In detail: an element of joinaliasvars can\n\t * be a Var of one of the join's input relations, or such a Var with an\n\t * implicit coercion to the join's output column type, or a COALESCE\n\t * expression containing the two input column Vars (possibly coerced).\n\t * Within a Query loaded from a stored rule, it is also possible for\n\t * joinaliasvars items to be null pointers, which are placeholders for\n\t * (necessarily unreferenced) columns dropped since the rule was made.\n\t * Also, once planning begins, joinaliasvars items can be almost anything,\n\t * as a result of subquery-flattening substitutions.\n\t */\n" + }, + { + "name": "jointype", + "c_type": "JoinType", + "comment": "/* type of join */" + }, + { + "name": "joinaliasvars", + "c_type": "List*", + "comment": "/* list of alias-var expansions */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Fields valid for a function RTE (else NIL/zero):\n\t *\n\t * When funcordinality is true, the eref->colnames list includes an alias\n\t * for the ordinality column. The ordinality column is otherwise\n\t * implicit, and must be accounted for \"by hand\" in places such as\n\t * expandRTE().\n\t */\n" + }, + { + "name": "functions", + "c_type": "List*", + "comment": "/* list of RangeTblFunction nodes */" + }, + { + "name": "funcordinality", + "c_type": "bool", + "comment": "/* is this called WITH ORDINALITY? */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Fields valid for a values RTE (else NIL):\n\t */\n" + }, + { + "name": "values_lists", + "c_type": "List*", + "comment": "/* list of expression lists */" + }, + { + "name": "values_collations", + "c_type": "List*", + "comment": "/* OID list of column collation OIDs */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Fields valid for a CTE RTE (else NULL/zero):\n\t */\n" + }, + { + "name": "ctename", + "c_type": "char*", + "comment": "/* name of the WITH list item */" + }, + { + "name": "ctelevelsup", + "c_type": "Index", + "comment": "/* number of query levels up */" + }, + { + "name": "self_reference", + "c_type": "bool", + "comment": "/* is this a recursive self-reference? */" + }, + { + "name": "ctecoltypes", + "c_type": "List*", + "comment": "/* OID list of column type OIDs */" + }, + { + "name": "ctecoltypmods", + "c_type": "List*", + "comment": "/* integer list of column typmods */" + }, + { + "name": "ctecolcollations", + "c_type": "List*", + "comment": "/* OID list of column collation OIDs */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Fields valid in all RTEs:\n\t */\n" + }, + { + "name": "alias", + "c_type": "Alias*", + "comment": "/* user-written alias clause, if any */" + }, + { + "name": "eref", + "c_type": "Alias*", + "comment": "/* expanded reference names */" + }, + { + "name": "lateral", + "c_type": "bool", + "comment": "/* subquery, function, or values is LATERAL? */" + }, + { + "name": "inh", + "c_type": "bool", + "comment": "/* inheritance requested? */" + }, + { + "name": "inFromCl", + "c_type": "bool", + "comment": "/* present in FROM clause? */" + }, + { + "name": "requiredPerms", + "c_type": "AclMode", + "comment": "/* bitmask of required access permissions */" + }, + { + "name": "checkAsUser", + "c_type": "Oid", + "comment": "/* if valid, check access as this role */" + }, + { + "name": "selectedCols", + "c_type": "Bitmapset*", + "comment": "/* columns needing SELECT permission */" + }, + { + "name": "modifiedCols", + "c_type": "Bitmapset*", + "comment": "/* columns needing INSERT/UPDATE permission */" + }, + { + "name": "securityQuals", + "c_type": "List*", + "comment": "/* any security barrier quals to apply */" + } + ], + "comment": "/*--------------------\n * RangeTblEntry -\n *\t A range table is a List of RangeTblEntry nodes.\n *\n *\t A range table entry may represent a plain relation, a sub-select in\n *\t FROM, or the result of a JOIN clause. (Only explicit JOIN syntax\n *\t produces an RTE, not the implicit join resulting from multiple FROM\n *\t items. This is because we only need the RTE to deal with SQL features\n *\t like outer joins and join-output-column aliasing.) Other special\n *\t RTE types also exist, as indicated by RTEKind.\n *\n *\t Note that we consider RTE_RELATION to cover anything that has a pg_class\n *\t entry. relkind distinguishes the sub-cases.\n *\n *\t alias is an Alias node representing the AS alias-clause attached to the\n *\t FROM expression, or NULL if no clause.\n *\n *\t eref is the table reference name and column reference names (either\n *\t real or aliases). Note that system columns (OID etc) are not included\n *\t in the column list.\n *\t eref->aliasname is required to be present, and should generally be used\n *\t to identify the RTE for error messages etc.\n *\n *\t In RELATION RTEs, the colnames in both alias and eref are indexed by\n *\t physical attribute number; this means there must be colname entries for\n *\t dropped columns. When building an RTE we insert empty strings (\"\") for\n *\t dropped columns. Note however that a stored rule may have nonempty\n *\t colnames for columns dropped since the rule was created (and for that\n *\t matter the colnames might be out of date due to column renamings).\n *\t The same comments apply to FUNCTION RTEs when a function's return type\n *\t is a named composite type.\n *\n *\t In JOIN RTEs, the colnames in both alias and eref are one-to-one with\n *\t joinaliasvars entries. A JOIN RTE will omit columns of its inputs when\n *\t those columns are known to be dropped at parse time. Again, however,\n *\t a stored rule might contain entries for columns dropped since the rule\n *\t was created. (This is only possible for columns not actually referenced\n *\t in the rule.) When loading a stored rule, we replace the joinaliasvars\n *\t items for any such columns with null pointers. (We can't simply delete\n *\t them from the joinaliasvars list, because that would affect the attnums\n *\t of Vars referencing the rest of the list.)\n *\n *\t inh is TRUE for relation references that should be expanded to include\n *\t inheritance children, if the rel has any. This *must* be FALSE for\n *\t RTEs other than RTE_RELATION entries.\n *\n *\t inFromCl marks those range variables that are listed in the FROM clause.\n *\t It's false for RTEs that are added to a query behind the scenes, such\n *\t as the NEW and OLD variables for a rule, or the subqueries of a UNION.\n *\t This flag is not used anymore during parsing, since the parser now uses\n *\t a separate \"namespace\" data structure to control visibility, but it is\n *\t needed by ruleutils.c to determine whether RTEs should be shown in\n *\t decompiled queries.\n *\n *\t requiredPerms and checkAsUser specify run-time access permissions\n *\t checks to be performed at query startup. The user must have *all*\n *\t of the permissions that are OR'd together in requiredPerms (zero\n *\t indicates no permissions checking). If checkAsUser is not zero,\n *\t then do the permissions checks using the access rights of that user,\n *\t not the current effective user ID. (This allows rules to act as\n *\t setuid gateways.) Permissions checks only apply to RELATION RTEs.\n *\n *\t For SELECT/INSERT/UPDATE permissions, if the user doesn't have\n *\t table-wide permissions then it is sufficient to have the permissions\n *\t on all columns identified in selectedCols (for SELECT) and/or\n *\t modifiedCols (for INSERT/UPDATE; we can tell which from the query type).\n *\t selectedCols and modifiedCols are bitmapsets, which cannot have negative\n *\t integer members, so we subtract FirstLowInvalidHeapAttributeNumber from\n *\t column numbers before storing them in these fields. A whole-row Var\n *\t reference is represented by setting the bit for InvalidAttrNumber.\n *--------------------\n */\n" + }, + "RangeTblFunction": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "comment": "" + }, + { + "name": "funcexpr", + "c_type": "Node*", + "comment": "/* expression tree for func call */" + }, + { + "name": "funccolcount", + "c_type": "int", + "comment": "/* number of columns it contributes to RTE */" + }, + { + "comment": "\t/* These fields record the contents of a column definition list, if any: */\n" + }, + { + "name": "funccolnames", + "c_type": "List*", + "comment": "/* column names (list of String) */" + }, + { + "name": "funccoltypes", + "c_type": "List*", + "comment": "/* OID list of column type OIDs */" + }, + { + "name": "funccoltypmods", + "c_type": "List*", + "comment": "/* integer list of column typmods */" + }, + { + "name": "funccolcollations", + "c_type": "List*", + "comment": "/* OID list of column collation OIDs */" + }, + { + "comment": "\t/* This is set during planning for use by the executor: */\n" + }, + { + "name": "funcparams", + "c_type": "Bitmapset*", + "comment": "/* PARAM_EXEC Param IDs affecting this func */" + } + ], + "comment": "/*\n * RangeTblFunction -\n *\t RangeTblEntry subsidiary data for one function in a FUNCTION RTE.\n *\n * If the function had a column definition list (required for an\n * otherwise-unspecified RECORD result), funccolnames lists the names given\n * in the definition list, funccoltypes lists their declared column types,\n * funccoltypmods lists their typmods, funccolcollations their collations.\n * Otherwise, those fields are NIL.\n *\n * Notice we don't attempt to store info about the results of functions\n * returning named composite types, because those can change from time to\n * time. We do however remember how many columns we thought the type had\n * (including dropped columns!), so that we can successfully ignore any\n * columns added after the query was parsed.\n */\n" + }, + "WithCheckOption": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "viewname", + "c_type": "char*", + "comment": "/* name of view that specified the WCO */" + }, + { + "name": "qual", + "c_type": "Node*", + "comment": "/* constraint qual to check */" + }, + { + "name": "cascaded", + "c_type": "bool", + "comment": "/* true = WITH CASCADED CHECK OPTION */" + } + ], + "comment": "/*\n * WithCheckOption -\n *\t\trepresentation of WITH CHECK OPTION checks to be applied to new tuples\n *\t\twhen inserting/updating an auto-updatable view.\n */\n" + }, + "SortGroupClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "tleSortGroupRef", + "c_type": "Index", + "comment": "/* reference into targetlist */" + }, + { + "name": "eqop", + "c_type": "Oid", + "comment": "/* the equality operator ('=' op) */" + }, + { + "name": "sortop", + "c_type": "Oid", + "comment": "/* the ordering operator ('<' op), or 0 */" + }, + { + "name": "nulls_first", + "c_type": "bool", + "comment": "/* do NULLs come before normal values? */" + }, + { + "name": "hashable", + "c_type": "bool", + "comment": "/* can eqop be implemented by hashing? */" + } + ], + "comment": "/*\n * SortGroupClause -\n *\t\trepresentation of ORDER BY, GROUP BY, PARTITION BY,\n *\t\tDISTINCT, DISTINCT ON items\n *\n * You might think that ORDER BY is only interested in defining ordering,\n * and GROUP/DISTINCT are only interested in defining equality. However,\n * one way to implement grouping is to sort and then apply a \"uniq\"-like\n * filter. So it's also interesting to keep track of possible sort operators\n * for GROUP/DISTINCT, and in particular to try to sort for the grouping\n * in a way that will also yield a requested ORDER BY ordering. So we need\n * to be able to compare ORDER BY and GROUP/DISTINCT lists, which motivates\n * the decision to give them the same representation.\n *\n * tleSortGroupRef must match ressortgroupref of exactly one entry of the\n *\t\tquery's targetlist; that is the expression to be sorted or grouped by.\n * eqop is the OID of the equality operator.\n * sortop is the OID of the ordering operator (a \"<\" or \">\" operator),\n *\t\tor InvalidOid if not available.\n * nulls_first means about what you'd expect. If sortop is InvalidOid\n *\t\tthen nulls_first is meaningless and should be set to false.\n * hashable is TRUE if eqop is hashable (note this condition also depends\n *\t\ton the datatype of the input expression).\n *\n * In an ORDER BY item, all fields must be valid. (The eqop isn't essential\n * here, but it's cheap to get it along with the sortop, and requiring it\n * to be valid eases comparisons to grouping items.) Note that this isn't\n * actually enough information to determine an ordering: if the sortop is\n * collation-sensitive, a collation OID is needed too. We don't store the\n * collation in SortGroupClause because it's not available at the time the\n * parser builds the SortGroupClause; instead, consult the exposed collation\n * of the referenced targetlist expression to find out what it is.\n *\n * In a grouping item, eqop must be valid. If the eqop is a btree equality\n * operator, then sortop should be set to a compatible ordering operator.\n * We prefer to set eqop/sortop/nulls_first to match any ORDER BY item that\n * the query presents for the same tlist item. If there is none, we just\n * use the default ordering op for the datatype.\n *\n * If the tlist item's type has a hash opclass but no btree opclass, then\n * we will set eqop to the hash equality operator, sortop to InvalidOid,\n * and nulls_first to false. A grouping item of this kind can only be\n * implemented by hashing, and of course it'll never match an ORDER BY item.\n *\n * The hashable flag is provided since we generally have the requisite\n * information readily available when the SortGroupClause is constructed,\n * and it's relatively expensive to get it again later. Note there is no\n * need for a \"sortable\" flag since OidIsValid(sortop) serves the purpose.\n *\n * A query might have both ORDER BY and DISTINCT (or DISTINCT ON) clauses.\n * In SELECT DISTINCT, the distinctClause list is as long or longer than the\n * sortClause list, while in SELECT DISTINCT ON it's typically shorter.\n * The two lists must match up to the end of the shorter one --- the parser\n * rearranges the distinctClause if necessary to make this true. (This\n * restriction ensures that only one sort step is needed to both satisfy the\n * ORDER BY and set up for the Unique step. This is semantically necessary\n * for DISTINCT ON, and presents no real drawback for DISTINCT.)\n */\n" + }, + "WindowClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* window name (NULL in an OVER clause) */" + }, + { + "name": "refname", + "c_type": "char*", + "comment": "/* referenced window name, if any */" + }, + { + "name": "partitionClause", + "c_type": "List*", + "comment": "/* PARTITION BY list */" + }, + { + "name": "orderClause", + "c_type": "List*", + "comment": "/* ORDER BY list */" + }, + { + "name": "frameOptions", + "c_type": "int", + "comment": "/* frame_clause options, see WindowDef */" + }, + { + "name": "startOffset", + "c_type": "Node*", + "comment": "/* expression for starting bound, if any */" + }, + { + "name": "endOffset", + "c_type": "Node*", + "comment": "/* expression for ending bound, if any */" + }, + { + "name": "winref", + "c_type": "Index", + "comment": "/* ID referenced by window functions */" + }, + { + "name": "copiedOrder", + "c_type": "bool", + "comment": "/* did we copy orderClause from refname? */" + } + ], + "comment": "/*\n * WindowClause -\n *\t\ttransformed representation of WINDOW and OVER clauses\n *\n * A parsed Query's windowClause list contains these structs. \"name\" is set\n * if the clause originally came from WINDOW, and is NULL if it originally\n * was an OVER clause (but note that we collapse out duplicate OVERs).\n * partitionClause and orderClause are lists of SortGroupClause structs.\n * winref is an ID number referenced by WindowFunc nodes; it must be unique\n * among the members of a Query's windowClause list.\n * When refname isn't null, the partitionClause is always copied from there;\n * the orderClause might or might not be copied (see copiedOrder); the framing\n * options are never copied, per spec.\n */\n" + }, + "RowMarkClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "rti", + "c_type": "Index", + "comment": "/* range table index of target relation */" + }, + { + "name": "strength", + "c_type": "LockClauseStrength", + "comment": null + }, + { + "name": "noWait", + "c_type": "bool", + "comment": "/* NOWAIT option */" + }, + { + "name": "pushedDown", + "c_type": "bool", + "comment": "/* pushed down from higher query level? */" + } + ], + "comment": "/*\n * RowMarkClause -\n *\t parser output representation of FOR [KEY] UPDATE/SHARE clauses\n *\n * Query.rowMarks contains a separate RowMarkClause node for each relation\n * identified as a FOR [KEY] UPDATE/SHARE target. If one of these clauses\n * is applied to a subquery, we generate RowMarkClauses for all normal and\n * subquery rels in the subquery, but they are marked pushedDown = true to\n * distinguish them from clauses that were explicitly written at this query\n * level. Also, Query.hasForUpdate tells whether there were explicit FOR\n * UPDATE/SHARE/KEY SHARE clauses in the current query level.\n */\n" + }, + "WithClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "ctes", + "c_type": "List*", + "comment": "/* list of CommonTableExprs */" + }, + { + "name": "recursive", + "c_type": "bool", + "comment": "/* true = WITH RECURSIVE */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * WithClause -\n *\t representation of WITH clause\n *\n * Note: WithClause does not propagate into the Query representation;\n * but CommonTableExpr does.\n */\n" + }, + "CommonTableExpr": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "ctename", + "c_type": "char*", + "comment": "/* query name (never qualified) */" + }, + { + "name": "aliascolnames", + "c_type": "List*", + "comment": "/* optional list of column names */" + }, + { + "comment": "\t/* SelectStmt/InsertStmt/etc before parse analysis, Query afterwards: */\n" + }, + { + "name": "ctequery", + "c_type": "Node*", + "comment": "/* the CTE's subquery */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + }, + { + "comment": "\t/* These fields are set during parse analysis: */\n" + }, + { + "name": "cterecursive", + "c_type": "bool", + "comment": "/* is this CTE actually recursive? */" + }, + { + "name": "cterefcount", + "c_type": "int", + "comment": "/* number of RTEs referencing this CTE\n\t\t\t\t\t\t\t\t * (excluding internal self-references) */\n" + }, + { + "name": "ctecolnames", + "c_type": "List*", + "comment": "/* list of output column names */" + }, + { + "name": "ctecoltypes", + "c_type": "List*", + "comment": "/* OID list of output column type OIDs */" + }, + { + "name": "ctecoltypmods", + "c_type": "List*", + "comment": "/* integer list of output column typmods */" + }, + { + "name": "ctecolcollations", + "c_type": "List*", + "comment": "/* OID list of column collation OIDs */" + } + ], + "comment": "/*\n * CommonTableExpr -\n *\t representation of WITH list element\n *\n * We don't currently support the SEARCH or CYCLE clause.\n */\n" + }, + "InsertStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation to insert into */" + }, + { + "name": "cols", + "c_type": "List*", + "comment": "/* optional: names of the target columns */" + }, + { + "name": "selectStmt", + "c_type": "Node*", + "comment": "/* the source SELECT/VALUES, or NULL */" + }, + { + "name": "returningList", + "c_type": "List*", + "comment": "/* list of expressions to return */" + }, + { + "name": "withClause", + "c_type": "WithClause*", + "comment": "/* WITH clause */" + } + ], + "comment": "/* ----------------------\n *\t\tInsert Statement\n *\n * The source expression is represented by SelectStmt for both the\n * SELECT and VALUES cases. If selectStmt is NULL, then the query\n * is INSERT ... DEFAULT VALUES.\n * ----------------------\n */\n" + }, + "DeleteStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation to delete from */" + }, + { + "name": "usingClause", + "c_type": "List*", + "comment": "/* optional using clause for more tables */" + }, + { + "name": "whereClause", + "c_type": "Node*", + "comment": "/* qualifications */" + }, + { + "name": "returningList", + "c_type": "List*", + "comment": "/* list of expressions to return */" + }, + { + "name": "withClause", + "c_type": "WithClause*", + "comment": "/* WITH clause */" + } + ], + "comment": "/* ----------------------\n *\t\tDelete Statement\n * ----------------------\n */\n" + }, + "UpdateStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation to update */" + }, + { + "name": "targetList", + "c_type": "List*", + "comment": "/* the target list (of ResTarget) */" + }, + { + "name": "whereClause", + "c_type": "Node*", + "comment": "/* qualifications */" + }, + { + "name": "fromClause", + "c_type": "List*", + "comment": "/* optional from clause for more tables */" + }, + { + "name": "returningList", + "c_type": "List*", + "comment": "/* list of expressions to return */" + }, + { + "name": "withClause", + "c_type": "WithClause*", + "comment": "/* WITH clause */" + } + ], + "comment": "/* ----------------------\n *\t\tUpdate Statement\n * ----------------------\n */\n" + }, + "SelectStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * These fields are used only in \"leaf\" SelectStmts.\n\t */\n" + }, + { + "name": "distinctClause", + "c_type": "List*", + "comment": "/* NULL, list of DISTINCT ON exprs, or\n\t\t\t\t\t\t\t\t * lcons(NIL,NIL) for all (SELECT DISTINCT) */\n" + }, + { + "name": "intoClause", + "c_type": "IntoClause*", + "comment": "/* target for SELECT INTO */" + }, + { + "name": "targetList", + "c_type": "List*", + "comment": "/* the target list (of ResTarget) */" + }, + { + "name": "fromClause", + "c_type": "List*", + "comment": "/* the FROM clause */" + }, + { + "name": "whereClause", + "c_type": "Node*", + "comment": "/* WHERE qualification */" + }, + { + "name": "groupClause", + "c_type": "List*", + "comment": "/* GROUP BY clauses */" + }, + { + "name": "havingClause", + "c_type": "Node*", + "comment": "/* HAVING conditional-expression */" + }, + { + "name": "windowClause", + "c_type": "List*", + "comment": "/* WINDOW window_name AS (...), ... */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * In a \"leaf\" node representing a VALUES list, the above fields are all\n\t * null, and instead this field is set. Note that the elements of the\n\t * sublists are just expressions, without ResTarget decoration. Also note\n\t * that a list element can be DEFAULT (represented as a SetToDefault\n\t * node), regardless of the context of the VALUES list. It's up to parse\n\t * analysis to reject that where not valid.\n\t */\n" + }, + { + "name": "valuesLists", + "c_type": "List*", + "comment": "/* untransformed list of expression lists */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * These fields are used in both \"leaf\" SelectStmts and upper-level\n\t * SelectStmts.\n\t */\n" + }, + { + "name": "sortClause", + "c_type": "List*", + "comment": "/* sort clause (a list of SortBy's) */" + }, + { + "name": "limitOffset", + "c_type": "Node*", + "comment": "/* # of result tuples to skip */" + }, + { + "name": "limitCount", + "c_type": "Node*", + "comment": "/* # of result tuples to return */" + }, + { + "name": "lockingClause", + "c_type": "List*", + "comment": "/* FOR UPDATE (list of LockingClause's) */" + }, + { + "name": "withClause", + "c_type": "WithClause*", + "comment": "/* WITH clause */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * These fields are used only in upper-level SelectStmts.\n\t */\n" + }, + { + "name": "op", + "c_type": "SetOperation", + "comment": "/* type of set op */" + }, + { + "name": "all", + "c_type": "bool", + "comment": "/* ALL specified? */" + }, + { + "name": "larg", + "c_type": "SelectStmt*", + "comment": "/* left child */" + }, + { + "name": "rarg", + "c_type": "SelectStmt*", + "comment": "/* right child */" + }, + { + "comment": "\t/* Eventually add fields for CORRESPONDING spec here */\n" + } + ], + "comment": "/* ----------------------\n *\t\tSelect Statement\n *\n * A \"simple\" SELECT is represented in the output of gram.y by a single\n * SelectStmt node; so is a VALUES construct. A query containing set\n * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt\n * nodes, in which the leaf nodes are component SELECTs and the internal nodes\n * represent UNION, INTERSECT, or EXCEPT operators. Using the same node\n * type for both leaf and internal nodes allows gram.y to stick ORDER BY,\n * LIMIT, etc, clause values into a SELECT statement without worrying\n * whether it is a simple or compound SELECT.\n * ----------------------\n */\n" + }, + "SetOperationStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "op", + "c_type": "SetOperation", + "comment": "/* type of set op */" + }, + { + "name": "all", + "c_type": "bool", + "comment": "/* ALL specified? */" + }, + { + "name": "larg", + "c_type": "Node*", + "comment": "/* left child */" + }, + { + "name": "rarg", + "c_type": "Node*", + "comment": "/* right child */" + }, + { + "comment": "\t/* Eventually add fields for CORRESPONDING spec here */\n" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields derived during parse analysis: */\n" + }, + { + "name": "colTypes", + "c_type": "List*", + "comment": "/* OID list of output column type OIDs */" + }, + { + "name": "colTypmods", + "c_type": "List*", + "comment": "/* integer list of output column typmods */" + }, + { + "name": "colCollations", + "c_type": "List*", + "comment": "/* OID list of output column collation OIDs */" + }, + { + "name": "groupClauses", + "c_type": "List*", + "comment": "/* a list of SortGroupClause's */" + }, + { + "comment": "\t/* groupClauses is NIL if UNION ALL, but must be set otherwise */\n" + } + ], + "comment": "/* ----------------------\n *\t\tSet Operation node for post-analysis query trees\n *\n * After parse analysis, a SELECT with set operations is represented by a\n * top-level Query node containing the leaf SELECTs as subqueries in its\n * range table. Its setOperations field shows the tree of set operations,\n * with leaf SelectStmt nodes replaced by RangeTblRef nodes, and internal\n * nodes replaced by SetOperationStmt nodes. Information about the output\n * column types is added, too. (Note that the child nodes do not necessarily\n * produce these types directly, but we've checked that their output types\n * can be coerced to the output column type.) Also, if it's not UNION ALL,\n * information about the types' sort/group semantics is provided in the form\n * of a SortGroupClause list (same representation as, eg, DISTINCT).\n * The resolved common column collations are provided too; but note that if\n * it's not UNION ALL, it's okay for a column to not have a common collation,\n * so a member of the colCollations list could be InvalidOid even though the\n * column has a collatable type.\n * ----------------------\n */\n" + }, + "CreateSchemaStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "schemaname", + "c_type": "char*", + "comment": "/* the name of the schema to create */" + }, + { + "name": "authid", + "c_type": "char*", + "comment": "/* the owner of the created schema */" + }, + { + "name": "schemaElts", + "c_type": "List*", + "comment": "/* schema components (list of parsenodes) */" + }, + { + "name": "if_not_exists", + "c_type": "bool", + "comment": "/* just do nothing if schema already exists? */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Schema Statement\n *\n * NOTE: the schemaElts list contains raw parsetrees for component statements\n * of the schema, such as CREATE TABLE, GRANT, etc. These are analyzed and\n * executed after the schema itself is created.\n * ----------------------\n */\n" + }, + "AlterTableStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* table to work on */" + }, + { + "name": "cmds", + "c_type": "List*", + "comment": "/* list of subcommands */" + }, + { + "name": "relkind", + "c_type": "ObjectType", + "comment": "/* type of object */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if table missing */" + } + ], + "comment": "/* ----------------------\n *\tAlter Table\n * ----------------------\n */\n" + }, + "ReplicaIdentityStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "identity_type", + "c_type": "char", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": null + } + ], + "comment": "/* ----------------------\n *\tAlter Table\n * ----------------------\n */\n" + }, + "AlterTableCmd": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "subtype", + "c_type": "AlterTableType", + "comment": "/* Type of table alteration to apply */" + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* column, constraint, or trigger to act on,\n\t\t\t\t\t\t\t\t * or new owner or tablespace */\n" + }, + { + "name": "def", + "c_type": "Node*", + "comment": "/* definition of new column, index,\n\t\t\t\t\t\t\t\t * constraint, or parent table */\n" + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": "/* RESTRICT or CASCADE for DROP cases */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if missing? */" + } + ], + "comment": "/* ----------------------\n *\tAlter Table\n * ----------------------\n */\n" + }, + "AlterDomainStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "subtype", + "c_type": "char", + "comment": "/*------------\n\t\t\t\t\t\t\t\t *\tT = alter column default\n\t\t\t\t\t\t\t\t *\tN = alter column drop not null\n\t\t\t\t\t\t\t\t *\tO = alter column set not null\n\t\t\t\t\t\t\t\t *\tC = add constraint\n\t\t\t\t\t\t\t\t *\tX = drop constraint\n\t\t\t\t\t\t\t\t *------------\n\t\t\t\t\t\t\t\t */\n" + }, + { + "name": "typeName", + "c_type": "List*", + "comment": "/* domain to work on */" + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* column or constraint name to act on */" + }, + { + "name": "def", + "c_type": "Node*", + "comment": "/* definition of default or constraint */" + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": "/* RESTRICT or CASCADE for DROP cases */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if missing? */" + } + ], + "comment": "/* ----------------------\n *\tAlter Domain\n *\n * The fields are used in different ways by the different variants of\n * this command.\n * ----------------------\n */\n" + }, + "GrantStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "is_grant", + "c_type": "bool", + "comment": "/* true = GRANT, false = REVOKE */" + }, + { + "name": "targtype", + "c_type": "GrantTargetType", + "comment": "/* type of the grant target */" + }, + { + "name": "objtype", + "c_type": "GrantObjectType", + "comment": "/* kind of object being operated on */" + }, + { + "name": "objects", + "c_type": "List*", + "comment": "/* list of RangeVar nodes, FuncWithArgs nodes,\n\t\t\t\t\t\t\t\t * or plain names (as Value strings) */\n" + }, + { + "name": "privileges", + "c_type": "List*", + "comment": "/* list of AccessPriv nodes */" + }, + { + "comment": "\t/* privileges == NIL denotes ALL PRIVILEGES */\n" + }, + { + "name": "grantees", + "c_type": "List*", + "comment": "/* list of PrivGrantee nodes */" + }, + { + "name": "grant_option", + "c_type": "bool", + "comment": "/* grant or revoke grant option */" + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": "/* drop behavior (for REVOKE) */" + } + ], + "comment": "/* ----------------------\n *\t\tGrant|Revoke Statement\n * ----------------------\n */\n" + }, + "PrivGrantee": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "rolname", + "c_type": "char*", + "comment": "/* if NULL then PUBLIC */" + } + ], + "comment": "/* ----------------------\n *\t\tGrant|Revoke Statement\n * ----------------------\n */\n" + }, + "FuncWithArgs": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "funcname", + "c_type": "List*", + "comment": "/* qualified name of function */" + }, + { + "name": "funcargs", + "c_type": "List*", + "comment": "/* list of Typename nodes */" + } + ], + "comment": "/*\n * Note: FuncWithArgs carries only the types of the input parameters of the\n * function. So it is sufficient to identify an existing function, but it\n * is not enough info to define a function nor to call it.\n */\n" + }, + "AccessPriv": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "priv_name", + "c_type": "char*", + "comment": "/* string name of privilege */" + }, + { + "name": "cols", + "c_type": "List*", + "comment": "/* list of Value strings */" + } + ], + "comment": "/*\n * An access privilege, with optional list of column names\n * priv_name == NULL denotes ALL PRIVILEGES (only used with a column list)\n * cols == NIL denotes \"all columns\"\n * Note that simple \"ALL PRIVILEGES\" is represented as a NIL list, not\n * an AccessPriv with both fields null.\n */\n" + }, + "GrantRoleStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "granted_roles", + "c_type": "List*", + "comment": "/* list of roles to be granted/revoked */" + }, + { + "name": "grantee_roles", + "c_type": "List*", + "comment": "/* list of member roles to add/delete */" + }, + { + "name": "is_grant", + "c_type": "bool", + "comment": "/* true = GRANT, false = REVOKE */" + }, + { + "name": "admin_opt", + "c_type": "bool", + "comment": "/* with admin option */" + }, + { + "name": "grantor", + "c_type": "char*", + "comment": "/* set grantor to other than current role */" + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": "/* drop behavior (for REVOKE) */" + } + ], + "comment": "/* ----------------------\n *\t\tGrant/Revoke Role Statement\n *\n * Note: because of the parsing ambiguity with the GRANT \n * statement, granted_roles is a list of AccessPriv; the execution code\n * should complain if any column lists appear. grantee_roles is a list\n * of role names, as Value strings.\n * ----------------------\n */\n" + }, + "AlterDefaultPrivilegesStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* list of DefElem */" + }, + { + "name": "action", + "c_type": "GrantStmt*", + "comment": "/* GRANT/REVOKE action (with objects=NIL) */" + } + ], + "comment": "/* ----------------------\n *\tAlter Default Privileges Statement\n * ----------------------\n */\n" + }, + "CopyStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* the relation to copy */" + }, + { + "name": "query", + "c_type": "Node*", + "comment": "/* the SELECT query to copy */" + }, + { + "name": "attlist", + "c_type": "List*", + "comment": "/* List of column names (as Strings), or NIL\n\t\t\t\t\t\t\t\t * for all columns */\n" + }, + { + "name": "is_from", + "c_type": "bool", + "comment": "/* TO or FROM */" + }, + { + "name": "is_program", + "c_type": "bool", + "comment": "/* is 'filename' a program to popen? */" + }, + { + "name": "filename", + "c_type": "char*", + "comment": "/* filename, or NULL for STDIN/STDOUT */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/* ----------------------\n *\t\tCopy Statement\n *\n * We support \"COPY relation FROM file\", \"COPY relation TO file\", and\n * \"COPY (query) TO file\". In any given CopyStmt, exactly one of \"relation\"\n * and \"query\" must be non-NULL.\n * ----------------------\n */\n" + }, + "VariableSetStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "kind", + "c_type": "VariableSetKind", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* variable to be set */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* List of A_Const nodes */" + }, + { + "name": "is_local", + "c_type": "bool", + "comment": "/* SET LOCAL? */" + } + ], + "comment": null + }, + "VariableShowStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": null + } + ], + "comment": "/* ----------------------\n * Show Statement\n * ----------------------\n */\n" + }, + "CreateStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation to create */" + }, + { + "name": "tableElts", + "c_type": "List*", + "comment": "/* column definitions (list of ColumnDef) */" + }, + { + "name": "inhRelations", + "c_type": "List*", + "comment": "/* relations to inherit from (list of\n\t\t\t\t\t\t\t\t * inhRelation) */\n" + }, + { + "name": "ofTypename", + "c_type": "TypeName*", + "comment": "/* OF typename */" + }, + { + "name": "constraints", + "c_type": "List*", + "comment": "/* constraints (list of Constraint nodes) */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* options from WITH clause */" + }, + { + "name": "oncommit", + "c_type": "OnCommitAction", + "comment": "/* what do we do at COMMIT? */" + }, + { + "name": "tablespacename", + "c_type": "char*", + "comment": "/* table space to use, or NULL */" + }, + { + "name": "if_not_exists", + "c_type": "bool", + "comment": "/* just do nothing if it already exists? */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Table Statement\n *\n * NOTE: in the raw gram.y output, ColumnDef and Constraint nodes are\n * intermixed in tableElts, and constraints is NIL. After parse analysis,\n * tableElts contains just ColumnDefs, and constraints contains just\n * Constraint nodes (in fact, only CONSTR_CHECK nodes, in the present\n * implementation).\n * ----------------------\n */\n" + }, + "Constraint": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "contype", + "c_type": "ConstrType", + "comment": "/* see above */" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields used for most/all constraint types: */\n" + }, + { + "name": "conname", + "c_type": "char*", + "comment": "/* Constraint name, or NULL if unnamed */" + }, + { + "name": "deferrable", + "c_type": "bool", + "comment": "/* DEFERRABLE? */" + }, + { + "name": "initdeferred", + "c_type": "bool", + "comment": "/* INITIALLY DEFERRED? */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields used for constraints with expressions (CHECK and DEFAULT): */\n" + }, + { + "name": "is_no_inherit", + "c_type": "bool", + "comment": "/* is constraint non-inheritable? */" + }, + { + "name": "raw_expr", + "c_type": "Node*", + "comment": "/* expr, as untransformed parse tree */" + }, + { + "name": "cooked_expr", + "c_type": "char*", + "comment": "/* expr, as nodeToString representation */" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields used for unique constraints (UNIQUE and PRIMARY KEY): */\n" + }, + { + "name": "keys", + "c_type": "List*", + "comment": "/* String nodes naming referenced column(s) */" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields used for EXCLUSION constraints: */\n" + }, + { + "name": "exclusions", + "c_type": "List*", + "comment": "/* list of (IndexElem, operator name) pairs */" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields used for index constraints (UNIQUE, PRIMARY KEY, EXCLUSION): */\n" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* options from WITH clause */" + }, + { + "name": "indexname", + "c_type": "char*", + "comment": "/* existing index to use; otherwise NULL */" + }, + { + "name": "indexspace", + "c_type": "char*", + "comment": "/* index tablespace; NULL for default */" + }, + { + "comment": "\t/* These could be, but currently are not, used for UNIQUE/PKEY: */\n" + }, + { + "name": "access_method", + "c_type": "char*", + "comment": "/* index access method; NULL for default */" + }, + { + "name": "where_clause", + "c_type": "Node*", + "comment": "/* partial index predicate */" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields used for FOREIGN KEY constraints: */\n" + }, + { + "name": "pktable", + "c_type": "RangeVar*", + "comment": "/* Primary key table */" + }, + { + "name": "fk_attrs", + "c_type": "List*", + "comment": "/* Attributes of foreign key */" + }, + { + "name": "pk_attrs", + "c_type": "List*", + "comment": "/* Corresponding attrs in PK table */" + }, + { + "name": "fk_matchtype", + "c_type": "char", + "comment": "/* FULL, PARTIAL, SIMPLE */" + }, + { + "name": "fk_upd_action", + "c_type": "char", + "comment": "/* ON UPDATE action */" + }, + { + "name": "fk_del_action", + "c_type": "char", + "comment": "/* ON DELETE action */" + }, + { + "name": "old_conpfeqop", + "c_type": "List*", + "comment": "/* pg_constraint.conpfeqop of my former self */" + }, + { + "name": "old_pktable_oid", + "c_type": "Oid", + "comment": "/* pg_constraint.confrelid of my former self */" + }, + { + "comment": "" + }, + { + "comment": "\t/* Fields used for constraints that allow a NOT VALID specification */\n" + }, + { + "name": "skip_validation", + "c_type": "bool", + "comment": "/* skip validation of existing rows? */" + }, + { + "name": "initially_valid", + "c_type": "bool", + "comment": "/* mark the new constraint as valid? */" + } + ], + "comment": "/* Foreign key matchtype codes */\n" + }, + "CreateTableSpaceStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "tablespacename", + "c_type": "char*", + "comment": null + }, + { + "name": "owner", + "c_type": "char*", + "comment": null + }, + { + "name": "location", + "c_type": "char*", + "comment": null + }, + { + "name": "options", + "c_type": "List*", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Drop Table Space Statements\n * ----------------------\n */\n" + }, + "DropTableSpaceStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "tablespacename", + "c_type": "char*", + "comment": null + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if missing? */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Drop Table Space Statements\n * ----------------------\n */\n" + }, + "AlterTableSpaceOptionsStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "tablespacename", + "c_type": "char*", + "comment": null + }, + { + "name": "options", + "c_type": "List*", + "comment": null + }, + { + "name": "isReset", + "c_type": "bool", + "comment": null + } + ], + "comment": null + }, + "AlterTableMoveAllStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "orig_tablespacename", + "c_type": "char*", + "comment": null + }, + { + "name": "objtype", + "c_type": "ObjectType", + "comment": "/* Object type to move */" + }, + { + "name": "roles", + "c_type": "List*", + "comment": "/* List of roles to move objects of */" + }, + { + "name": "new_tablespacename", + "c_type": "char*", + "comment": null + }, + { + "name": "nowait", + "c_type": "bool", + "comment": null + } + ], + "comment": null + }, + "CreateExtensionStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "extname", + "c_type": "char*", + "comment": null + }, + { + "name": "if_not_exists", + "c_type": "bool", + "comment": "/* just do nothing if it already exists? */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Alter Extension Statements\n * ----------------------\n */\n" + }, + "AlterExtensionStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "extname", + "c_type": "char*", + "comment": null + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/* Only used for ALTER EXTENSION UPDATE; later might need an action field */\n" + }, + "AlterExtensionContentsStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "extname", + "c_type": "char*", + "comment": "/* Extension's name */" + }, + { + "name": "action", + "c_type": "int", + "comment": "/* +1 = add object, -1 = drop object */" + }, + { + "name": "objtype", + "c_type": "ObjectType", + "comment": "/* Object's type */" + }, + { + "name": "objname", + "c_type": "List*", + "comment": "/* Qualified name of the object */" + }, + { + "name": "objargs", + "c_type": "List*", + "comment": "/* Arguments if needed (eg, for functions) */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Alter Extension Statements\n * ----------------------\n */\n" + }, + "CreateFdwStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "fdwname", + "c_type": "char*", + "comment": "/* foreign-data wrapper name */" + }, + { + "name": "func_options", + "c_type": "List*", + "comment": "/* HANDLER/VALIDATOR options */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* generic options to FDW */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Alter FOREIGN DATA WRAPPER Statements\n * ----------------------\n */\n" + }, + "AlterFdwStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "fdwname", + "c_type": "char*", + "comment": "/* foreign-data wrapper name */" + }, + { + "name": "func_options", + "c_type": "List*", + "comment": "/* HANDLER/VALIDATOR options */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* generic options to FDW */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Alter FOREIGN DATA WRAPPER Statements\n * ----------------------\n */\n" + }, + "CreateForeignServerStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "servername", + "c_type": "char*", + "comment": "/* server name */" + }, + { + "name": "servertype", + "c_type": "char*", + "comment": "/* optional server type */" + }, + { + "name": "version", + "c_type": "char*", + "comment": "/* optional server version */" + }, + { + "name": "fdwname", + "c_type": "char*", + "comment": "/* FDW name */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* generic options to server */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Alter FOREIGN SERVER Statements\n * ----------------------\n */\n" + }, + "AlterForeignServerStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "servername", + "c_type": "char*", + "comment": "/* server name */" + }, + { + "name": "version", + "c_type": "char*", + "comment": "/* optional server version */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* generic options to server */" + }, + { + "name": "has_version", + "c_type": "bool", + "comment": "/* version specified */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Alter FOREIGN SERVER Statements\n * ----------------------\n */\n" + }, + "CreateForeignTableStmt": { + "fields": [ + { + "name": "base", + "c_type": "CreateStmt", + "comment": null + }, + { + "name": "servername", + "c_type": "char*", + "comment": null + }, + { + "name": "options", + "c_type": "List*", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\tCreate FOREIGN TABLE Statements\n * ----------------------\n */\n" + }, + "CreateUserMappingStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "username", + "c_type": "char*", + "comment": "/* username or PUBLIC/CURRENT_USER */" + }, + { + "name": "servername", + "c_type": "char*", + "comment": "/* server name */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* generic options to server */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Drop USER MAPPING Statements\n * ----------------------\n */\n" + }, + "AlterUserMappingStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "username", + "c_type": "char*", + "comment": "/* username or PUBLIC/CURRENT_USER */" + }, + { + "name": "servername", + "c_type": "char*", + "comment": "/* server name */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* generic options to server */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Drop USER MAPPING Statements\n * ----------------------\n */\n" + }, + "DropUserMappingStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "username", + "c_type": "char*", + "comment": "/* username or PUBLIC/CURRENT_USER */" + }, + { + "name": "servername", + "c_type": "char*", + "comment": "/* server name */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* ignore missing mappings */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Drop USER MAPPING Statements\n * ----------------------\n */\n" + }, + "CreateTrigStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "trigname", + "c_type": "char*", + "comment": "/* TRIGGER's name */" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation trigger is on */" + }, + { + "name": "funcname", + "c_type": "List*", + "comment": "/* qual. name of function to call */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* list of (T_String) Values or NIL */" + }, + { + "name": "row", + "c_type": "bool", + "comment": "/* ROW/STATEMENT */" + }, + { + "comment": "\t/* timing uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */\n" + }, + { + "name": "timing", + "c_type": "int16", + "comment": "/* BEFORE, AFTER, or INSTEAD */" + }, + { + "comment": "\t/* events uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */\n" + }, + { + "name": "events", + "c_type": "int16", + "comment": "/* \"OR\" of INSERT/UPDATE/DELETE/TRUNCATE */" + }, + { + "name": "columns", + "c_type": "List*", + "comment": "/* column names, or NIL for all columns */" + }, + { + "name": "whenClause", + "c_type": "Node*", + "comment": "/* qual expression, or NULL if none */" + }, + { + "name": "isconstraint", + "c_type": "bool", + "comment": "/* This is a constraint trigger */" + }, + { + "comment": "\t/* The remaining fields are only used for constraint triggers */\n" + }, + { + "name": "deferrable", + "c_type": "bool", + "comment": "/* [NOT] DEFERRABLE */" + }, + { + "name": "initdeferred", + "c_type": "bool", + "comment": "/* INITIALLY {DEFERRED|IMMEDIATE} */" + }, + { + "name": "constrrel", + "c_type": "RangeVar*", + "comment": "/* opposite relation, if RI trigger */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate TRIGGER Statement\n * ----------------------\n */\n" + }, + "CreateEventTrigStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "trigname", + "c_type": "char*", + "comment": "/* TRIGGER's name */" + }, + { + "name": "eventname", + "c_type": "char*", + "comment": "/* event's identifier */" + }, + { + "name": "whenclause", + "c_type": "List*", + "comment": "/* list of DefElems indicating filtering */" + }, + { + "name": "funcname", + "c_type": "List*", + "comment": "/* qual. name of function to call */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate EVENT TRIGGER Statement\n * ----------------------\n */\n" + }, + "AlterEventTrigStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "trigname", + "c_type": "char*", + "comment": "/* TRIGGER's name */" + }, + { + "name": "tgenabled", + "c_type": "char", + "comment": "/* trigger's firing configuration WRT\n\t\t\t\t\t\t\t\t * session_replication_role */\n" + } + ], + "comment": "/* ----------------------\n *\t\tAlter EVENT TRIGGER Statement\n * ----------------------\n */\n" + }, + "CreatePLangStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "replace", + "c_type": "bool", + "comment": "/* T => replace if already exists */" + }, + { + "name": "plname", + "c_type": "char*", + "comment": "/* PL name */" + }, + { + "name": "plhandler", + "c_type": "List*", + "comment": "/* PL call handler function (qual. name) */" + }, + { + "name": "plinline", + "c_type": "List*", + "comment": "/* optional inline function (qual. name) */" + }, + { + "name": "plvalidator", + "c_type": "List*", + "comment": "/* optional validator function (qual. name) */" + }, + { + "name": "pltrusted", + "c_type": "bool", + "comment": "/* PL is trusted */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate/Drop PROCEDURAL LANGUAGE Statements\n *\t\tCreate PROCEDURAL LANGUAGE Statements\n * ----------------------\n */\n" + }, + "CreateRoleStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "stmt_type", + "c_type": "RoleStmtType", + "comment": "/* ROLE/USER/GROUP */" + }, + { + "name": "role", + "c_type": "char*", + "comment": "/* role name */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/* ----------------------\n *\tCreate/Alter/Drop Role Statements\n *\n * Note: these node types are also used for the backwards-compatible\n * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases\n * there's really no need to distinguish what the original spelling was,\n * but for CREATE we mark the type because the defaults vary.\n * ----------------------\n */\n" + }, + "AlterRoleStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "role", + "c_type": "char*", + "comment": "/* role name */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + }, + { + "name": "action", + "c_type": "int", + "comment": "/* +1 = add members, -1 = drop members */" + } + ], + "comment": "/* ----------------------\n *\tCreate/Alter/Drop Role Statements\n *\n * Note: these node types are also used for the backwards-compatible\n * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases\n * there's really no need to distinguish what the original spelling was,\n * but for CREATE we mark the type because the defaults vary.\n * ----------------------\n */\n" + }, + "AlterRoleSetStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "role", + "c_type": "char*", + "comment": "/* role name */" + }, + { + "name": "database", + "c_type": "char*", + "comment": "/* database name, or NULL */" + }, + { + "name": "setstmt", + "c_type": "VariableSetStmt*", + "comment": "/* SET or RESET subcommand */" + } + ], + "comment": "/* ----------------------\n *\tCreate/Alter/Drop Role Statements\n *\n * Note: these node types are also used for the backwards-compatible\n * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases\n * there's really no need to distinguish what the original spelling was,\n * but for CREATE we mark the type because the defaults vary.\n * ----------------------\n */\n" + }, + "DropRoleStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "roles", + "c_type": "List*", + "comment": "/* List of roles to remove */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if a role is missing? */" + } + ], + "comment": "/* ----------------------\n *\tCreate/Alter/Drop Role Statements\n *\n * Note: these node types are also used for the backwards-compatible\n * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases\n * there's really no need to distinguish what the original spelling was,\n * but for CREATE we mark the type because the defaults vary.\n * ----------------------\n */\n" + }, + "CreateSeqStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "sequence", + "c_type": "RangeVar*", + "comment": "/* the sequence to create */" + }, + { + "name": "options", + "c_type": "List*", + "comment": null + }, + { + "name": "ownerId", + "c_type": "Oid", + "comment": "/* ID of owner, or InvalidOid for default */" + } + ], + "comment": "/* ----------------------\n *\t\t{Create|Alter} SEQUENCE Statement\n * ----------------------\n */\n" + }, + "AlterSeqStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "sequence", + "c_type": "RangeVar*", + "comment": "/* the sequence to alter */" + }, + { + "name": "options", + "c_type": "List*", + "comment": null + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if a role is missing? */" + } + ], + "comment": "/* ----------------------\n *\t\t{Create|Alter} SEQUENCE Statement\n * ----------------------\n */\n" + }, + "DefineStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "kind", + "c_type": "ObjectType", + "comment": "/* aggregate, operator, type */" + }, + { + "name": "oldstyle", + "c_type": "bool", + "comment": "/* hack to signal old CREATE AGG syntax */" + }, + { + "name": "defnames", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* a list of TypeName (if needed) */" + }, + { + "name": "definition", + "c_type": "List*", + "comment": "/* a list of DefElem */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate {Aggregate|Operator|Type} Statement\n * ----------------------\n */\n" + }, + "CreateDomainStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "domainname", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "typeName", + "c_type": "TypeName*", + "comment": "/* the base type */" + }, + { + "name": "collClause", + "c_type": "CollateClause*", + "comment": "/* untransformed COLLATE spec, if any */" + }, + { + "name": "constraints", + "c_type": "List*", + "comment": "/* constraints (list of Constraint nodes) */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Domain Statement\n * ----------------------\n */\n" + }, + "CreateOpClassStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "opclassname", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "opfamilyname", + "c_type": "List*", + "comment": "/* qualified name (ditto); NIL if omitted */" + }, + { + "name": "amname", + "c_type": "char*", + "comment": "/* name of index AM opclass is for */" + }, + { + "name": "datatype", + "c_type": "TypeName*", + "comment": "/* datatype of indexed column */" + }, + { + "name": "items", + "c_type": "List*", + "comment": "/* List of CreateOpClassItem nodes */" + }, + { + "name": "isDefault", + "c_type": "bool", + "comment": "/* Should be marked as default for type? */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Operator Class Statement\n * ----------------------\n */\n" + }, + "CreateOpClassItem": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "itemtype", + "c_type": "int", + "comment": "/* see codes above */" + }, + { + "comment": "\t/* fields used for an operator or function item: */\n" + }, + { + "name": "name", + "c_type": "List*", + "comment": "/* operator or function name */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* argument types */" + }, + { + "name": "number", + "c_type": "int", + "comment": "/* strategy num or support proc num */" + }, + { + "name": "order_family", + "c_type": "List*", + "comment": "/* only used for ordering operators */" + }, + { + "name": "class_args", + "c_type": "List*", + "comment": "/* only used for functions */" + }, + { + "comment": "\t/* fields used for a storagetype item: */\n" + }, + { + "name": "storedtype", + "c_type": "TypeName*", + "comment": "/* datatype stored in index */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Operator Class Statement\n * ----------------------\n */\n" + }, + "CreateOpFamilyStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "opfamilyname", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "amname", + "c_type": "char*", + "comment": "/* name of index AM opfamily is for */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Operator Family Statement\n * ----------------------\n */\n" + }, + "AlterOpFamilyStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "opfamilyname", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "amname", + "c_type": "char*", + "comment": "/* name of index AM opfamily is for */" + }, + { + "name": "isDrop", + "c_type": "bool", + "comment": "/* ADD or DROP the items? */" + }, + { + "name": "items", + "c_type": "List*", + "comment": "/* List of CreateOpClassItem nodes */" + } + ], + "comment": "/* ----------------------\n *\t\tAlter Operator Family Statement\n * ----------------------\n */\n" + }, + "DropStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "objects", + "c_type": "List*", + "comment": "/* list of sublists of names (as Values) */" + }, + { + "name": "arguments", + "c_type": "List*", + "comment": "/* list of sublists of arguments (as Values) */" + }, + { + "name": "removeType", + "c_type": "ObjectType", + "comment": "/* object type */" + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": "/* RESTRICT or CASCADE behavior */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if object is missing? */" + }, + { + "name": "concurrent", + "c_type": "bool", + "comment": "/* drop index concurrently? */" + } + ], + "comment": "/* ----------------------\n *\t\tDrop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement\n * ----------------------\n */\n" + }, + "TruncateStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relations", + "c_type": "List*", + "comment": "/* relations (RangeVars) to be truncated */" + }, + { + "name": "restart_seqs", + "c_type": "bool", + "comment": "/* restart owned sequences? */" + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": "/* RESTRICT or CASCADE behavior */" + } + ], + "comment": "/* ----------------------\n *\t\t\t\tTruncate Table Statement\n * ----------------------\n */\n" + }, + "CommentStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "objtype", + "c_type": "ObjectType", + "comment": "/* Object's type */" + }, + { + "name": "objname", + "c_type": "List*", + "comment": "/* Qualified name of the object */" + }, + { + "name": "objargs", + "c_type": "List*", + "comment": "/* Arguments if needed (eg, for functions) */" + }, + { + "name": "comment", + "c_type": "char*", + "comment": "/* Comment to insert, or NULL to remove */" + } + ], + "comment": "/* ----------------------\n *\t\t\t\tComment On Statement\n * ----------------------\n */\n" + }, + "SecLabelStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "objtype", + "c_type": "ObjectType", + "comment": "/* Object's type */" + }, + { + "name": "objname", + "c_type": "List*", + "comment": "/* Qualified name of the object */" + }, + { + "name": "objargs", + "c_type": "List*", + "comment": "/* Arguments if needed (eg, for functions) */" + }, + { + "name": "provider", + "c_type": "char*", + "comment": "/* Label provider (or NULL) */" + }, + { + "name": "label", + "c_type": "char*", + "comment": "/* New security label to be assigned */" + } + ], + "comment": "/* ----------------------\n *\t\t\t\tSECURITY LABEL Statement\n * ----------------------\n */\n" + }, + "DeclareCursorStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "portalname", + "c_type": "char*", + "comment": "/* name of the portal (cursor) */" + }, + { + "name": "options", + "c_type": "int", + "comment": "/* bitmask of options (see above) */" + }, + { + "name": "query", + "c_type": "Node*", + "comment": "/* the raw SELECT query */" + } + ], + "comment": "/* these planner-control flags do not correspond to any SQL grammar: */\n" + }, + "ClosePortalStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "portalname", + "c_type": "char*", + "comment": "/* name of the portal (cursor) */" + }, + { + "comment": "\t/* NULL means CLOSE ALL */\n" + } + ], + "comment": "/* ----------------------\n *\t\tClose Portal Statement\n * ----------------------\n */\n" + }, + "FetchStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "direction", + "c_type": "FetchDirection", + "comment": "/* see above */" + }, + { + "name": "howMany", + "c_type": "long", + "comment": "/* number of rows, or position argument */" + }, + { + "name": "portalname", + "c_type": "char*", + "comment": "/* name of portal (cursor) */" + }, + { + "name": "ismove", + "c_type": "bool", + "comment": "/* TRUE if MOVE */" + } + ], + "comment": "/* ----------------------\n *\t\tFetch Statement (also Move)\n * ----------------------\n */\n" + }, + "IndexStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "idxname", + "c_type": "char*", + "comment": "/* name of new index, or NULL for default */" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation to build index on */" + }, + { + "name": "accessMethod", + "c_type": "char*", + "comment": "/* name of access method (eg. btree) */" + }, + { + "name": "tableSpace", + "c_type": "char*", + "comment": "/* tablespace, or NULL for default */" + }, + { + "name": "indexParams", + "c_type": "List*", + "comment": "/* columns to index: a list of IndexElem */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* WITH clause options: a list of DefElem */" + }, + { + "name": "whereClause", + "c_type": "Node*", + "comment": "/* qualification (partial-index predicate) */" + }, + { + "name": "excludeOpNames", + "c_type": "List*", + "comment": "/* exclusion operator names, or NIL if none */" + }, + { + "name": "idxcomment", + "c_type": "char*", + "comment": "/* comment to apply to index, or NULL */" + }, + { + "name": "indexOid", + "c_type": "Oid", + "comment": "/* OID of an existing index, if any */" + }, + { + "name": "oldNode", + "c_type": "Oid", + "comment": "/* relfilenode of existing storage, if any */" + }, + { + "name": "unique", + "c_type": "bool", + "comment": "/* is index unique? */" + }, + { + "name": "primary", + "c_type": "bool", + "comment": "/* is index a primary key? */" + }, + { + "name": "isconstraint", + "c_type": "bool", + "comment": "/* is it for a pkey/unique constraint? */" + }, + { + "name": "deferrable", + "c_type": "bool", + "comment": "/* is the constraint DEFERRABLE? */" + }, + { + "name": "initdeferred", + "c_type": "bool", + "comment": "/* is the constraint INITIALLY DEFERRED? */" + }, + { + "name": "concurrent", + "c_type": "bool", + "comment": "/* should this be a concurrent index build? */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Index Statement\n *\n * This represents creation of an index and/or an associated constraint.\n * If isconstraint is true, we should create a pg_constraint entry along\n * with the index. But if indexOid isn't InvalidOid, we are not creating an\n * index, just a UNIQUE/PKEY constraint using an existing index. isconstraint\n * must always be true in this case, and the fields describing the index\n * properties are empty.\n * ----------------------\n */\n" + }, + "CreateFunctionStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "replace", + "c_type": "bool", + "comment": "/* T => replace if already exists */" + }, + { + "name": "funcname", + "c_type": "List*", + "comment": "/* qualified name of function to create */" + }, + { + "name": "parameters", + "c_type": "List*", + "comment": "/* a list of FunctionParameter */" + }, + { + "name": "returnType", + "c_type": "TypeName*", + "comment": "/* the return type */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* a list of DefElem */" + }, + { + "name": "withClause", + "c_type": "List*", + "comment": "/* a list of DefElem */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Function Statement\n * ----------------------\n */\n" + }, + "FunctionParameter": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* parameter name, or NULL if not given */" + }, + { + "name": "argType", + "c_type": "TypeName*", + "comment": "/* TypeName for parameter type */" + }, + { + "name": "mode", + "c_type": "FunctionParameterMode", + "comment": "/* IN/OUT/etc */" + }, + { + "name": "defexpr", + "c_type": "Node*", + "comment": "/* raw default expr, or NULL if not given */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Function Statement\n * ----------------------\n */\n" + }, + "AlterFunctionStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "func", + "c_type": "FuncWithArgs*", + "comment": "/* name and args of function */" + }, + { + "name": "actions", + "c_type": "List*", + "comment": "/* list of DefElem */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Function Statement\n * ----------------------\n */\n" + }, + "DoStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/* ----------------------\n *\t\tDO Statement\n *\n * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API\n * ----------------------\n */\n" + }, + "InlineCodeBlock": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "source_text", + "c_type": "char*", + "comment": "/* source text of anonymous code block */" + }, + { + "name": "langOid", + "c_type": "Oid", + "comment": "/* OID of selected language */" + }, + { + "name": "langIsTrusted", + "c_type": "bool", + "comment": "/* trusted property of the language */" + } + ], + "comment": "/* ----------------------\n *\t\tDO Statement\n *\n * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API\n * ----------------------\n */\n" + }, + "RenameStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "renameType", + "c_type": "ObjectType", + "comment": "/* OBJECT_TABLE, OBJECT_COLUMN, etc */" + }, + { + "name": "relationType", + "c_type": "ObjectType", + "comment": "/* if column name, associated relation type */" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* in case it's a table */" + }, + { + "name": "object", + "c_type": "List*", + "comment": "/* in case it's some other object */" + }, + { + "name": "objarg", + "c_type": "List*", + "comment": "/* argument types, if applicable */" + }, + { + "name": "subname", + "c_type": "char*", + "comment": "/* name of contained object (column, rule,\n\t\t\t\t\t\t\t\t * trigger, etc) */\n" + }, + { + "name": "newname", + "c_type": "char*", + "comment": "/* the new name */" + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": "/* RESTRICT or CASCADE behavior */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if missing? */" + } + ], + "comment": "/* ----------------------\n *\t\tAlter Object Rename Statement\n * ----------------------\n */\n" + }, + "AlterObjectSchemaStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "objectType", + "c_type": "ObjectType", + "comment": "/* OBJECT_TABLE, OBJECT_TYPE, etc */" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* in case it's a table */" + }, + { + "name": "object", + "c_type": "List*", + "comment": "/* in case it's some other object */" + }, + { + "name": "objarg", + "c_type": "List*", + "comment": "/* argument types, if applicable */" + }, + { + "name": "newschema", + "c_type": "char*", + "comment": "/* the new schema */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if missing? */" + } + ], + "comment": "/* ----------------------\n *\t\tALTER object SET SCHEMA Statement\n * ----------------------\n */\n" + }, + "AlterOwnerStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "objectType", + "c_type": "ObjectType", + "comment": "/* OBJECT_TABLE, OBJECT_TYPE, etc */" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* in case it's a table */" + }, + { + "name": "object", + "c_type": "List*", + "comment": "/* in case it's some other object */" + }, + { + "name": "objarg", + "c_type": "List*", + "comment": "/* argument types, if applicable */" + }, + { + "name": "newowner", + "c_type": "char*", + "comment": "/* the new owner */" + } + ], + "comment": "/* ----------------------\n *\t\tAlter Object Owner Statement\n * ----------------------\n */\n" + }, + "RuleStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation the rule is for */" + }, + { + "name": "rulename", + "c_type": "char*", + "comment": "/* name of the rule */" + }, + { + "name": "whereClause", + "c_type": "Node*", + "comment": "/* qualifications */" + }, + { + "name": "event", + "c_type": "CmdType", + "comment": "/* SELECT, INSERT, etc */" + }, + { + "name": "instead", + "c_type": "bool", + "comment": "/* is a 'do instead'? */" + }, + { + "name": "actions", + "c_type": "List*", + "comment": "/* the action statements */" + }, + { + "name": "replace", + "c_type": "bool", + "comment": "/* OR REPLACE */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Rule Statement\n * ----------------------\n */\n" + }, + "NotifyStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "conditionname", + "c_type": "char*", + "comment": "/* condition name to notify */" + }, + { + "name": "payload", + "c_type": "char*", + "comment": "/* the payload string, or NULL if none */" + } + ], + "comment": "/* ----------------------\n *\t\tNotify Statement\n * ----------------------\n */\n" + }, + "ListenStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "conditionname", + "c_type": "char*", + "comment": "/* condition name to listen on */" + } + ], + "comment": "/* ----------------------\n *\t\tListen Statement\n * ----------------------\n */\n" + }, + "UnlistenStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "conditionname", + "c_type": "char*", + "comment": "/* name to unlisten on, or NULL for all */" + } + ], + "comment": "/* ----------------------\n *\t\tUnlisten Statement\n * ----------------------\n */\n" + }, + "TransactionStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "kind", + "c_type": "TransactionStmtKind", + "comment": "/* see above */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* for BEGIN/START and savepoint commands */" + }, + { + "name": "gid", + "c_type": "char*", + "comment": "/* for two-phase-commit related commands */" + } + ], + "comment": "/* ----------------------\n *\t\t{Begin|Commit|Rollback} Transaction Statement\n * ----------------------\n */\n" + }, + "CompositeTypeStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "typevar", + "c_type": "RangeVar*", + "comment": "/* the composite type to be created */" + }, + { + "name": "coldeflist", + "c_type": "List*", + "comment": "/* list of ColumnDef nodes */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Type Statement, composite types\n * ----------------------\n */\n" + }, + "CreateEnumStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "typeName", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "vals", + "c_type": "List*", + "comment": "/* enum values (list of Value strings) */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Type Statement, enum types\n * ----------------------\n */\n" + }, + "CreateRangeStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "typeName", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "params", + "c_type": "List*", + "comment": "/* range parameters (list of DefElem) */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate Type Statement, range types\n * ----------------------\n */\n" + }, + "AlterEnumStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "typeName", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "newVal", + "c_type": "char*", + "comment": "/* new enum value's name */" + }, + { + "name": "newValNeighbor", + "c_type": "char*", + "comment": "/* neighboring enum value, if specified */" + }, + { + "name": "newValIsAfter", + "c_type": "bool", + "comment": "/* place new enum value after neighbor? */" + }, + { + "name": "skipIfExists", + "c_type": "bool", + "comment": "/* no error if label already exists */" + } + ], + "comment": "/* ----------------------\n *\t\tAlter Type Statement, enum types\n * ----------------------\n */\n" + }, + "ViewStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "view", + "c_type": "RangeVar*", + "comment": "/* the view to be created */" + }, + { + "name": "aliases", + "c_type": "List*", + "comment": "/* target column names */" + }, + { + "name": "query", + "c_type": "Node*", + "comment": "/* the SELECT query */" + }, + { + "name": "replace", + "c_type": "bool", + "comment": "/* replace an existing view? */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* options from WITH clause */" + }, + { + "name": "withCheckOption", + "c_type": "ViewCheckOption", + "comment": "/* WITH CHECK OPTION */" + } + ], + "comment": "/* ----------------------\n *\t\tCreate View Statement\n * ----------------------\n */\n" + }, + "LoadStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "filename", + "c_type": "char*", + "comment": "/* file to load */" + } + ], + "comment": "/* ----------------------\n *\t\tLoad Statement\n * ----------------------\n */\n" + }, + "CreatedbStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "dbname", + "c_type": "char*", + "comment": "/* name of database to create */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/* ----------------------\n *\t\tCreatedb Statement\n * ----------------------\n */\n" + }, + "AlterDatabaseStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "dbname", + "c_type": "char*", + "comment": "/* name of database to alter */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/* ----------------------\n *\tAlter Database\n * ----------------------\n */\n" + }, + "AlterDatabaseSetStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "dbname", + "c_type": "char*", + "comment": "/* database name */" + }, + { + "name": "setstmt", + "c_type": "VariableSetStmt*", + "comment": "/* SET or RESET subcommand */" + } + ], + "comment": "/* ----------------------\n *\tAlter Database\n * ----------------------\n */\n" + }, + "DropdbStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "dbname", + "c_type": "char*", + "comment": "/* database to drop */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* skip error if db is missing? */" + } + ], + "comment": "/* ----------------------\n *\t\tDropdb Statement\n * ----------------------\n */\n" + }, + "AlterSystemStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "setstmt", + "c_type": "VariableSetStmt*", + "comment": "/* SET subcommand */" + } + ], + "comment": "/* ----------------------\n *\t\tAlter System Statement\n * ----------------------\n */\n" + }, + "ClusterStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation being indexed, or NULL if all */" + }, + { + "name": "indexname", + "c_type": "char*", + "comment": "/* original index defined */" + }, + { + "name": "verbose", + "c_type": "bool", + "comment": "/* print progress info */" + } + ], + "comment": "/* ----------------------\n *\t\tCluster Statement (support pbrown's cluster index implementation)\n * ----------------------\n */\n" + }, + "VacuumStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "options", + "c_type": "int", + "comment": "/* OR of VacuumOption flags */" + }, + { + "name": "freeze_min_age", + "c_type": "int", + "comment": "/* min freeze age, or -1 to use default */" + }, + { + "name": "freeze_table_age", + "c_type": "int", + "comment": "/* age at which to scan whole table */" + }, + { + "name": "multixact_freeze_min_age", + "c_type": "int", + "comment": "/* min multixact freeze age,\n\t\t\t\t\t\t\t\t\t\t\t\t * or -1 to use default */\n" + }, + { + "name": "multixact_freeze_table_age", + "c_type": "int", + "comment": "/* multixact age at which to\n\t\t\t\t\t\t\t\t\t\t\t\t * scan whole table */\n" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* single table to process, or NULL */" + }, + { + "name": "va_cols", + "c_type": "List*", + "comment": "/* list of column names, or NIL for all */" + } + ], + "comment": "/* ----------------------\n *\t\tVacuum and Analyze Statements\n *\n * Even though these are nominally two statements, it's convenient to use\n * just one node type for both. Note that at least one of VACOPT_VACUUM\n * and VACOPT_ANALYZE must be set in options. VACOPT_FREEZE is an internal\n * convenience for the grammar and is not examined at runtime --- the\n * freeze_min_age and freeze_table_age fields are what matter.\n * ----------------------\n */\n" + }, + "ExplainStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "query", + "c_type": "Node*", + "comment": "/* the query (see comments above) */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* list of DefElem nodes */" + } + ], + "comment": "/* ----------------------\n *\t\tExplain Statement\n *\n * The \"query\" field is either a raw parse tree (SelectStmt, InsertStmt, etc)\n * or a Query node if parse analysis has been done. Note that rewriting and\n * planning of the query are always postponed until execution of EXPLAIN.\n * ----------------------\n */\n" + }, + "CreateTableAsStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "query", + "c_type": "Node*", + "comment": "/* the query (see comments above) */" + }, + { + "name": "into", + "c_type": "IntoClause*", + "comment": "/* destination table */" + }, + { + "name": "relkind", + "c_type": "ObjectType", + "comment": "/* OBJECT_TABLE or OBJECT_MATVIEW */" + }, + { + "name": "is_select_into", + "c_type": "bool", + "comment": "/* it was written as SELECT INTO */" + } + ], + "comment": "/* ----------------------\n *\t\tCREATE TABLE AS Statement (a/k/a SELECT INTO)\n *\n * A query written as CREATE TABLE AS will produce this node type natively.\n * A query written as SELECT ... INTO will be transformed to this form during\n * parse analysis.\n * A query written as CREATE MATERIALIZED view will produce this node type,\n * during parse analysis, since it needs all the same data.\n *\n * The \"query\" field is handled similarly to EXPLAIN, though note that it\n * can be a SELECT or an EXECUTE, but not other DML statements.\n * ----------------------\n */\n" + }, + "RefreshMatViewStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "concurrent", + "c_type": "bool", + "comment": "/* allow concurrent access? */" + }, + { + "name": "skipData", + "c_type": "bool", + "comment": "/* true for WITH NO DATA */" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* relation to insert into */" + } + ], + "comment": "/* ----------------------\n *\t\tREFRESH MATERIALIZED VIEW Statement\n * ----------------------\n */\n" + }, + "CheckPointStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + } + ], + "comment": "/* ----------------------\n * Checkpoint Statement\n * ----------------------\n */\n" + }, + "DiscardStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "target", + "c_type": "DiscardMode", + "comment": null + } + ], + "comment": "/* ----------------------\n * Discard Statement\n * ----------------------\n */\n" + }, + "LockStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "relations", + "c_type": "List*", + "comment": "/* relations to lock */" + }, + { + "name": "mode", + "c_type": "int", + "comment": "/* lock mode */" + }, + { + "name": "nowait", + "c_type": "bool", + "comment": "/* no wait mode */" + } + ], + "comment": "/* ----------------------\n *\t\tLOCK Statement\n * ----------------------\n */\n" + }, + "ConstraintsSetStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "constraints", + "c_type": "List*", + "comment": "/* List of names as RangeVars */" + }, + { + "name": "deferred", + "c_type": "bool", + "comment": null + } + ], + "comment": "/* ----------------------\n *\t\tSET CONSTRAINTS Statement\n * ----------------------\n */\n" + }, + "ReindexStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "kind", + "c_type": "ObjectType", + "comment": "/* OBJECT_INDEX, OBJECT_TABLE, etc. */" + }, + { + "name": "relation", + "c_type": "RangeVar*", + "comment": "/* Table or index to reindex */" + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* name of database to reindex */" + }, + { + "name": "do_system", + "c_type": "bool", + "comment": "/* include system tables in database case */" + }, + { + "name": "do_user", + "c_type": "bool", + "comment": "/* include user tables in database case */" + } + ], + "comment": "/* ----------------------\n *\t\tREINDEX Statement\n * ----------------------\n */\n" + }, + "CreateConversionStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "conversion_name", + "c_type": "List*", + "comment": "/* Name of the conversion */" + }, + { + "name": "for_encoding_name", + "c_type": "char*", + "comment": "/* source encoding name */" + }, + { + "name": "to_encoding_name", + "c_type": "char*", + "comment": "/* destination encoding name */" + }, + { + "name": "func_name", + "c_type": "List*", + "comment": "/* qualified conversion function name */" + }, + { + "name": "def", + "c_type": "bool", + "comment": "/* is this a default conversion? */" + } + ], + "comment": "/* ----------------------\n *\t\tCREATE CONVERSION Statement\n * ----------------------\n */\n" + }, + "CreateCastStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "sourcetype", + "c_type": "TypeName*", + "comment": null + }, + { + "name": "targettype", + "c_type": "TypeName*", + "comment": null + }, + { + "name": "func", + "c_type": "FuncWithArgs*", + "comment": null + }, + { + "name": "context", + "c_type": "CoercionContext", + "comment": null + }, + { + "name": "inout", + "c_type": "bool", + "comment": null + } + ], + "comment": "/* ----------------------\n *\tCREATE CAST Statement\n * ----------------------\n */\n" + }, + "PrepareStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* Name of plan, arbitrary */" + }, + { + "name": "argtypes", + "c_type": "List*", + "comment": "/* Types of parameters (List of TypeName) */" + }, + { + "name": "query", + "c_type": "Node*", + "comment": "/* The query itself (as a raw parsetree) */" + } + ], + "comment": "/* ----------------------\n *\t\tPREPARE Statement\n * ----------------------\n */\n" + }, + "ExecuteStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* The name of the plan to execute */" + }, + { + "name": "params", + "c_type": "List*", + "comment": "/* Values to assign to parameters */" + } + ], + "comment": "/* ----------------------\n *\t\tEXECUTE Statement\n * ----------------------\n */\n" + }, + "DeallocateStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* The name of the plan to remove */" + }, + { + "comment": "\t/* NULL means DEALLOCATE ALL */\n" + } + ], + "comment": "/* ----------------------\n *\t\tDEALLOCATE Statement\n * ----------------------\n */\n" + }, + "DropOwnedStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "roles", + "c_type": "List*", + "comment": null + }, + { + "name": "behavior", + "c_type": "DropBehavior", + "comment": null + } + ], + "comment": "/*\n *\t\tDROP OWNED statement\n */\n" + }, + "ReassignOwnedStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "roles", + "c_type": "List*", + "comment": null + }, + { + "name": "newrole", + "c_type": "char*", + "comment": null + } + ], + "comment": "/*\n *\t\tREASSIGN OWNED statement\n */\n" + }, + "AlterTSDictionaryStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "dictname", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* List of DefElem nodes */" + } + ], + "comment": "/*\n * TS Dictionary stmts: DefineStmt, RenameStmt and DropStmt are default\n */\n" + }, + "AlterTSConfigurationStmt": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "cfgname", + "c_type": "List*", + "comment": "/* qualified name (list of Value strings) */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * dicts will be non-NIL if ADD/ALTER MAPPING was specified. If dicts is\n\t * NIL, but tokentype isn't, DROP MAPPING was specified.\n\t */\n" + }, + { + "name": "tokentype", + "c_type": "List*", + "comment": "/* list of Value strings */" + }, + { + "name": "dicts", + "c_type": "List*", + "comment": "/* list of list of Value strings */" + }, + { + "name": "override", + "c_type": "bool", + "comment": "/* if true - remove old variant */" + }, + { + "name": "replace", + "c_type": "bool", + "comment": "/* if true - replace dictionary by another */" + }, + { + "name": "missing_ok", + "c_type": "bool", + "comment": "/* for DROP - skip error if missing? */" + } + ], + "comment": "/*\n * TS Configuration stmts: DefineStmt, RenameStmt and DropStmt are default\n */\n" + } + }, + "nodes/primnodes": { + "Alias": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "aliasname", + "c_type": "char*", + "comment": "/* aliased rel name (never qualified) */" + }, + { + "name": "colnames", + "c_type": "List*", + "comment": "/* optional list of column aliases */" + } + ], + "comment": "/*\n * Alias -\n *\t specifies an alias for a range variable; the alias might also\n *\t specify renaming of columns within the table.\n *\n * Note: colnames is a list of Value nodes (always strings). In Alias structs\n * associated with RTEs, there may be entries corresponding to dropped\n * columns; these are normally empty strings (\"\"). See parsenodes.h for info.\n */\n" + }, + "RangeVar": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "catalogname", + "c_type": "char*", + "comment": "/* the catalog (database) name, or NULL */" + }, + { + "name": "schemaname", + "c_type": "char*", + "comment": "/* the schema name, or NULL */" + }, + { + "name": "relname", + "c_type": "char*", + "comment": "/* the relation/sequence name */" + }, + { + "name": "inhOpt", + "c_type": "InhOption", + "comment": "/* expand rel by inheritance? recursively act\n\t\t\t\t\t\t\t\t * on children? */\n" + }, + { + "name": "relpersistence", + "c_type": "char", + "comment": "/* see RELPERSISTENCE_* in pg_class.h */" + }, + { + "name": "alias", + "c_type": "Alias*", + "comment": "/* table alias & optional column aliases */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * RangeVar - range variable, used in FROM clauses\n *\n * Also used to represent table names in utility statements; there, the alias\n * field is not used, and inhOpt shows whether to apply the operation\n * recursively to child tables. In some contexts it is also useful to carry\n * a TEMP table indication here.\n */\n" + }, + "IntoClause": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "comment": "" + }, + { + "name": "rel", + "c_type": "RangeVar*", + "comment": "/* target relation name */" + }, + { + "name": "colNames", + "c_type": "List*", + "comment": "/* column names to assign, or NIL */" + }, + { + "name": "options", + "c_type": "List*", + "comment": "/* options from WITH clause */" + }, + { + "name": "onCommit", + "c_type": "OnCommitAction", + "comment": "/* what do we do at COMMIT? */" + }, + { + "name": "tableSpaceName", + "c_type": "char*", + "comment": "/* table space to use, or NULL */" + }, + { + "name": "viewQuery", + "c_type": "Node*", + "comment": "/* materialized view's SELECT query */" + }, + { + "name": "skipData", + "c_type": "bool", + "comment": "/* true for WITH NO DATA */" + } + ], + "comment": "/*\n * IntoClause - target information for SELECT INTO, CREATE TABLE AS, and\n * CREATE MATERIALIZED VIEW\n *\n * For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten\n * SELECT Query for the view; otherwise it's NULL. (Although it's actually\n * Query*, we declare it as Node* to avoid a forward reference.)\n */\n" + }, + "Expr": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + } + ], + "comment": "/*\n * Expr - generic superclass for executable-expression nodes\n *\n * All node types that are used in executable expression trees should derive\n * from Expr (that is, have Expr as their first field). Since Expr only\n * contains NodeTag, this is a formality, but it is an easy form of\n * documentation. See also the ExprState node types in execnodes.h.\n */\n" + }, + "Var": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "varno", + "c_type": "Index", + "comment": "/* index of this var's relation in the range\n\t\t\t\t\t\t\t\t * table, or INNER_VAR/OUTER_VAR/INDEX_VAR */\n" + }, + { + "name": "varattno", + "c_type": "AttrNumber", + "comment": "/* attribute number of this var, or zero for\n\t\t\t\t\t\t\t\t * all */\n" + }, + { + "name": "vartype", + "c_type": "Oid", + "comment": "/* pg_type OID for the type of this var */" + }, + { + "name": "vartypmod", + "c_type": "int32", + "comment": "/* pg_attribute typmod value */" + }, + { + "name": "varcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "varlevelsup", + "c_type": "Index", + "comment": "/* for subquery variables referencing outer\n\t\t\t\t\t\t\t\t * relations; 0 in a normal var, >0 means N\n\t\t\t\t\t\t\t\t * levels up */\n" + }, + { + "name": "varnoold", + "c_type": "Index", + "comment": "/* original value of varno, for debugging */" + }, + { + "name": "varoattno", + "c_type": "AttrNumber", + "comment": "/* original value of varattno */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/* Symbols for the indexes of the special RTE entries in rules */\n" + }, + "Const": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "consttype", + "c_type": "Oid", + "comment": "/* pg_type OID of the constant's datatype */" + }, + { + "name": "consttypmod", + "c_type": "int32", + "comment": "/* typmod value, if any */" + }, + { + "name": "constcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "constlen", + "c_type": "int", + "comment": "/* typlen of the constant's datatype */" + }, + { + "name": "constvalue", + "c_type": "Datum", + "comment": "/* the constant's value */" + }, + { + "name": "constisnull", + "c_type": "bool", + "comment": "/* whether the constant is null (if true,\n\t\t\t\t\t\t\t\t * constvalue is undefined) */\n" + }, + { + "name": "constbyval", + "c_type": "bool", + "comment": "/* whether this datatype is passed by value.\n\t\t\t\t\t\t\t\t * If true, then all the information is stored\n\t\t\t\t\t\t\t\t * in the Datum. If false, then the Datum\n\t\t\t\t\t\t\t\t * contains a pointer to the information. */\n" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * Const\n */\n" + }, + "Param": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "paramkind", + "c_type": "ParamKind", + "comment": "/* kind of parameter. See above */" + }, + { + "name": "paramid", + "c_type": "int", + "comment": "/* numeric ID for parameter */" + }, + { + "name": "paramtype", + "c_type": "Oid", + "comment": "/* pg_type OID of parameter's datatype */" + }, + { + "name": "paramtypmod", + "c_type": "int32", + "comment": "/* typmod value, if known */" + }, + { + "name": "paramcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/* ----------------\n * Param\n *\t\tparamkind - specifies the kind of parameter. The possible values\n *\t\tfor this field are:\n *\n *\t\tPARAM_EXTERN: The parameter value is supplied from outside the plan.\n *\t\t\t\tSuch parameters are numbered from 1 to n.\n *\n *\t\tPARAM_EXEC: The parameter is an internal executor parameter, used\n *\t\t\t\tfor passing values into and out of sub-queries or from\n *\t\t\t\tnestloop joins to their inner scans.\n *\t\t\t\tFor historical reasons, such parameters are numbered from 0.\n *\t\t\t\tThese numbers are independent of PARAM_EXTERN numbers.\n *\n *\t\tPARAM_SUBLINK:\tThe parameter represents an output column of a SubLink\n *\t\t\t\tnode's sub-select. The column number is contained in the\n *\t\t\t\t`paramid' field. (This type of Param is converted to\n *\t\t\t\tPARAM_EXEC during planning.)\n *\n * Note: currently, paramtypmod is valid for PARAM_SUBLINK Params, and for\n * PARAM_EXEC Params generated from them; it is always -1 for PARAM_EXTERN\n * params, since the APIs that supply values for such parameters don't carry\n * any typmod info.\n * ----------------\n */\n" + }, + "Aggref": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "aggfnoid", + "c_type": "Oid", + "comment": "/* pg_proc Oid of the aggregate */" + }, + { + "name": "aggtype", + "c_type": "Oid", + "comment": "/* type Oid of result of the aggregate */" + }, + { + "name": "aggcollid", + "c_type": "Oid", + "comment": "/* OID of collation of result */" + }, + { + "name": "inputcollid", + "c_type": "Oid", + "comment": "/* OID of collation that function should use */" + }, + { + "name": "aggdirectargs", + "c_type": "List*", + "comment": "/* direct arguments, if an ordered-set agg */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* aggregated arguments and sort expressions */" + }, + { + "name": "aggorder", + "c_type": "List*", + "comment": "/* ORDER BY (list of SortGroupClause) */" + }, + { + "name": "aggdistinct", + "c_type": "List*", + "comment": "/* DISTINCT (list of SortGroupClause) */" + }, + { + "name": "aggfilter", + "c_type": "Expr*", + "comment": "/* FILTER expression, if any */" + }, + { + "name": "aggstar", + "c_type": "bool", + "comment": "/* TRUE if argument list was really '*' */" + }, + { + "name": "aggvariadic", + "c_type": "bool", + "comment": "/* true if variadic arguments have been\n\t\t\t\t\t\t\t\t * combined into an array last argument */\n" + }, + { + "name": "aggkind", + "c_type": "char", + "comment": "/* aggregate kind (see pg_aggregate.h) */" + }, + { + "name": "agglevelsup", + "c_type": "Index", + "comment": "/* > 0 if agg belongs to outer query */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * Aggref\n *\n * The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes.\n *\n * For a normal (non-ordered-set) aggregate, the non-resjunk TargetEntries\n * represent the aggregate's regular arguments (if any) and resjunk TLEs can\n * be added at the end to represent ORDER BY expressions that are not also\n * arguments. As in a top-level Query, the TLEs can be marked with\n * ressortgroupref indexes to let them be referenced by SortGroupClause\n * entries in the aggorder and/or aggdistinct lists. This represents ORDER BY\n * and DISTINCT operations to be applied to the aggregate input rows before\n * they are passed to the transition function. The grammar only allows a\n * simple \"DISTINCT\" specifier for the arguments, but we use the full\n * query-level representation to allow more code sharing.\n *\n * For an ordered-set aggregate, the args list represents the WITHIN GROUP\n * (aggregated) arguments, all of which will be listed in the aggorder list.\n * DISTINCT is not supported in this case, so aggdistinct will be NIL.\n * The direct arguments appear in aggdirectargs (as a list of plain\n * expressions, not TargetEntry nodes).\n */\n" + }, + "WindowFunc": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "winfnoid", + "c_type": "Oid", + "comment": "/* pg_proc Oid of the function */" + }, + { + "name": "wintype", + "c_type": "Oid", + "comment": "/* type Oid of result of the window function */" + }, + { + "name": "wincollid", + "c_type": "Oid", + "comment": "/* OID of collation of result */" + }, + { + "name": "inputcollid", + "c_type": "Oid", + "comment": "/* OID of collation that function should use */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* arguments to the window function */" + }, + { + "name": "aggfilter", + "c_type": "Expr*", + "comment": "/* FILTER expression, if any */" + }, + { + "name": "winref", + "c_type": "Index", + "comment": "/* index of associated WindowClause */" + }, + { + "name": "winstar", + "c_type": "bool", + "comment": "/* TRUE if argument list was really '*' */" + }, + { + "name": "winagg", + "c_type": "bool", + "comment": "/* is function a simple aggregate? */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * WindowFunc\n */\n" + }, + "ArrayRef": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "refarraytype", + "c_type": "Oid", + "comment": "/* type of the array proper */" + }, + { + "name": "refelemtype", + "c_type": "Oid", + "comment": "/* type of the array elements */" + }, + { + "name": "reftypmod", + "c_type": "int32", + "comment": "/* typmod of the array (and elements too) */" + }, + { + "name": "refcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "refupperindexpr", + "c_type": "List*", + "comment": "/* expressions that evaluate to upper array\n\t\t\t\t\t\t\t\t * indexes */\n" + }, + { + "name": "reflowerindexpr", + "c_type": "List*", + "comment": "/* expressions that evaluate to lower array\n\t\t\t\t\t\t\t\t * indexes */\n" + }, + { + "name": "refexpr", + "c_type": "Expr*", + "comment": "/* the expression that evaluates to an array\n\t\t\t\t\t\t\t\t * value */\n" + }, + { + "name": "refassgnexpr", + "c_type": "Expr*", + "comment": "/* expression for the source value, or NULL if\n\t\t\t\t\t\t\t\t * fetch */\n" + } + ], + "comment": "/* ----------------\n *\tArrayRef: describes an array subscripting operation\n *\n * An ArrayRef can describe fetching a single element from an array,\n * fetching a subarray (array slice), storing a single element into\n * an array, or storing a slice. The \"store\" cases work with an\n * initial array value and a source value that is inserted into the\n * appropriate part of the array; the result of the operation is an\n * entire new modified array value.\n *\n * If reflowerindexpr = NIL, then we are fetching or storing a single array\n * element at the subscripts given by refupperindexpr. Otherwise we are\n * fetching or storing an array slice, that is a rectangular subarray\n * with lower and upper bounds given by the index expressions.\n * reflowerindexpr must be the same length as refupperindexpr when it\n * is not NIL.\n *\n * Note: the result datatype is the element type when fetching a single\n * element; but it is the array type when doing subarray fetch or either\n * type of store.\n * ----------------\n */\n" + }, + "FuncExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "funcid", + "c_type": "Oid", + "comment": "/* PG_PROC OID of the function */" + }, + { + "name": "funcresulttype", + "c_type": "Oid", + "comment": "/* PG_TYPE OID of result value */" + }, + { + "name": "funcretset", + "c_type": "bool", + "comment": "/* true if function returns set */" + }, + { + "name": "funcvariadic", + "c_type": "bool", + "comment": "/* true if variadic arguments have been\n\t\t\t\t\t\t\t\t * combined into an array last argument */\n" + }, + { + "name": "funcformat", + "c_type": "CoercionForm", + "comment": "/* how to display this function call */" + }, + { + "name": "funccollid", + "c_type": "Oid", + "comment": "/* OID of collation of result */" + }, + { + "name": "inputcollid", + "c_type": "Oid", + "comment": "/* OID of collation that function should use */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* arguments to the function */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * FuncExpr - expression node for a function call\n */\n" + }, + "NamedArgExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* the argument expression */" + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* the name */" + }, + { + "name": "argnumber", + "c_type": "int", + "comment": "/* argument's number in positional notation */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* argument name location, or -1 if unknown */" + } + ], + "comment": "/*\n * NamedArgExpr - a named argument of a function\n *\n * This node type can only appear in the args list of a FuncCall or FuncExpr\n * node. We support pure positional call notation (no named arguments),\n * named notation (all arguments are named), and mixed notation (unnamed\n * arguments followed by named ones).\n *\n * Parse analysis sets argnumber to the positional index of the argument,\n * but doesn't rearrange the argument list.\n *\n * The planner will convert argument lists to pure positional notation\n * during expression preprocessing, so execution never sees a NamedArgExpr.\n */\n" + }, + "OpExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "opno", + "c_type": "Oid", + "comment": "/* PG_OPERATOR OID of the operator */" + }, + { + "name": "opfuncid", + "c_type": "Oid", + "comment": "/* PG_PROC OID of underlying function */" + }, + { + "name": "opresulttype", + "c_type": "Oid", + "comment": "/* PG_TYPE OID of result value */" + }, + { + "name": "opretset", + "c_type": "bool", + "comment": "/* true if operator returns set */" + }, + { + "name": "opcollid", + "c_type": "Oid", + "comment": "/* OID of collation of result */" + }, + { + "name": "inputcollid", + "c_type": "Oid", + "comment": "/* OID of collation that operator should use */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* arguments to the operator (1 or 2) */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * OpExpr - expression node for an operator invocation\n *\n * Semantically, this is essentially the same as a function call.\n *\n * Note that opfuncid is not necessarily filled in immediately on creation\n * of the node. The planner makes sure it is valid before passing the node\n * tree to the executor, but during parsing/planning opfuncid can be 0.\n */\n" + }, + "ScalarArrayOpExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "opno", + "c_type": "Oid", + "comment": "/* PG_OPERATOR OID of the operator */" + }, + { + "name": "opfuncid", + "c_type": "Oid", + "comment": "/* PG_PROC OID of underlying function */" + }, + { + "name": "useOr", + "c_type": "bool", + "comment": "/* true for ANY, false for ALL */" + }, + { + "name": "inputcollid", + "c_type": "Oid", + "comment": "/* OID of collation that operator should use */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* the scalar and array operands */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * ScalarArrayOpExpr - expression node for \"scalar op ANY/ALL (array)\"\n *\n * The operator must yield boolean. It is applied to the left operand\n * and each element of the righthand array, and the results are combined\n * with OR or AND (for ANY or ALL respectively). The node representation\n * is almost the same as for the underlying operator, but we need a useOr\n * flag to remember whether it's ANY or ALL, and we don't have to store\n * the result type (or the collation) because it must be boolean.\n */\n" + }, + "BoolExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "boolop", + "c_type": "BoolExprType", + "comment": null + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* arguments to this expression */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": null + }, + "SubLink": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "subLinkType", + "c_type": "SubLinkType", + "comment": "/* see above */" + }, + { + "name": "testexpr", + "c_type": "Node*", + "comment": "/* outer-query test for ALL/ANY/ROWCOMPARE */" + }, + { + "name": "operName", + "c_type": "List*", + "comment": "/* originally specified operator name */" + }, + { + "name": "subselect", + "c_type": "Node*", + "comment": "/* subselect as Query* or parsetree */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * SubLink\n *\n * A SubLink represents a subselect appearing in an expression, and in some\n * cases also the combining operator(s) just above it. The subLinkType\n * indicates the form of the expression represented:\n *\tEXISTS_SUBLINK\t\tEXISTS(SELECT ...)\n *\tALL_SUBLINK\t\t\t(lefthand) op ALL (SELECT ...)\n *\tANY_SUBLINK\t\t\t(lefthand) op ANY (SELECT ...)\n *\tROWCOMPARE_SUBLINK\t(lefthand) op (SELECT ...)\n *\tEXPR_SUBLINK\t\t(SELECT with single targetlist item ...)\n *\tARRAY_SUBLINK\t\tARRAY(SELECT with single targetlist item ...)\n *\tCTE_SUBLINK\t\t\tWITH query (never actually part of an expression)\n * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the\n * same length as the subselect's targetlist. ROWCOMPARE will *always* have\n * a list with more than one entry; if the subselect has just one target\n * then the parser will create an EXPR_SUBLINK instead (and any operator\n * above the subselect will be represented separately). Note that both\n * ROWCOMPARE and EXPR require the subselect to deliver only one row.\n * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean\n * results. ALL and ANY combine the per-row results using AND and OR\n * semantics respectively.\n * ARRAY requires just one target column, and creates an array of the target\n * column's type using any number of rows resulting from the subselect.\n *\n * SubLink is classed as an Expr node, but it is not actually executable;\n * it must be replaced in the expression tree by a SubPlan node during\n * planning.\n *\n * NOTE: in the raw output of gram.y, testexpr contains just the raw form\n * of the lefthand expression (if any), and operName is the String name of\n * the combining operator. Also, subselect is a raw parsetree. During parse\n * analysis, the parser transforms testexpr into a complete boolean expression\n * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the\n * output columns of the subselect. And subselect is transformed to a Query.\n * This is the representation seen in saved rules and in the rewriter.\n *\n * In EXISTS, EXPR, and ARRAY SubLinks, testexpr and operName are unused and\n * are always null.\n *\n * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used\n * in SubPlans generated for WITH subqueries.\n */\n" + }, + "SubPlan": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "comment": "\t/* Fields copied from original SubLink: */\n" + }, + { + "name": "subLinkType", + "c_type": "SubLinkType", + "comment": "/* see above */" + }, + { + "comment": "\t/* The combining operators, transformed to an executable expression: */\n" + }, + { + "name": "testexpr", + "c_type": "Node*", + "comment": "/* OpExpr or RowCompareExpr expression tree */" + }, + { + "name": "paramIds", + "c_type": "List*", + "comment": "/* IDs of Params embedded in the above */" + }, + { + "comment": "\t/* Identification of the Plan tree to use: */\n" + }, + { + "name": "plan_id", + "c_type": "int", + "comment": "/* Index (from 1) in PlannedStmt.subplans */" + }, + { + "comment": "\t/* Identification of the SubPlan for EXPLAIN and debugging purposes: */\n" + }, + { + "name": "plan_name", + "c_type": "char*", + "comment": "/* A name assigned during planning */" + }, + { + "comment": "\t/* Extra data useful for determining subplan's output type: */\n" + }, + { + "name": "firstColType", + "c_type": "Oid", + "comment": "/* Type of first column of subplan result */" + }, + { + "name": "firstColTypmod", + "c_type": "int32", + "comment": "/* Typmod of first column of subplan result */" + }, + { + "name": "firstColCollation", + "c_type": "Oid", + "comment": "/* Collation of first column of\n\t\t\t\t\t\t\t\t\t\t * subplan result */\n" + }, + { + "comment": "\t/* Information about execution strategy: */\n" + }, + { + "name": "useHashTable", + "c_type": "bool", + "comment": "/* TRUE to store subselect output in a hash\n\t\t\t\t\t\t\t\t * table (implies we are doing \"IN\") */\n" + }, + { + "name": "unknownEqFalse", + "c_type": "bool", + "comment": "/* TRUE if it's okay to return FALSE when the\n\t\t\t\t\t\t\t\t * spec result is UNKNOWN; this allows much\n\t\t\t\t\t\t\t\t * simpler handling of null values */\n" + }, + { + "comment": "\t/* Information for passing params into and out of the subselect: */\n" + }, + { + "comment": "\t/* setParam and parParam are lists of integers (param IDs) */\n" + }, + { + "name": "setParam", + "c_type": "List*", + "comment": "/* initplan subqueries have to set these\n\t\t\t\t\t\t\t\t * Params for parent plan */\n" + }, + { + "name": "parParam", + "c_type": "List*", + "comment": "/* indices of input Params from parent plan */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* exprs to pass as parParam values */" + }, + { + "comment": "\t/* Estimated execution costs: */\n" + }, + { + "name": "startup_cost", + "c_type": "Cost", + "comment": "/* one-time setup cost */" + }, + { + "name": "per_call_cost", + "c_type": "Cost", + "comment": "/* cost for each subplan evaluation */" + } + ], + "comment": "/*\n * SubPlan - executable expression node for a subplan (sub-SELECT)\n *\n * The planner replaces SubLink nodes in expression trees with SubPlan\n * nodes after it has finished planning the subquery. SubPlan references\n * a sub-plantree stored in the subplans list of the toplevel PlannedStmt.\n * (We avoid a direct link to make it easier to copy expression trees\n * without causing multiple processing of the subplan.)\n *\n * In an ordinary subplan, testexpr points to an executable expression\n * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining\n * operator(s); the left-hand arguments are the original lefthand expressions,\n * and the right-hand arguments are PARAM_EXEC Param nodes representing the\n * outputs of the sub-select. (NOTE: runtime coercion functions may be\n * inserted as well.) This is just the same expression tree as testexpr in\n * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by\n * suitably numbered PARAM_EXEC nodes.\n *\n * If the sub-select becomes an initplan rather than a subplan, the executable\n * expression is part of the outer plan's expression tree (and the SubPlan\n * node itself is not, but rather is found in the outer plan's initPlan\n * list). In this case testexpr is NULL to avoid duplication.\n *\n * The planner also derives lists of the values that need to be passed into\n * and out of the subplan. Input values are represented as a list \"args\" of\n * expressions to be evaluated in the outer-query context (currently these\n * args are always just Vars, but in principle they could be any expression).\n * The values are assigned to the global PARAM_EXEC params indexed by parParam\n * (the parParam and args lists must have the same ordering). setParam is a\n * list of the PARAM_EXEC params that are computed by the sub-select, if it\n * is an initplan; they are listed in order by sub-select output column\n * position. (parParam and setParam are integer Lists, not Bitmapsets,\n * because their ordering is significant.)\n *\n * Also, the planner computes startup and per-call costs for use of the\n * SubPlan. Note that these include the cost of the subquery proper,\n * evaluation of the testexpr if any, and any hashtable management overhead.\n */\n" + }, + "AlternativeSubPlan": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "subplans", + "c_type": "List*", + "comment": "/* SubPlan(s) with equivalent results */" + } + ], + "comment": "/*\n * AlternativeSubPlan - expression node for a choice among SubPlans\n *\n * The subplans are given as a List so that the node definition need not\n * change if there's ever more than two alternatives. For the moment,\n * though, there are always exactly two; and the first one is the fast-start\n * plan.\n */\n" + }, + "FieldSelect": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "fieldnum", + "c_type": "AttrNumber", + "comment": "/* attribute number of field to extract */" + }, + { + "name": "resulttype", + "c_type": "Oid", + "comment": "/* type of the field (result type of this\n\t\t\t\t\t\t\t\t * node) */\n" + }, + { + "name": "resulttypmod", + "c_type": "int32", + "comment": "/* output typmod (usually -1) */" + }, + { + "name": "resultcollid", + "c_type": "Oid", + "comment": "/* OID of collation of the field */" + } + ], + "comment": "/* ----------------\n * FieldSelect\n *\n * FieldSelect represents the operation of extracting one field from a tuple\n * value. At runtime, the input expression is expected to yield a rowtype\n * Datum. The specified field number is extracted and returned as a Datum.\n * ----------------\n */\n" + }, + "FieldStore": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input tuple value */" + }, + { + "name": "newvals", + "c_type": "List*", + "comment": "/* new value(s) for field(s) */" + }, + { + "name": "fieldnums", + "c_type": "List*", + "comment": "/* integer list of field attnums */" + }, + { + "name": "resulttype", + "c_type": "Oid", + "comment": "/* type of result (same as type of arg) */" + }, + { + "comment": "\t/* Like RowExpr, we deliberately omit a typmod and collation here */\n" + } + ], + "comment": "/* ----------------\n * FieldStore\n *\n * FieldStore represents the operation of modifying one field in a tuple\n * value, yielding a new tuple value (the input is not touched!). Like\n * the assign case of ArrayRef, this is used to implement UPDATE of a\n * portion of a column.\n *\n * A single FieldStore can actually represent updates of several different\n * fields. The parser only generates FieldStores with single-element lists,\n * but the planner will collapse multiple updates of the same base column\n * into one FieldStore.\n * ----------------\n */\n" + }, + "RelabelType": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "resulttype", + "c_type": "Oid", + "comment": "/* output type of coercion expression */" + }, + { + "name": "resulttypmod", + "c_type": "int32", + "comment": "/* output typmod (usually -1) */" + }, + { + "name": "resultcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "relabelformat", + "c_type": "CoercionForm", + "comment": "/* how to display this node */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/* ----------------\n * RelabelType\n *\n * RelabelType represents a \"dummy\" type coercion between two binary-\n * compatible datatypes, such as reinterpreting the result of an OID\n * expression as an int4. It is a no-op at runtime; we only need it\n * to provide a place to store the correct type to be attributed to\n * the expression result during type resolution. (We can't get away\n * with just overwriting the type field of the input expression node,\n * so we need a separate node to show the coercion's result type.)\n * ----------------\n */\n" + }, + "CoerceViaIO": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "resulttype", + "c_type": "Oid", + "comment": "/* output type of coercion */" + }, + { + "comment": "\t/* output typmod is not stored, but is presumed -1 */\n" + }, + { + "name": "resultcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "coerceformat", + "c_type": "CoercionForm", + "comment": "/* how to display this node */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/* ----------------\n * CoerceViaIO\n *\n * CoerceViaIO represents a type coercion between two types whose textual\n * representations are compatible, implemented by invoking the source type's\n * typoutput function then the destination type's typinput function.\n * ----------------\n */\n" + }, + "ArrayCoerceExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression (yields an array) */" + }, + { + "name": "elemfuncid", + "c_type": "Oid", + "comment": "/* OID of element coercion function, or 0 */" + }, + { + "name": "resulttype", + "c_type": "Oid", + "comment": "/* output type of coercion (an array type) */" + }, + { + "name": "resulttypmod", + "c_type": "int32", + "comment": "/* output typmod (also element typmod) */" + }, + { + "name": "resultcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "isExplicit", + "c_type": "bool", + "comment": "/* conversion semantics flag to pass to func */" + }, + { + "name": "coerceformat", + "c_type": "CoercionForm", + "comment": "/* how to display this node */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/* ----------------\n * ArrayCoerceExpr\n *\n * ArrayCoerceExpr represents a type coercion from one array type to another,\n * which is implemented by applying the indicated element-type coercion\n * function to each element of the source array. If elemfuncid is InvalidOid\n * then the element types are binary-compatible, but the coercion still\n * requires some effort (we have to fix the element type ID stored in the\n * array header).\n * ----------------\n */\n" + }, + "ConvertRowtypeExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "resulttype", + "c_type": "Oid", + "comment": "/* output type (always a composite type) */" + }, + { + "comment": "\t/* Like RowExpr, we deliberately omit a typmod and collation here */\n" + }, + { + "name": "convertformat", + "c_type": "CoercionForm", + "comment": "/* how to display this node */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/* ----------------\n * ConvertRowtypeExpr\n *\n * ConvertRowtypeExpr represents a type coercion from one composite type\n * to another, where the source type is guaranteed to contain all the columns\n * needed for the destination type plus possibly others; the columns need not\n * be in the same positions, but are matched up by name. This is primarily\n * used to convert a whole-row value of an inheritance child table into a\n * valid whole-row value of its parent table's rowtype.\n * ----------------\n */\n" + }, + "CollateExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "collOid", + "c_type": "Oid", + "comment": "/* collation's OID */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*----------\n * CollateExpr - COLLATE\n *\n * The planner replaces CollateExpr with RelabelType during expression\n * preprocessing, so execution never sees a CollateExpr.\n *----------\n */\n" + }, + "CaseExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "casetype", + "c_type": "Oid", + "comment": "/* type of expression result */" + }, + { + "name": "casecollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* implicit equality comparison argument */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* the arguments (list of WHEN clauses) */" + }, + { + "name": "defresult", + "c_type": "Expr*", + "comment": "/* the default result (ELSE clause) */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*----------\n * CaseExpr - a CASE expression\n *\n * We support two distinct forms of CASE expression:\n *\t\tCASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ]\n *\t\tCASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ]\n * These are distinguishable by the \"arg\" field being NULL in the first case\n * and the testexpr in the second case.\n *\n * In the raw grammar output for the second form, the condition expressions\n * of the WHEN clauses are just the comparison values. Parse analysis\n * converts these to valid boolean expressions of the form\n *\t\tCaseTestExpr '=' compexpr\n * where the CaseTestExpr node is a placeholder that emits the correct\n * value at runtime. This structure is used so that the testexpr need be\n * evaluated only once. Note that after parse analysis, the condition\n * expressions always yield boolean.\n *\n * Note: we can test whether a CaseExpr has been through parse analysis\n * yet by checking whether casetype is InvalidOid or not.\n *----------\n */\n" + }, + "CaseWhen": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "expr", + "c_type": "Expr*", + "comment": "/* condition expression */" + }, + { + "name": "result", + "c_type": "Expr*", + "comment": "/* substitution result */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * CaseWhen - one arm of a CASE expression\n */\n" + }, + "CaseTestExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "typeId", + "c_type": "Oid", + "comment": "/* type for substituted value */" + }, + { + "name": "typeMod", + "c_type": "int32", + "comment": "/* typemod for substituted value */" + }, + { + "name": "collation", + "c_type": "Oid", + "comment": "/* collation for the substituted value */" + } + ], + "comment": "/*\n * Placeholder node for the test value to be processed by a CASE expression.\n * This is effectively like a Param, but can be implemented more simply\n * since we need only one replacement value at a time.\n *\n * We also use this in nested UPDATE expressions.\n * See transformAssignmentIndirection().\n */\n" + }, + "ArrayExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "array_typeid", + "c_type": "Oid", + "comment": "/* type of expression result */" + }, + { + "name": "array_collid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "element_typeid", + "c_type": "Oid", + "comment": "/* common type of array elements */" + }, + { + "name": "elements", + "c_type": "List*", + "comment": "/* the array elements or sub-arrays */" + }, + { + "name": "multidims", + "c_type": "bool", + "comment": "/* true if elements are sub-arrays */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * ArrayExpr - an ARRAY[] expression\n *\n * Note: if multidims is false, the constituent expressions all yield the\n * scalar type identified by element_typeid. If multidims is true, the\n * constituent expressions all yield arrays of element_typeid (ie, the same\n * type as array_typeid); at runtime we must check for compatible subscripts.\n */\n" + }, + "RowExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* the fields */" + }, + { + "name": "row_typeid", + "c_type": "Oid", + "comment": "/* RECORDOID or a composite type's ID */" + }, + { + "comment": "" + }, + { + "comment": "\t/*\n\t * Note: we deliberately do NOT store a typmod. Although a typmod will be\n\t * associated with specific RECORD types at runtime, it will differ for\n\t * different backends, and so cannot safely be stored in stored\n\t * parsetrees. We must assume typmod -1 for a RowExpr node.\n\t *\n\t * We don't need to store a collation either. The result type is\n\t * necessarily composite, and composite types never have a collation.\n\t */\n" + }, + { + "name": "row_format", + "c_type": "CoercionForm", + "comment": "/* how to display this node */" + }, + { + "name": "colnames", + "c_type": "List*", + "comment": "/* list of String, or NIL */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * RowExpr - a ROW() expression\n *\n * Note: the list of fields must have a one-for-one correspondence with\n * physical fields of the associated rowtype, although it is okay for it\n * to be shorter than the rowtype. That is, the N'th list element must\n * match up with the N'th physical field. When the N'th physical field\n * is a dropped column (attisdropped) then the N'th list element can just\n * be a NULL constant. (This case can only occur for named composite types,\n * not RECORD types, since those are built from the RowExpr itself rather\n * than vice versa.) It is important not to assume that length(args) is\n * the same as the number of columns logically present in the rowtype.\n *\n * colnames provides field names in cases where the names can't easily be\n * obtained otherwise. Names *must* be provided if row_typeid is RECORDOID.\n * If row_typeid identifies a known composite type, colnames can be NIL to\n * indicate the type's cataloged field names apply. Note that colnames can\n * be non-NIL even for a composite type, and typically is when the RowExpr\n * was created by expanding a whole-row Var. This is so that we can retain\n * the column alias names of the RTE that the Var referenced (which would\n * otherwise be very difficult to extract from the parsetree). Like the\n * args list, colnames is one-for-one with physical fields of the rowtype.\n */\n" + }, + "RowCompareExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "rctype", + "c_type": "RowCompareType", + "comment": "/* LT LE GE or GT, never EQ or NE */" + }, + { + "name": "opnos", + "c_type": "List*", + "comment": "/* OID list of pairwise comparison ops */" + }, + { + "name": "opfamilies", + "c_type": "List*", + "comment": "/* OID list of containing operator families */" + }, + { + "name": "inputcollids", + "c_type": "List*", + "comment": "/* OID list of collations for comparisons */" + }, + { + "name": "largs", + "c_type": "List*", + "comment": "/* the left-hand input arguments */" + }, + { + "name": "rargs", + "c_type": "List*", + "comment": "/* the right-hand input arguments */" + } + ], + "comment": "/*\n * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2)\n *\n * We support row comparison for any operator that can be determined to\n * act like =, <>, <, <=, >, or >= (we determine this by looking for the\n * operator in btree opfamilies). Note that the same operator name might\n * map to a different operator for each pair of row elements, since the\n * element datatypes can vary.\n *\n * A RowCompareExpr node is only generated for the < <= > >= cases;\n * the = and <> cases are translated to simple AND or OR combinations\n * of the pairwise comparisons. However, we include = and <> in the\n * RowCompareType enum for the convenience of parser logic.\n */\n" + }, + "CoalesceExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "coalescetype", + "c_type": "Oid", + "comment": "/* type of expression result */" + }, + { + "name": "coalescecollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* the arguments */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * CoalesceExpr - a COALESCE expression\n */\n" + }, + "MinMaxExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "minmaxtype", + "c_type": "Oid", + "comment": "/* common type of arguments and result */" + }, + { + "name": "minmaxcollid", + "c_type": "Oid", + "comment": "/* OID of collation of result */" + }, + { + "name": "inputcollid", + "c_type": "Oid", + "comment": "/* OID of collation that function should use */" + }, + { + "name": "op", + "c_type": "MinMaxOp", + "comment": "/* function to execute */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* the arguments */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * MinMaxExpr - a GREATEST or LEAST function\n */\n" + }, + "XmlExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "op", + "c_type": "XmlExprOp", + "comment": "/* xml function ID */" + }, + { + "name": "name", + "c_type": "char*", + "comment": "/* name in xml(NAME foo ...) syntaxes */" + }, + { + "name": "named_args", + "c_type": "List*", + "comment": "/* non-XML expressions for xml_attributes */" + }, + { + "name": "arg_names", + "c_type": "List*", + "comment": "/* parallel list of Value strings */" + }, + { + "name": "args", + "c_type": "List*", + "comment": "/* list of expressions */" + }, + { + "name": "xmloption", + "c_type": "XmlOptionType", + "comment": "/* DOCUMENT or CONTENT */" + }, + { + "name": "type", + "c_type": "Oid", + "comment": "/* target type/typmod for XMLSERIALIZE */" + }, + { + "name": "typmod", + "c_type": "int32", + "comment": null + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": null + }, + "NullTest": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "nulltesttype", + "c_type": "NullTestType", + "comment": "/* IS NULL, IS NOT NULL */" + }, + { + "name": "argisrow", + "c_type": "bool", + "comment": "/* T if input is of a composite type */" + } + ], + "comment": "/* ----------------\n * NullTest\n *\n * NullTest represents the operation of testing a value for NULLness.\n * The appropriate test is performed and returned as a boolean Datum.\n *\n * NOTE: the semantics of this for rowtype inputs are noticeably different\n * from the scalar case. We provide an \"argisrow\" flag to reflect that.\n * ----------------\n */\n" + }, + "BooleanTest": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "booltesttype", + "c_type": "BoolTestType", + "comment": "/* test type */" + } + ], + "comment": "/*\n * BooleanTest\n *\n * BooleanTest represents the operation of determining whether a boolean\n * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations\n * are supported. Note that a NULL input does *not* cause a NULL result.\n * The appropriate test is performed and returned as a boolean Datum.\n */\n" + }, + "CoerceToDomain": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "arg", + "c_type": "Expr*", + "comment": "/* input expression */" + }, + { + "name": "resulttype", + "c_type": "Oid", + "comment": "/* domain type ID (result type) */" + }, + { + "name": "resulttypmod", + "c_type": "int32", + "comment": "/* output typmod (currently always -1) */" + }, + { + "name": "resultcollid", + "c_type": "Oid", + "comment": "/* OID of collation, or InvalidOid if none */" + }, + { + "name": "coercionformat", + "c_type": "CoercionForm", + "comment": "/* how to display this node */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * CoerceToDomain\n *\n * CoerceToDomain represents the operation of coercing a value to a domain\n * type. At runtime (and not before) the precise set of constraints to be\n * checked will be determined. If the value passes, it is returned as the\n * result; if not, an error is raised. Note that this is equivalent to\n * RelabelType in the scenario where no constraints are applied.\n */\n" + }, + "CoerceToDomainValue": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "typeId", + "c_type": "Oid", + "comment": "/* type for substituted value */" + }, + { + "name": "typeMod", + "c_type": "int32", + "comment": "/* typemod for substituted value */" + }, + { + "name": "collation", + "c_type": "Oid", + "comment": "/* collation for the substituted value */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * Placeholder node for the value to be processed by a domain's check\n * constraint. This is effectively like a Param, but can be implemented more\n * simply since we need only one replacement value at a time.\n *\n * Note: the typeId/typeMod/collation will be set from the domain's base type,\n * not the domain itself. This is because we shouldn't consider the value\n * to be a member of the domain if we haven't yet checked its constraints.\n */\n" + }, + "SetToDefault": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "typeId", + "c_type": "Oid", + "comment": "/* type for substituted value */" + }, + { + "name": "typeMod", + "c_type": "int32", + "comment": "/* typemod for substituted value */" + }, + { + "name": "collation", + "c_type": "Oid", + "comment": "/* collation for the substituted value */" + }, + { + "name": "location", + "c_type": "int", + "comment": "/* token location, or -1 if unknown */" + } + ], + "comment": "/*\n * Placeholder node for a DEFAULT marker in an INSERT or UPDATE command.\n *\n * This is not an executable expression: it must be replaced by the actual\n * column default expression during rewriting. But it is convenient to\n * treat it as an expression node during parsing and rewriting.\n */\n" + }, + "CurrentOfExpr": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "cvarno", + "c_type": "Index", + "comment": "/* RT index of target relation */" + }, + { + "name": "cursor_name", + "c_type": "char*", + "comment": "/* name of referenced cursor, or NULL */" + }, + { + "name": "cursor_param", + "c_type": "int", + "comment": "/* refcursor parameter number, or 0 */" + } + ], + "comment": "/*\n * Node representing [WHERE] CURRENT OF cursor_name\n *\n * CURRENT OF is a bit like a Var, in that it carries the rangetable index\n * of the target relation being constrained; this aids placing the expression\n * correctly during planning. We can assume however that its \"levelsup\" is\n * always zero, due to the syntactic constraints on where it can appear.\n *\n * The referenced cursor can be represented either as a hardwired string\n * or as a reference to a run-time parameter of type REFCURSOR. The latter\n * case is for the convenience of plpgsql.\n */\n" + }, + "TargetEntry": { + "fields": [ + { + "name": "xpr", + "c_type": "Expr", + "comment": null + }, + { + "name": "expr", + "c_type": "Expr*", + "comment": "/* expression to evaluate */" + }, + { + "name": "resno", + "c_type": "AttrNumber", + "comment": "/* attribute number (see notes above) */" + }, + { + "name": "resname", + "c_type": "char*", + "comment": "/* name of the column (could be NULL) */" + }, + { + "name": "ressortgroupref", + "c_type": "Index", + "comment": "/* nonzero if referenced by a sort/group\n\t\t\t\t\t\t\t\t * clause */\n" + }, + { + "name": "resorigtbl", + "c_type": "Oid", + "comment": "/* OID of column's source table */" + }, + { + "name": "resorigcol", + "c_type": "AttrNumber", + "comment": "/* column's number in source table */" + }, + { + "name": "resjunk", + "c_type": "bool", + "comment": "/* set to true to eliminate the attribute from\n\t\t\t\t\t\t\t\t * final target list */\n" + } + ], + "comment": "/*--------------------\n * TargetEntry -\n *\t a target entry (used in query target lists)\n *\n * Strictly speaking, a TargetEntry isn't an expression node (since it can't\n * be evaluated by ExecEvalExpr). But we treat it as one anyway, since in\n * very many places it's convenient to process a whole query targetlist as a\n * single expression tree.\n *\n * In a SELECT's targetlist, resno should always be equal to the item's\n * ordinal position (counting from 1). However, in an INSERT or UPDATE\n * targetlist, resno represents the attribute number of the destination\n * column for the item; so there may be missing or out-of-order resnos.\n * It is even legal to have duplicated resnos; consider\n *\t\tUPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ...\n * The two meanings come together in the executor, because the planner\n * transforms INSERT/UPDATE tlists into a normalized form with exactly\n * one entry for each column of the destination table. Before that's\n * happened, however, it is risky to assume that resno == position.\n * Generally get_tle_by_resno() should be used rather than list_nth()\n * to fetch tlist entries by resno, and only in SELECT should you assume\n * that resno is a unique identifier.\n *\n * resname is required to represent the correct column name in non-resjunk\n * entries of top-level SELECT targetlists, since it will be used as the\n * column title sent to the frontend. In most other contexts it is only\n * a debugging aid, and may be wrong or even NULL. (In particular, it may\n * be wrong in a tlist from a stored rule, if the referenced column has been\n * renamed by ALTER TABLE since the rule was made. Also, the planner tends\n * to store NULL rather than look up a valid name for tlist entries in\n * non-toplevel plan nodes.) In resjunk entries, resname should be either\n * a specific system-generated name (such as \"ctid\") or NULL; anything else\n * risks confusing ExecGetJunkAttribute!\n *\n * ressortgroupref is used in the representation of ORDER BY, GROUP BY, and\n * DISTINCT items. Targetlist entries with ressortgroupref=0 are not\n * sort/group items. If ressortgroupref>0, then this item is an ORDER BY,\n * GROUP BY, and/or DISTINCT target value. No two entries in a targetlist\n * may have the same nonzero ressortgroupref --- but there is no particular\n * meaning to the nonzero values, except as tags. (For example, one must\n * not assume that lower ressortgroupref means a more significant sort key.)\n * The order of the associated SortGroupClause lists determine the semantics.\n *\n * resorigtbl/resorigcol identify the source of the column, if it is a\n * simple reference to a column of a base table (or view). If it is not\n * a simple reference, these fields are zeroes.\n *\n * If resjunk is true then the column is a working column (such as a sort key)\n * that should be removed from the final output of the query. Resjunk columns\n * must have resnos that cannot duplicate any regular column's resno. Also\n * note that there are places that assume resjunk columns come after non-junk\n * columns.\n *--------------------\n */\n" + }, + "RangeTblRef": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "rtindex", + "c_type": "int", + "comment": null + } + ], + "comment": "/*\n * RangeTblRef - reference to an entry in the query's rangetable\n *\n * We could use direct pointers to the RT entries and skip having these\n * nodes, but multiple pointers to the same node in a querytree cause\n * lots of headaches, so it seems better to store an index into the RT.\n */\n" + }, + "JoinExpr": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "jointype", + "c_type": "JoinType", + "comment": "/* type of join */" + }, + { + "name": "isNatural", + "c_type": "bool", + "comment": "/* Natural join? Will need to shape table */" + }, + { + "name": "larg", + "c_type": "Node*", + "comment": "/* left subtree */" + }, + { + "name": "rarg", + "c_type": "Node*", + "comment": "/* right subtree */" + }, + { + "name": "usingClause", + "c_type": "List*", + "comment": "/* USING clause, if any (list of String) */" + }, + { + "name": "quals", + "c_type": "Node*", + "comment": "/* qualifiers on join, if any */" + }, + { + "name": "alias", + "c_type": "Alias*", + "comment": "/* user-written alias clause, if any */" + }, + { + "name": "rtindex", + "c_type": "int", + "comment": "/* RT index assigned for join, or 0 */" + } + ], + "comment": "/*----------\n * JoinExpr - for SQL JOIN expressions\n *\n * isNatural, usingClause, and quals are interdependent. The user can write\n * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).\n * If he writes NATURAL then parse analysis generates the equivalent USING()\n * list, and from that fills in \"quals\" with the right equality comparisons.\n * If he writes USING() then \"quals\" is filled with equality comparisons.\n * If he writes ON() then only \"quals\" is set. Note that NATURAL/USING\n * are not equivalent to ON() since they also affect the output column list.\n *\n * alias is an Alias node representing the AS alias-clause attached to the\n * join expression, or NULL if no clause. NB: presence or absence of the\n * alias has a critical impact on semantics, because a join with an alias\n * restricts visibility of the tables/columns inside it.\n *\n * During parse analysis, an RTE is created for the Join, and its index\n * is filled into rtindex. This RTE is present mainly so that Vars can\n * be created that refer to the outputs of the join. The planner sometimes\n * generates JoinExprs internally; these can have rtindex = 0 if there are\n * no join alias variables referencing such joins.\n *----------\n */\n" + }, + "FromExpr": { + "fields": [ + { + "name": "type", + "c_type": "NodeTag", + "comment": null + }, + { + "name": "fromlist", + "c_type": "List*", + "comment": "/* List of join subtrees */" + }, + { + "name": "quals", + "c_type": "Node*", + "comment": "/* qualifiers on join, if any */" + } + ], + "comment": "/*----------\n * FromExpr - represents a FROM ... WHERE ... construct\n *\n * This is both more flexible than a JoinExpr (it can have any number of\n * children, including zero) and less so --- we don't need to deal with\n * aliases and so on. The output column set is implicitly just the union\n * of the outputs of the children.\n *----------\n */\n" + } + }, + "nodes/nodes": { + }, + "nodes/params": { + "ParamExternData": { + "fields": [ + { + "name": "value", + "c_type": "Datum", + "comment": "/* parameter value */" + }, + { + "name": "isnull", + "c_type": "bool", + "comment": "/* is it NULL? */" + }, + { + "name": "pflags", + "c_type": "uint16", + "comment": "/* flag bits, see above */" + }, + { + "name": "ptype", + "c_type": "Oid", + "comment": "/* parameter's datatype, or 0 */" + } + ], + "comment": "/* ----------------\n *\t ParamListInfo\n *\n *\t ParamListInfo arrays are used to pass parameters into the executor\n *\t for parameterized plans. Each entry in the array defines the value\n *\t to be substituted for a PARAM_EXTERN parameter. The \"paramid\"\n *\t of a PARAM_EXTERN Param can range from 1 to numParams.\n *\n *\t Although parameter numbers are normally consecutive, we allow\n *\t ptype == InvalidOid to signal an unused array entry.\n *\n *\t pflags is a flags field. Currently the only used bit is:\n *\t PARAM_FLAG_CONST signals the planner that it may treat this parameter\n *\t as a constant (i.e., generate a plan that works only for this value\n *\t of the parameter).\n *\n *\t There are two hook functions that can be associated with a ParamListInfo\n *\t array to support dynamic parameter handling. First, if paramFetch\n *\t isn't null and the executor requires a value for an invalid parameter\n *\t (one with ptype == InvalidOid), the paramFetch hook is called to give\n *\t it a chance to fill in the parameter value. Second, a parserSetup\n *\t hook can be supplied to re-instantiate the original parsing hooks if\n *\t a query needs to be re-parsed/planned (as a substitute for supposing\n *\t that the current ptype values represent a fixed set of parameter types).\n\n *\t Although the data structure is really an array, not a list, we keep\n *\t the old typedef name to avoid unnecessary code changes.\n * ----------------\n */\n" + }, + "ParamListInfoData": { + "fields": [ + { + "name": "paramFetch", + "c_type": "ParamFetchHook", + "comment": "/* parameter fetch hook */" + }, + { + "name": "paramFetchArg", + "c_type": "void*", + "comment": null + }, + { + "name": "parserSetup", + "c_type": "ParserSetupHook", + "comment": "/* parser setup hook */" + }, + { + "name": "parserSetupArg", + "c_type": "void*", + "comment": null + }, + { + "name": "numParams", + "c_type": "int", + "comment": "/* number of ParamExternDatas following */" + }, + { + "comment": "" + } + ], + "comment": "/* ----------------\n *\t ParamListInfo\n *\n *\t ParamListInfo arrays are used to pass parameters into the executor\n *\t for parameterized plans. Each entry in the array defines the value\n *\t to be substituted for a PARAM_EXTERN parameter. The \"paramid\"\n *\t of a PARAM_EXTERN Param can range from 1 to numParams.\n *\n *\t Although parameter numbers are normally consecutive, we allow\n *\t ptype == InvalidOid to signal an unused array entry.\n *\n *\t pflags is a flags field. Currently the only used bit is:\n *\t PARAM_FLAG_CONST signals the planner that it may treat this parameter\n *\t as a constant (i.e., generate a plan that works only for this value\n *\t of the parameter).\n *\n *\t There are two hook functions that can be associated with a ParamListInfo\n *\t array to support dynamic parameter handling. First, if paramFetch\n *\t isn't null and the executor requires a value for an invalid parameter\n *\t (one with ptype == InvalidOid), the paramFetch hook is called to give\n *\t it a chance to fill in the parameter value. Second, a parserSetup\n *\t hook can be supplied to re-instantiate the original parsing hooks if\n *\t a query needs to be re-parsed/planned (as a substitute for supposing\n *\t that the current ptype values represent a fixed set of parameter types).\n\n *\t Although the data structure is really an array, not a list, we keep\n *\t the old typedef name to avoid unnecessary code changes.\n * ----------------\n */\n" + }, + "ParamExecData": { + "fields": [ + { + "name": "execPlan", + "c_type": "void*", + "comment": "/* should be \"SubPlanState *\" */" + }, + { + "name": "value", + "c_type": "Datum", + "comment": null + }, + { + "name": "isnull", + "c_type": "bool", + "comment": null + } + ], + "comment": "/* ----------------\n *\t ParamExecData\n *\n *\t ParamExecData entries are used for executor internal parameters\n *\t (that is, values being passed into or out of a sub-query). The\n *\t paramid of a PARAM_EXEC Param is a (zero-based) index into an\n *\t array of ParamExecData records, which is referenced through\n *\t es_param_exec_vals or ecxt_param_exec_vals.\n *\n *\t If execPlan is not NULL, it points to a SubPlanState node that needs\n *\t to be executed to produce the value. (This is done so that we can have\n *\t lazy evaluation of InitPlans: they aren't executed until/unless a\n *\t result value is needed.)\tOtherwise the value is assumed to be valid\n *\t when needed.\n * ----------------\n */\n" + } + }, + "access/attnum": { + }, + "c": { + }, + "postgres": { + "varatt_external": { + "fields": [ + { + "name": "va_rawsize", + "c_type": "int32", + "comment": "/* Original data size (includes header) */" + }, + { + "name": "va_extsize", + "c_type": "int32", + "comment": "/* External saved size (doesn't) */" + }, + { + "name": "va_valueid", + "c_type": "Oid", + "comment": "/* Unique ID of value within TOAST table */" + }, + { + "name": "va_toastrelid", + "c_type": "Oid", + "comment": "/* RelID of TOAST table containing it */" + } + ], + "comment": "/*\n * struct varatt_external is a traditional \"TOAST pointer\", that is, the\n * information needed to fetch a Datum stored out-of-line in a TOAST table.\n * The data is compressed if and only if va_extsize < va_rawsize - VARHDRSZ.\n * This struct must not contain any padding, because we sometimes compare\n * these pointers using memcmp.\n *\n * Note that this information is stored unaligned within actual tuples, so\n * you need to memcpy from the tuple into a local struct variable before\n * you can look at these fields! (The reason we use memcmp is to avoid\n * having to do that just to detect equality of two TOAST pointers...)\n */\n" + } + }, + "postgres_ext": { + }, + "storage/block": { + "BlockIdData": { + "fields": [ + { + "name": "bi_hi", + "c_type": "uint16", + "comment": null + }, + { + "name": "bi_lo", + "c_type": "uint16", + "comment": null + } + ], + "comment": "/*\n * BlockId:\n *\n * this is a storage type for BlockNumber. in other words, this type\n * is used for on-disk structures (e.g., in HeapTupleData) whereas\n * BlockNumber is the type on which calculations are performed (e.g.,\n * in access method code).\n *\n * there doesn't appear to be any reason to have separate types except\n * for the fact that BlockIds can be SHORTALIGN'd (and therefore any\n * structures that contains them, such as ItemPointerData, can also be\n * SHORTALIGN'd). this is an important consideration for reducing the\n * space requirements of the line pointer (ItemIdData) array on each\n * page and the header of each heap or index tuple, so it doesn't seem\n * wise to change this without good reason.\n */\n" + } + }, + "access/sdir": { + }, + "nodes/value": { + "Integer": { + "fields": [ + { + "name": "ival", + "c_type": "long" + } + ] + }, + "Float": { + "fields": [ + { + "name": "str", + "c_type": "char*" + } + ] + }, + "String": { + "fields": [ + { + "name": "str", + "c_type": "char*" + } + ] + }, + "BitString": { + "fields": [ + { + "name": "str", + "c_type": "char*" + } + ] + }, + "Null": { + "fields": [ + + ] + } + }, + "nodes/pg_list": { + "List": { + "fields": [ + { + "name": "items", + "c_type": "[]Node" + } + ] + } + } +} \ No newline at end of file diff --git a/srcdata/typedefs.json b/srcdata/typedefs.json new file mode 100644 index 00000000..b7a81316 --- /dev/null +++ b/srcdata/typedefs.json @@ -0,0 +1,122 @@ +[ + { + "new_type_name": "AclMode", + "source_type": "uint32", + "comment": "/*\n * Grantable rights are encoded so that we can OR them together in a bitmask.\n * The present representation of AclItem limits us to 16 distinct rights,\n * even though AclMode is defined as uint32. See utils/acl.h.\n *\n * Caution: changing these codes breaks stored ACLs, hence forces initdb.\n */\n" + }, + { + "new_type_name": "DistinctExpr", + "source_type": "OpExpr", + "comment": "/*\n * DistinctExpr - expression node for \"x IS DISTINCT FROM y\"\n *\n * Except for the nodetag, this is represented identically to an OpExpr\n * referencing the \"=\" operator for x and y.\n * We use \"=\", not the more obvious \"<>\", because more datatypes have \"=\"\n * than \"<>\". This means the executor must invert the operator result.\n * Note that the operator function won't be called at all if either input\n * is NULL, since then the result can be determined directly.\n */\n" + }, + { + "new_type_name": "NullIfExpr", + "source_type": "OpExpr", + "comment": "/*\n * NullIfExpr - a NULLIF expression\n *\n * Like DistinctExpr, this is represented the same as an OpExpr referencing\n * the \"=\" operator for x and y.\n */\n" + }, + { + "new_type_name": "Selectivity", + "source_type": "double", + "comment": "/*\n * Typedefs for identifying qualifier selectivities and plan costs as such.\n * These are just plain \"double\"s, but declaring a variable as Selectivity\n * or Cost makes the intent more obvious.\n *\n * These could have gone into plannodes.h or some such, but many files\n * depend on them...\n */\n" + }, + { + "new_type_name": "Cost", + "source_type": "double", + "comment": null + }, + { + "new_type_name": "ParamListInfo", + "source_type": "ParamListInfoData", + "comment": null + }, + { + "new_type_name": "AttrNumber", + "source_type": "int16", + "comment": "/*\n * user defined attribute numbers start at 1. -ay 2/95\n */\n" + }, + { + "new_type_name": "Pointer", + "source_type": "char", + "comment": "/*\n * Pointer\n *\t\tVariable holding address of any memory resident object.\n *\n *\t\tXXX Pointer arithmetic is done with this, so it can't be void *\n *\t\tunder \"true\" ANSI compilers.\n */\n" + }, + { + "new_type_name": "Index", + "source_type": "unsigned int", + "comment": "/*\n * Index\n *\t\tIndex into any memory resident array.\n *\n * Note:\n *\t\tIndices are non negative.\n */\n" + }, + { + "new_type_name": "Offset", + "source_type": "signed int", + "comment": "/*\n * Offset\n *\t\tOffset into any memory resident array.\n *\n * Note:\n *\t\tThis differs from an Index in that an Index is always\n *\t\tnon negative, whereas Offset may be negative.\n */\n" + }, + { + "new_type_name": "regproc", + "source_type": "Oid", + "comment": "/*\n * regproc is the type name used in the include/catalog headers, but\n * RegProcedure is the preferred name in C code.\n */\n" + }, + { + "new_type_name": "RegProcedure", + "source_type": "regproc", + "comment": null + }, + { + "new_type_name": "TransactionId", + "source_type": "uint32", + "comment": null + }, + { + "new_type_name": "LocalTransactionId", + "source_type": "uint32", + "comment": null + }, + { + "new_type_name": "SubTransactionId", + "source_type": "uint32", + "comment": null + }, + { + "new_type_name": "MultiXactId", + "source_type": "TransactionId", + "comment": "/* MultiXactId must be equivalent to TransactionId, to fit in t_xmax */\n" + }, + { + "new_type_name": "MultiXactOffset", + "source_type": "uint32", + "comment": null + }, + { + "new_type_name": "CommandId", + "source_type": "uint32", + "comment": null + }, + { + "new_type_name": "Name", + "source_type": "NameData", + "comment": "/*\n * Representation of a Name: effectively just a C string, but null-padded to\n * exactly NAMEDATALEN bytes. The use of a struct is historical.\n */\n" + }, + { + "new_type_name": "Datum", + "source_type": "uintptr_t", + "comment": "/*\n * Port Notes:\n *\tPostgres makes the following assumptions about datatype sizes:\n *\n *\tsizeof(Datum) == sizeof(void *) == 4 or 8\n *\tsizeof(char) == 1\n *\tsizeof(short) == 2\n *\n * When a type narrower than Datum is stored in a Datum, we place it in the\n * low-order bits and are careful that the DatumGetXXX macro for it discards\n * the unused high-order bits (as opposed to, say, assuming they are zero).\n * This is needed to support old-style user-defined functions, since depending\n * on architecture and compiler, the return value of a function returning char\n * or short may contain garbage when called as if it returned Datum.\n */\n" + }, + { + "new_type_name": "DatumPtr", + "source_type": "Datum", + "comment": null + }, + { + "new_type_name": "Oid", + "source_type": "unsigned int", + "comment": "/*\n * Object ID is a fundamental type in Postgres.\n */\n" + }, + { + "new_type_name": "BlockNumber", + "source_type": "uint32", + "comment": "/*\n * BlockNumber:\n *\n * each data file (heap or index) is divided into postgres disk blocks\n * (which may be thought of as the unit of i/o -- a postgres buffer\n * contains exactly one disk block). the blocks are numbered\n * sequentially, 0 to 0xFFFFFFFE.\n *\n * InvalidBlockNumber is the same thing as P_NEW in buf.h.\n *\n * the access methods, the buffer manager and the storage manager are\n * more or less the only pieces of code that should be accessing disk\n * blocks directly.\n */\n" + }, + { + "new_type_name": "BlockId", + "source_type": "BlockIdData", + "comment": null + } +] \ No newline at end of file