> SELECT 1
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 7} :location 7}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT 1; SELECT 2;
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 7} :location 7}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 8} {RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 2 :location 17} :location 17}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 10 :stmt_len 8})
> select a, b from t where a = 1
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("a") :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("b") :location 10} :location 10}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 17}) :whereClause {A_EXPR :name ("=") :lexpr {COLUMNREF :fields ("a") :location 25} :rexpr {A_CONST :val 1 :location 29} :rexpr_list_start 0 :rexpr_list_end 0 :location 27} :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT -1, -1.5, 'x', NULL, true, false, 1.5e3
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val -1 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {A_CONST :val -1.5 :location 11} :location 11} {RESTARGET :name <> :indirection <> :val {A_CONST :val "x" :location 17} :location 17} {RESTARGET :name <> :indirection <> :val {A_CONST NULL :location 22} :location 22} {RESTARGET :name <> :indirection <> :val {A_CONST :val true :location 28} :location 28} {RESTARGET :name <> :indirection <> :val {A_CONST :val false :location 34} :location 34} {RESTARGET :name <> :indirection <> :val {A_CONST :val 1.5e3 :location 41} :location 41}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a AS x, b y FROM s.t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name x :indirection <> :val {COLUMNREF :fields ("a") :location 7} :location 7} {RESTARGET :name y :indirection <> :val {COLUMNREF :fields ("b") :location 15} :location 15}) :fromClause ({RANGEVAR :catalogname <> :schemaname s :relname t :inh true :relpersistence p :alias <> :location 24}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT * FROM t ORDER BY a DESC, b LIMIT 10 OFFSET 5
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ({A_STAR}) :location 7} :location 7}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 14}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause ({SORTBY :node {COLUMNREF :fields ("a") :location 25} :sortby_dir 2 :sortby_nulls 0 :useOp <> :location -1} {SORTBY :node {COLUMNREF :fields ("b") :location 33} :sortby_dir 0 :sortby_nulls 0 :useOp <> :location -1}) :limitOffset {A_CONST :val 5 :location 51} :limitCount {A_CONST :val 10 :location 41} :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a + b * c FROM t WHERE a > 1 AND b < 2 OR NOT c
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_EXPR :name ("+") :lexpr {COLUMNREF :fields ("a") :location 7} :rexpr {A_EXPR :name ("*") :lexpr {COLUMNREF :fields ("b") :location 11} :rexpr {COLUMNREF :fields ("c") :location 15} :rexpr_list_start 0 :rexpr_list_end 0 :location 13} :rexpr_list_start 0 :rexpr_list_end 0 :location 9} :location 7}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 22}) :whereClause {BOOLEXPR :boolop or :args ({BOOLEXPR :boolop and :args ({A_EXPR :name (">") :lexpr {COLUMNREF :fields ("a") :location 30} :rexpr {A_CONST :val 1 :location 34} :rexpr_list_start 0 :rexpr_list_end 0 :location 32} {A_EXPR :name ("\<") :lexpr {COLUMNREF :fields ("b") :location 40} :rexpr {A_CONST :val 2 :location 44} :rexpr_list_start 0 :rexpr_list_end 0 :location 42}) :location 36} {BOOLEXPR :boolop not :args ({COLUMNREF :fields ("c") :location 53}) :location 49}) :location 46} :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT count(*), sum(a) FROM t GROUP BY a HAVING count(*) > 1
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("count") :args <> :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star true :agg_distinct false :func_variadic false :funcformat 0 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("sum") :args ({COLUMNREF :fields ("a") :location 21}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 17} :location 17}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 29}) :whereClause <> :groupClause ({COLUMNREF :fields ("a") :location 40}) :groupDistinct false :havingClause {A_EXPR :name (">") :lexpr {FUNCCALL :funcname ("count") :args <> :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star true :agg_distinct false :func_variadic false :funcformat 0 :location 49} :rexpr {A_CONST :val 1 :location 60} :rexpr_list_start 0 :rexpr_list_end 0 :location 58} :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT DISTINCT a FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause (<>) :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("a") :location 16} :location 16}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 23}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a::int, CAST(b AS text) FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {TYPECAST :arg {COLUMNREF :fields ("a") :location 7} :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 10} :location 8} :location 7} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {COLUMNREF :fields ("b") :location 20} :typeName {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 25} :location 15} :location 15}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 36}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT 1 UNION ALL SELECT 2
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList <> :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 1 :all true :larg {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 7} :location 7}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :rarg {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 2 :location 26} :location 26}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>}} :stmt_location 0 :stmt_len 0})
> SELECT t.a, t.* FROM t AS u JOIN v ON u.id = v.id
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("t" "a") :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("t" {A_STAR}) :location 12} :location 12}) :fromClause ({JOINEXPR :jointype 0 :isNatural false :larg {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias {ALIAS :aliasname u :colnames <>} :location 21} :rarg {RANGEVAR :catalogname <> :schemaname <> :relname v :inh true :relpersistence p :alias <> :location 33} :usingClause <> :join_using_alias <> :quals {A_EXPR :name ("=") :lexpr {COLUMNREF :fields ("u" "id") :location 38} :rexpr {COLUMNREF :fields ("v" "id") :location 45} :rexpr_list_start 0 :rexpr_list_end 0 :location 43} :alias <> :rtindex 0}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a % 2, 2 ^ 3, -a, +a, a <> b, a <= b, a >= b, a OPERATOR(pg_catalog.+) b, |/ a FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_EXPR :name ("%") :lexpr {COLUMNREF :fields ("a") :location 7} :rexpr {A_CONST :val 2 :location 11} :rexpr_list_start 0 :rexpr_list_end 0 :location 9} :location 7} {RESTARGET :name <> :indirection <> :val {A_EXPR :name ("^") :lexpr {A_CONST :val 2 :location 14} :rexpr {A_CONST :val 3 :location 18} :rexpr_list_start 0 :rexpr_list_end 0 :location 16} :location 14} {RESTARGET :name <> :indirection <> :val {A_EXPR :name ("-") :lexpr <> :rexpr {COLUMNREF :fields ("a") :location 22} :rexpr_list_start 0 :rexpr_list_end 0 :location 21} :location 21} {RESTARGET :name <> :indirection <> :val {A_EXPR :name ("+") :lexpr <> :rexpr {COLUMNREF :fields ("a") :location 26} :rexpr_list_start 0 :rexpr_list_end 0 :location 25} :location 25} {RESTARGET :name <> :indirection <> :val {A_EXPR :name ("\<>") :lexpr {COLUMNREF :fields ("a") :location 29} :rexpr {COLUMNREF :fields ("b") :location 34} :rexpr_list_start 0 :rexpr_list_end 0 :location 31} :location 29} {RESTARGET :name <> :indirection <> :val {A_EXPR :name ("\<=") :lexpr {COLUMNREF :fields ("a") :location 37} :rexpr {COLUMNREF :fields ("b") :location 42} :rexpr_list_start 0 :rexpr_list_end 0 :location 39} :location 37} {RESTARGET :name <> :indirection <> :val {A_EXPR :name (">=") :lexpr {COLUMNREF :fields ("a") :location 45} :rexpr {COLUMNREF :fields ("b") :location 50} :rexpr_list_start 0 :rexpr_list_end 0 :location 47} :location 45} {RESTARGET :name <> :indirection <> :val {A_EXPR :name ("pg_catalog" "+") :lexpr {COLUMNREF :fields ("a") :location 53} :rexpr {COLUMNREF :fields ("b") :location 78} :rexpr_list_start 0 :rexpr_list_end 0 :location 55} :location 53} {RESTARGET :name <> :indirection <> :val {A_EXPR :name ("|/") :lexpr <> :rexpr {COLUMNREF :fields ("a") :location 84} :rexpr_list_start 0 :rexpr_list_end 0 :location 81} :location 81}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 91}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a LIKE 'x%', a NOT LIKE 'x' ESCAPE '!', a ILIKE 'y', a NOT ILIKE 'z' ESCAPE '#', a SIMILAR TO 'b', a NOT SIMILAR TO 'c' ESCAPE 'd' FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_EXPR LIKE :name ("~~") :lexpr {COLUMNREF :fields ("a") :location 7} :rexpr {A_CONST :val "x%" :location 14} :rexpr_list_start 0 :rexpr_list_end 0 :location 9} :location 7} {RESTARGET :name <> :indirection <> :val {A_EXPR LIKE :name ("!~~") :lexpr {COLUMNREF :fields ("a") :location 20} :rexpr {FUNCCALL :funcname ("pg_catalog" "like_escape") :args ({A_CONST :val "x" :location 31} {A_CONST :val "!" :location 42}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 22} :rexpr_list_start 0 :rexpr_list_end 0 :location 22} :location 20} {RESTARGET :name <> :indirection <> :val {A_EXPR ILIKE :name ("~~*") :lexpr {COLUMNREF :fields ("a") :location 47} :rexpr {A_CONST :val "y" :location 55} :rexpr_list_start 0 :rexpr_list_end 0 :location 49} :location 47} {RESTARGET :name <> :indirection <> :val {A_EXPR ILIKE :name ("!~~*") :lexpr {COLUMNREF :fields ("a") :location 60} :rexpr {FUNCCALL :funcname ("pg_catalog" "like_escape") :args ({A_CONST :val "z" :location 72} {A_CONST :val "#" :location 83}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 62} :rexpr_list_start 0 :rexpr_list_end 0 :location 62} :location 60} {RESTARGET :name <> :indirection <> :val {A_EXPR SIMILAR :name ("~") :lexpr {COLUMNREF :fields ("a") :location 88} :rexpr {FUNCCALL :funcname ("pg_catalog" "similar_to_escape") :args ({A_CONST :val "b" :location 101}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 90} :rexpr_list_start 0 :rexpr_list_end 0 :location 90} :location 88} {RESTARGET :name <> :indirection <> :val {A_EXPR SIMILAR :name ("!~") :lexpr {COLUMNREF :fields ("a") :location 106} :rexpr {FUNCCALL :funcname ("pg_catalog" "similar_to_escape") :args ({A_CONST :val "c" :location 123} {A_CONST :val "d" :location 134}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 108} :rexpr_list_start 0 :rexpr_list_end 0 :location 108} :location 106}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 143}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a IS NULL, a ISNULL, a IS NOT NULL, a NOTNULL, a IS TRUE, a IS NOT TRUE, a IS FALSE, a IS NOT FALSE, a IS UNKNOWN, a IS NOT UNKNOWN FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {NULLTEST :arg {COLUMNREF :fields ("a") :location 7} :nulltesttype 0 :argisrow false :location 9} :location 7} {RESTARGET :name <> :indirection <> :val {NULLTEST :arg {COLUMNREF :fields ("a") :location 18} :nulltesttype 0 :argisrow false :location 20} :location 18} {RESTARGET :name <> :indirection <> :val {NULLTEST :arg {COLUMNREF :fields ("a") :location 28} :nulltesttype 1 :argisrow false :location 30} :location 28} {RESTARGET :name <> :indirection <> :val {NULLTEST :arg {COLUMNREF :fields ("a") :location 43} :nulltesttype 1 :argisrow false :location 45} :location 43} {RESTARGET :name <> :indirection <> :val {BOOLEANTEST :arg {COLUMNREF :fields ("a") :location 54} :booltesttype 0 :location 56} :location 54} {RESTARGET :name <> :indirection <> :val {BOOLEANTEST :arg {COLUMNREF :fields ("a") :location 65} :booltesttype 1 :location 67} :location 65} {RESTARGET :name <> :indirection <> :val {BOOLEANTEST :arg {COLUMNREF :fields ("a") :location 80} :booltesttype 2 :location 82} :location 80} {RESTARGET :name <> :indirection <> :val {BOOLEANTEST :arg {COLUMNREF :fields ("a") :location 92} :booltesttype 3 :location 94} :location 92} {RESTARGET :name <> :indirection <> :val {BOOLEANTEST :arg {COLUMNREF :fields ("a") :location 108} :booltesttype 4 :location 110} :location 108} {RESTARGET :name <> :indirection <> :val {BOOLEANTEST :arg {COLUMNREF :fields ("a") :location 122} :booltesttype 5 :location 124} :location 122}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 144}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a IS DISTINCT FROM b, a IS NOT DISTINCT FROM b, a BETWEEN 1 AND 2, a NOT BETWEEN 1 AND 2, a BETWEEN SYMMETRIC 2 AND 1, a NOT BETWEEN SYMMETRIC 2 AND 1 FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_EXPR DISTINCT :name ("=") :lexpr {COLUMNREF :fields ("a") :location 7} :rexpr {COLUMNREF :fields ("b") :location 26} :rexpr_list_start 0 :rexpr_list_end 0 :location 9} :location 7} {RESTARGET :name <> :indirection <> :val {A_EXPR NOT_DISTINCT :name ("=") :lexpr {COLUMNREF :fields ("a") :location 29} :rexpr {COLUMNREF :fields ("b") :location 52} :rexpr_list_start 0 :rexpr_list_end 0 :location 31} :location 29} {RESTARGET :name <> :indirection <> :val {A_EXPR BETWEEN :name ("BETWEEN") :lexpr {COLUMNREF :fields ("a") :location 55} :rexpr ({A_CONST :val 1 :location 65} {A_CONST :val 2 :location 71}) :rexpr_list_start 0 :rexpr_list_end 0 :location 57} :location 55} {RESTARGET :name <> :indirection <> :val {A_EXPR NOT_BETWEEN :name ("NOT\ BETWEEN") :lexpr {COLUMNREF :fields ("a") :location 74} :rexpr ({A_CONST :val 1 :location 88} {A_CONST :val 2 :location 94}) :rexpr_list_start 0 :rexpr_list_end 0 :location 76} :location 74} {RESTARGET :name <> :indirection <> :val {A_EXPR BETWEEN_SYM :name ("BETWEEN\ SYMMETRIC") :lexpr {COLUMNREF :fields ("a") :location 97} :rexpr ({A_CONST :val 2 :location 117} {A_CONST :val 1 :location 123}) :rexpr_list_start 0 :rexpr_list_end 0 :location 99} :location 97} {RESTARGET :name <> :indirection <> :val {A_EXPR NOT_BETWEEN_SYM :name ("NOT\ BETWEEN\ SYMMETRIC") :lexpr {COLUMNREF :fields ("a") :location 126} :rexpr ({A_CONST :val 2 :location 150} {A_CONST :val 1 :location 156}) :rexpr_list_start 0 :rexpr_list_end 0 :location 128} :location 126}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 163}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a IN (1, 2), a NOT IN (3), a IN (SELECT b FROM u), a NOT IN (SELECT b FROM u), a = ANY (SELECT b FROM u), a < ALL (ARRAY[1, 2]), a LIKE ANY (ARRAY['x']) FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_EXPR IN :name ("=") :lexpr {COLUMNREF :fields ("a") :location 7} :rexpr ({A_CONST :val 1 :location 13} {A_CONST :val 2 :location 16}) :rexpr_list_start 12 :rexpr_list_end 17 :location 9} :location 7} {RESTARGET :name <> :indirection <> :val {A_EXPR IN :name ("\<>") :lexpr {COLUMNREF :fields ("a") :location 20} :rexpr ({A_CONST :val 3 :location 30}) :rexpr_list_start 29 :rexpr_list_end 31 :location 22} :location 20} {RESTARGET :name <> :indirection <> :val {SUBLINK :subLinkType 2 :subLinkId 0 :testexpr {COLUMNREF :fields ("a") :location 34} :operName <> :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("b") :location 47} :location 47}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname u :inh true :relpersistence p :alias <> :location 54}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 36} :location 34} {RESTARGET :name <> :indirection <> :val {BOOLEXPR :boolop not :args ({SUBLINK :subLinkType 2 :subLinkId 0 :testexpr {COLUMNREF :fields ("a") :location 58} :operName <> :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("b") :location 75} :location 75}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname u :inh true :relpersistence p :alias <> :location 82}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 60}) :location 60} :location 58} {RESTARGET :name <> :indirection <> :val {SUBLINK :subLinkType 2 :subLinkId 0 :testexpr {COLUMNREF :fields ("a") :location 86} :operName ("=") :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("b") :location 102} :location 102}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname u :inh true :relpersistence p :alias <> :location 109}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 88} :location 86} {RESTARGET :name <> :indirection <> :val {A_EXPR ALL :name ("\<") :lexpr {COLUMNREF :fields ("a") :location 113} :rexpr {A_ARRAYEXPR :elements ({A_CONST :val 1 :location 128} {A_CONST :val 2 :location 131}) :list_start 127 :list_end 132 :location 122} :rexpr_list_start 0 :rexpr_list_end 0 :location 115} :location 113} {RESTARGET :name <> :indirection <> :val {A_EXPR ANY :name ("~~") :lexpr {COLUMNREF :fields ("a") :location 136} :rexpr {A_ARRAYEXPR :elements ({A_CONST :val "x" :location 154}) :list_start 153 :list_end 157 :location 148} :rexpr_list_start 0 :rexpr_list_end 0 :location 138} :location 136}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 165}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT EXISTS (SELECT 1), ARRAY(SELECT 1), (SELECT 1), ARRAY[1, 2], ARRAY[[1], [2]], ARRAY[]::int[], ROW(1, 2), (1, 2), (a).b, (a)[1], a[1:2], a[:2], a[1:], $1, $2[1]
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {SUBLINK :subLinkType 0 :subLinkId 0 :testexpr <> :operName <> :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 22} :location 22}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {SUBLINK :subLinkType 6 :subLinkId 0 :testexpr <> :operName <> :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 39} :location 39}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 26} :location 26} {RESTARGET :name <> :indirection <> :val {SUBLINK :subLinkType 4 :subLinkId 0 :testexpr <> :operName <> :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 51} :location 51}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 43} :location 43} {RESTARGET :name <> :indirection <> :val {A_ARRAYEXPR :elements ({A_CONST :val 1 :location 61} {A_CONST :val 2 :location 64}) :list_start 60 :list_end 65 :location 55} :location 55} {RESTARGET :name <> :indirection <> :val {A_ARRAYEXPR :elements ({A_ARRAYEXPR :elements ({A_CONST :val 1 :location 75}) :list_start 74 :list_end 76 :location 74} {A_ARRAYEXPR :elements ({A_CONST :val 2 :location 80}) :list_start 79 :list_end 81 :location 79}) :list_start 73 :list_end 82 :location 68} :location 68} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_ARRAYEXPR :elements <> :list_start 90 :list_end 91 :location 85} :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds (-1) :location 94} :location 92} :location 85} {RESTARGET :name <> :indirection <> :val {ROWEXPR :args ({A_CONST :val 1 :location 105} {A_CONST :val 2 :location 108}) :row_typeid 0 :row_format 0 :colnames <> :location 101} :location 101} {RESTARGET :name <> :indirection <> :val {ROWEXPR :args ({A_CONST :val 1 :location 113} {A_CONST :val 2 :location 116}) :row_typeid 0 :row_format 2 :colnames <> :location 112} :location 112} {RESTARGET :name <> :indirection <> :val {A_INDIRECTION :arg {COLUMNREF :fields ("a") :location 121} :indirection ("b")} :location 120} {RESTARGET :name <> :indirection <> :val {A_INDIRECTION :arg {COLUMNREF :fields ("a") :location 128} :indirection ({A_INDICES :is_slice false :lidx <> :uidx {A_CONST :val 1 :location 131}})} :location 127} {RESTARGET :name <> :indirection <> :val {A_INDIRECTION :arg {COLUMNREF :fields ("a") :location 135} :indirection ({A_INDICES :is_slice true :lidx {A_CONST :val 1 :location 137} :uidx {A_CONST :val 2 :location 139}})} :location 135} {RESTARGET :name <> :indirection <> :val {A_INDIRECTION :arg {COLUMNREF :fields ("a") :location 143} :indirection ({A_INDICES :is_slice true :lidx <> :uidx {A_CONST :val 2 :location 146}})} :location 143} {RESTARGET :name <> :indirection <> :val {A_INDIRECTION :arg {COLUMNREF :fields ("a") :location 150} :indirection ({A_INDICES :is_slice true :lidx {A_CONST :val 1 :location 152} :uidx <>})} :location 150} {RESTARGET :name <> :indirection <> :val {PARAMREF :number 1 :location 157} :location 157} {RESTARGET :name <> :indirection <> :val {A_INDIRECTION :arg {PARAMREF :number 2 :location 161} :indirection ({A_INDICES :is_slice false :lidx <> :uidx {A_CONST :val 1 :location 164}})} :location 161}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT CASE WHEN a THEN 1 WHEN b THEN 2 ELSE 3 END, CASE a WHEN 1 THEN 'x' END, COALESCE(a, b), GREATEST(a, b), LEAST(a, b), NULLIF(a, b) FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {CASEEXPR :casetype 0 :casecollid 0 :arg <> :args ({CASEWHEN :expr {COLUMNREF :fields ("a") :location 17} :result {A_CONST :val 1 :location 24} :location 12} {CASEWHEN :expr {COLUMNREF :fields ("b") :location 31} :result {A_CONST :val 2 :location 38} :location 26}) :defresult {A_CONST :val 3 :location 45} :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {CASEEXPR :casetype 0 :casecollid 0 :arg {COLUMNREF :fields ("a") :location 57} :args ({CASEWHEN :expr {A_CONST :val 1 :location 64} :result {A_CONST :val "x" :location 71} :location 59}) :defresult <> :location 52} :location 52} {RESTARGET :name <> :indirection <> :val {COALESCEEXPR :coalescetype 0 :coalescecollid 0 :args ({COLUMNREF :fields ("a") :location 89} {COLUMNREF :fields ("b") :location 92}) :location 80} :location 80} {RESTARGET :name <> :indirection <> :val {MINMAXEXPR :minmaxtype 0 :minmaxcollid 0 :inputcollid 0 :op 0 :args ({COLUMNREF :fields ("a") :location 105} {COLUMNREF :fields ("b") :location 108}) :location 96} :location 96} {RESTARGET :name <> :indirection <> :val {MINMAXEXPR :minmaxtype 0 :minmaxcollid 0 :inputcollid 0 :op 1 :args ({COLUMNREF :fields ("a") :location 118} {COLUMNREF :fields ("b") :location 121}) :location 112} :location 112} {RESTARGET :name <> :indirection <> :val {A_EXPR NULLIF :name ("=") :lexpr {COLUMNREF :fields ("a") :location 132} :rexpr {COLUMNREF :fields ("b") :location 135} :rexpr_list_start 0 :rexpr_list_end 0 :location 125} :location 125}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 143}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT count(DISTINCT a), array_agg(a ORDER BY b), f(VARIADIC a), f(a, VARIADIC b), percentile_cont(0.5) WITHIN GROUP (ORDER BY a), count(*) FILTER (WHERE a > 1), f(x => 1, y := 2) FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("count") :args ({COLUMNREF :fields ("a") :location 22}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct true :func_variadic false :funcformat 0 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("array_agg") :args ({COLUMNREF :fields ("a") :location 36}) :agg_order ({SORTBY :node {COLUMNREF :fields ("b") :location 47} :sortby_dir 0 :sortby_nulls 0 :useOp <> :location -1}) :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 26} :location 26} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("f") :args ({COLUMNREF :fields ("a") :location 62}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic true :funcformat 0 :location 51} :location 51} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("f") :args ({COLUMNREF :fields ("a") :location 68} {COLUMNREF :fields ("b") :location 80}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic true :funcformat 0 :location 66} :location 66} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("percentile_cont") :args ({A_CONST :val 0.5 :location 100}) :agg_order ({SORTBY :node {COLUMNREF :fields ("a") :location 128} :sortby_dir 0 :sortby_nulls 0 :useOp <> :location -1}) :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group true :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 84} :location 84} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("count") :args <> :agg_order <> :agg_filter {A_EXPR :name (">") :lexpr {COLUMNREF :fields ("a") :location 155} :rexpr {A_CONST :val 1 :location 159} :rexpr_list_start 0 :rexpr_list_end 0 :location 157} :over <> :ignore_nulls 0 :agg_within_group false :agg_star true :agg_distinct false :func_variadic false :funcformat 0 :location 132} :location 132} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("f") :args ({NAMEDARGEXPR :arg {A_CONST :val 1 :location 170} :name x :argnumber -1 :location 165} {NAMEDARGEXPR :arg {A_CONST :val 2 :location 178} :name y :argnumber -1 :location 173}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 163} :location 163}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 186}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT sum(a) OVER w, rank() OVER (PARTITION BY a ORDER BY b), sum(a) OVER (ORDER BY b ROWS BETWEEN 1 PRECEDING AND CURRENT ROW), sum(a) OVER (RANGE UNBOUNDED PRECEDING), sum(a) OVER (GROUPS BETWEEN CURRENT ROW AND 2 FOLLOWING EXCLUDE TIES) FROM t WINDOW w AS (PARTITION BY c)
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("sum") :args ({COLUMNREF :fields ("a") :location 11}) :agg_order <> :agg_filter <> :over {WINDOWDEF :name w :refname <> :partitionClause <> :orderClause <> :frameOptions 1058 :startOffset <> :endOffset <> :location 19} :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("rank") :args <> :agg_order <> :agg_filter <> :over {WINDOWDEF :name <> :refname <> :partitionClause ({COLUMNREF :fields ("a") :location 48}) :orderClause ({SORTBY :node {COLUMNREF :fields ("b") :location 59} :sortby_dir 0 :sortby_nulls 0 :useOp <> :location -1}) :frameOptions 1058 :startOffset <> :endOffset <> :location 34} :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 22} :location 22} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("sum") :args ({COLUMNREF :fields ("a") :location 67}) :agg_order <> :agg_filter <> :over {WINDOWDEF :name <> :refname <> :partitionClause <> :orderClause ({SORTBY :node {COLUMNREF :fields ("b") :location 85} :sortby_dir 0 :sortby_nulls 0 :useOp <> :location -1}) :frameOptions 3093 :startOffset {A_CONST :val 1 :location 100} :endOffset <> :location 75} :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 63} :location 63} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("sum") :args ({COLUMNREF :fields ("a") :location 134}) :agg_order <> :agg_filter <> :over {WINDOWDEF :name <> :refname <> :partitionClause <> :orderClause <> :frameOptions 1059 :startOffset <> :endOffset <> :location 142} :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 130} :location 130} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("sum") :args ({COLUMNREF :fields ("a") :location 175}) :agg_order <> :agg_filter <> :over {WINDOWDEF :name <> :refname <> :partitionClause <> :orderClause <> :frameOptions 147993 :startOffset <> :endOffset {A_CONST :val 2 :location 215} :location 183} :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 171} :location 171}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 246}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause ({WINDOWDEF :name w :refname <> :partitionClause ({COLUMNREF :fields ("c") :location 274}) :orderClause <> :frameOptions 1058 :startOffset <> :endOffset <> :location 260}) :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT CURRENT_DATE, CURRENT_TIME, CURRENT_TIME(2), CURRENT_TIMESTAMP, LOCALTIME, LOCALTIMESTAMP(3), CURRENT_ROLE, CURRENT_USER, SESSION_USER, SYSTEM_USER, USER, CURRENT_CATALOG, CURRENT_SCHEMA
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 0 :type 0 :typmod -1 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 1 :type 0 :typmod -1 :location 21} :location 21} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 2 :type 0 :typmod 2 :location 35} :location 35} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 3 :type 0 :typmod -1 :location 52} :location 52} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 5 :type 0 :typmod -1 :location 71} :location 71} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 8 :type 0 :typmod 3 :location 82} :location 82} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 9 :type 0 :typmod -1 :location 101} :location 101} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 10 :type 0 :typmod -1 :location 115} :location 115} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 12 :type 0 :typmod -1 :location 129} :location 129} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "system_user") :args <> :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 143} :location 143} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 11 :type 0 :typmod -1 :location 156} :location 156} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 13 :type 0 :typmod -1 :location 162} :location 162} {RESTARGET :name <> :indirection <> :val {SQLVALUEFUNCTION :op 14 :type 0 :typmod -1 :location 179} :location 179}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT EXTRACT(year FROM a), NORMALIZE(a), NORMALIZE(a, NFKC), OVERLAY(a PLACING 'x' FROM 2 FOR 3), POSITION('a' IN b), SUBSTRING(a FROM 2 FOR 3), SUBSTRING(a FOR 3), SUBSTRING(a, 1), TRIM(BOTH 'x' FROM a), TRIM(LEADING FROM a), TRIM(a), COLLATION FOR (a) FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "extract") :args ({A_CONST :val "year" :location 15} {COLUMNREF :fields ("a") :location 25}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "normalize") :args ({COLUMNREF :fields ("a") :location 39}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 29} :location 29} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "normalize") :args ({COLUMNREF :fields ("a") :location 53} {A_CONST :val "NFKC" :location 56}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 43} :location 43} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "overlay") :args ({COLUMNREF :fields ("a") :location 71} {A_CONST :val "x" :location 81} {A_CONST :val 2 :location 90} {A_CONST :val 3 :location 96}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 63} :location 63} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "position") :args ({COLUMNREF :fields ("b") :location 116} {A_CONST :val "a" :location 109}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 100} :location 100} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "substring") :args ({COLUMNREF :fields ("a") :location 130} {A_CONST :val 2 :location 137} {A_CONST :val 3 :location 143}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 120} :location 120} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "substring") :args ({COLUMNREF :fields ("a") :location 157} {A_CONST :val 1 :location -1} {TYPECAST :arg {A_CONST :val 3 :location 163} :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location -1} :location -1}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 147} :location 147} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("substring") :args ({COLUMNREF :fields ("a") :location 177} {A_CONST :val 1 :location 180}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 167} :location 167} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "btrim") :args ({COLUMNREF :fields ("a") :location 203} {A_CONST :val "x" :location 194}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 184} :location 184} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "ltrim") :args ({COLUMNREF :fields ("a") :location 225}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 207} :location 207} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "btrim") :args ({COLUMNREF :fields ("a") :location 234}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 229} :location 229} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "pg_collation_for") :args ({COLUMNREF :fields ("a") :location 253}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 238} :location 238}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 261}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a AT TIME ZONE 'UTC', a AT LOCAL, a COLLATE "C", (a, b) OVERLAPS (c, d), a IS NORMALIZED, a IS NOT NFC NORMALIZED, TREAT(a AS int) FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "timezone") :args ({A_CONST :val "UTC" :location 22} {COLUMNREF :fields ("a") :location 7}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 9} :location 7} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "timezone") :args ({COLUMNREF :fields ("a") :location 29}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location -1} :location 29} {RESTARGET :name <> :indirection <> :val {COLLATECLAUSE :arg {COLUMNREF :fields ("a") :location 41} :collname ("C") :location 43} :location 41} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "overlaps") :args ({COLUMNREF :fields ("a") :location 57} {COLUMNREF :fields ("b") :location 60} {COLUMNREF :fields ("c") :location 73} {COLUMNREF :fields ("d") :location 76}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 63} :location 56} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "is_normalized") :args ({COLUMNREF :fields ("a") :location 80}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 82} :location 80} {RESTARGET :name <> :indirection <> :val {BOOLEXPR :boolop not :args ({FUNCCALL :funcname ("pg_catalog" "is_normalized") :args ({COLUMNREF :fields ("a") :location 97} {A_CONST :val "NFC" :location 106}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 99}) :location 99} :location 97} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "int4") :args ({COLUMNREF :fields ("a") :location 128}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 122} :location 122}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 143}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT xmlconcat(a, b), xmlelement(name foo, xmlattributes(a AS b), 'x'), xmlforest(a AS b, c), xmlparse(document a), xmlpi(name php, 'x'), xmlroot(a, version '1.0', standalone yes), xmlserialize(content a AS text), a IS DOCUMENT, xmlexists('//x' PASSING a) FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {XMLEXPR :op 0 :name <> :named_args <> :arg_names <> :args ({COLUMNREF :fields ("a") :location 17} {COLUMNREF :fields ("b") :location 20}) :xmloption 0 :indent false :type 0 :typmod 0 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {XMLEXPR :op 1 :name foo :named_args ({RESTARGET :name b :indirection <> :val {COLUMNREF :fields ("a") :location 59} :location 59}) :arg_names <> :args ({A_CONST :val "x" :location 68}) :xmloption 0 :indent false :type 0 :typmod 0 :location 24} :location 24} {RESTARGET :name <> :indirection <> :val {XMLEXPR :op 2 :name <> :named_args ({RESTARGET :name b :indirection <> :val {COLUMNREF :fields ("a") :location 84} :location 84} {RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("c") :location 92} :location 92}) :arg_names <> :args <> :xmloption 0 :indent false :type 0 :typmod 0 :location 74} :location 74} {RESTARGET :name <> :indirection <> :val {XMLEXPR :op 3 :name <> :named_args <> :arg_names <> :args ({COLUMNREF :fields ("a") :location 114} {A_CONST :val false :location -1}) :xmloption 0 :indent false :type 0 :typmod 0 :location 96} :location 96} {RESTARGET :name <> :indirection <> :val {XMLEXPR :op 4 :name php :named_args <> :arg_names <> :args ({A_CONST :val "x" :location 134}) :xmloption 0 :indent false :type 0 :typmod 0 :location 118} :location 118} {RESTARGET :name <> :indirection <> :val {XMLEXPR :op 5 :name <> :named_args <> :arg_names <> :args ({COLUMNREF :fields ("a") :location 148} {A_CONST :val "\1.0" :location 159} {A_CONST :val 0 :location -1}) :xmloption 0 :indent false :type 0 :typmod 0 :location 140} :location 140} {RESTARGET :name <> :indirection <> :val {XMLSERIALIZE :xmloption 1 :expr {COLUMNREF :fields ("a") :location 204} :typeName {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 209} :indent false :location 183} :location 183} {RESTARGET :name <> :indirection <> :val {XMLEXPR :op 7 :name <> :named_args <> :arg_names <> :args ({COLUMNREF :fields ("a") :location 216}) :xmloption 0 :indent false :type 0 :typmod 0 :location 218} :location 216} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "xmlexists") :args ({A_CONST :val "//x" :location 241} {COLUMNREF :fields ("a") :location 255}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 3 :location 231} :location 231}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 263}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT int '1', interval '1' day, interval(2) '1 s', interval '1' hour to second(3), bit '101', B'101', X'1F', 'x'::varchar(3), numeric(10, 2) '1.5', double precision '1', char(2) 'ab', timestamp(3) with time zone 'now', pg_catalog.int4 '1'
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\1" :location 11} :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 7} :location -1} :location 7} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\1" :location 25} :typeName {TYPENAME :names ("pg_catalog" "interval") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 8 :location 29}) :typemod -1 :arrayBounds <> :location 16} :location -1} :location 16} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\1\ s" :location 46} :typeName {TYPENAME :names ("pg_catalog" "interval") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 32767 :location -1} {A_CONST :val 2 :location 43}) :typemod -1 :arrayBounds <> :location 34} :location -1} :location 34} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\1" :location 62} :typeName {TYPENAME :names ("pg_catalog" "interval") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 7168 :location 66} {A_CONST :val 3 :location 81}) :typemod -1 :arrayBounds <> :location 53} :location -1} :location 53} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\101" :location 89} :typeName {TYPENAME :names ("pg_catalog" "bit") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 85} :location -1} :location 85} {RESTARGET :name <> :indirection <> :val {A_CONST :val b101 :location 96} :location 96} {RESTARGET :name <> :indirection <> :val {A_CONST :val x1F :location 104} :location 104} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "x" :location 111} :typeName {TYPENAME :names ("pg_catalog" "varchar") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 3 :location 124}) :typemod -1 :arrayBounds <> :location 116} :location 114} :location 111} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\1.5" :location 143} :typeName {TYPENAME :names ("pg_catalog" "numeric") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 10 :location 136} {A_CONST :val 2 :location 140}) :typemod -1 :arrayBounds <> :location 128} :location -1} :location 128} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\1" :location 167} :typeName {TYPENAME :names ("pg_catalog" "float8") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 150} :location -1} :location 150} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "ab" :location 180} :typeName {TYPENAME :names ("pg_catalog" "bpchar") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 2 :location 177}) :typemod -1 :arrayBounds <> :location 172} :location -1} :location 172} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "now" :location 214} :typeName {TYPENAME :names ("pg_catalog" "timestamptz") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 3 :location 196}) :typemod -1 :arrayBounds <> :location 186} :location -1} :location 186} {RESTARGET :name <> :indirection <> :val {TYPECAST :arg {A_CONST :val "\1" :location 237} :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 221} :location -1} :location 221}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a.b.c, t.*, x[1].y, - 2147483648, 1e10, 0x1F, 1_000 FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("a" "b" "c") :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("t" {A_STAR}) :location 14} :location 14} {RESTARGET :name <> :indirection <> :val {A_INDIRECTION :arg {COLUMNREF :fields ("x") :location 19} :indirection ({A_INDICES :is_slice false :lidx <> :uidx {A_CONST :val 1 :location 21}} "y")} :location 19} {RESTARGET :name <> :indirection <> :val {A_CONST :val -2147483648 :location 27} :location 27} {RESTARGET :name <> :indirection <> :val {A_CONST :val 1e10 :location 41} :location 41} {RESTARGET :name <> :indirection <> :val {A_CONST :val 31 :location 47} :location 47} {RESTARGET :name <> :indirection <> :val {A_CONST :val 1000 :location 53} :location 53}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 64}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT JSON_OBJECT('a' VALUE 1, 'b': 2 ABSENT ON NULL WITH UNIQUE KEYS RETURNING jsonb), JSON_OBJECT(RETURNING text), JSON_ARRAY(1, 2 NULL ON NULL RETURNING json FORMAT JSON), JSON_ARRAY(SELECT 1 FORMAT JSON), JSON_ARRAY(), JSON(a WITH UNIQUE KEYS), JSON_SCALAR(1), JSON_SERIALIZE(a RETURNING bytea), json_object('{a,b}') FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {JSONOBJECTCONSTRUCTOR :exprs ({JSONKEYVALUE :key {A_CONST :val "a" :location 19} :value {JSONVALUEEXPR :raw_expr {A_CONST :val 1 :location 29} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}}} {JSONKEYVALUE :key {A_CONST :val "b" :location 32} :value {JSONVALUEEXPR :raw_expr {A_CONST :val 2 :location 37} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}}}) :output {JSONOUTPUT :typeName {TYPENAME :names ("jsonb") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 81} :returning {JSONRETURNING :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :typid 0 :typmod 0}} :absent_on_null true :unique true :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {JSONOBJECTCONSTRUCTOR :exprs <> :output {JSONOUTPUT :typeName {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 111} :returning {JSONRETURNING :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :typid 0 :typmod 0}} :absent_on_null false :unique false :location 89} :location 89} {RESTARGET :name <> :indirection <> :val {JSONARRAYCONSTRUCTOR :exprs ({JSONVALUEEXPR :raw_expr {A_CONST :val 1 :location 129} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} {JSONVALUEEXPR :raw_expr {A_CONST :val 2 :location 132} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}}) :output {JSONOUTPUT :typeName {TYPENAME :names ("pg_catalog" "json") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 157} :returning {JSONRETURNING :format {JSONFORMAT :format_type 1 :encoding 0 :location 162} :typid 0 :typmod 0}} :absent_on_null false :location 118} :location 118} {RESTARGET :name <> :indirection <> :val {JSONARRAYQUERYCONSTRUCTOR :query {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 194} :location 194}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :output <> :format {JSONFORMAT :format_type 1 :encoding 0 :location 196} :absent_on_null true :location 176} :location 176} {RESTARGET :name <> :indirection <> :val {JSONARRAYCONSTRUCTOR :exprs <> :output <> :absent_on_null true :location 210} :location 210} {RESTARGET :name <> :indirection <> :val {JSONPARSEEXPR :expr {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 229} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :output <> :unique_keys true :location 224} :location 224} {RESTARGET :name <> :indirection <> :val {JSONSCALAREXPR :expr {A_CONST :val 1 :location 262} :output <> :location 250} :location 250} {RESTARGET :name <> :indirection <> :val {JSONSERIALIZEEXPR :expr {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 281} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :output {JSONOUTPUT :typeName {TYPENAME :names ("bytea") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 293} :returning {JSONRETURNING :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :typid 0 :typmod 0}} :location 266} :location 266} {RESTARGET :name <> :indirection <> :val {FUNCCALL :funcname ("pg_catalog" "json_object") :args ({A_CONST :val "\{a,b\}" :location 313}) :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 301} :location 301}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 327}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT a IS JSON, a IS NOT JSON OBJECT WITH UNIQUE KEYS, a IS JSON SCALAR, JSON_VALUE(a, '$.x' RETURNING int DEFAULT 0 ON EMPTY ERROR ON ERROR), JSON_QUERY(a FORMAT JSON ENCODING utf8, '$' PASSING 1 AS x WITH CONDITIONAL WRAPPER KEEP QUOTES EMPTY ARRAY ON EMPTY), JSON_QUERY(a, '$' NULL ON ERROR), JSON_EXISTS(a, '$.y' TRUE ON ERROR), JSON_VALUE(a, '$') FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {JSONISPREDICATE :expr {COLUMNREF :fields ("a") :location 7} :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :item_type 0 :unique_keys false :exprBaseType 0 :location 7} :location 7} {RESTARGET :name <> :indirection <> :val {BOOLEXPR :boolop not :args ({JSONISPREDICATE :expr {COLUMNREF :fields ("a") :location 18} :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :item_type 1 :unique_keys true :exprBaseType 0 :location 18}) :location 18} :location 18} {RESTARGET :name <> :indirection <> :val {JSONISPREDICATE :expr {COLUMNREF :fields ("a") :location 57} :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :item_type 3 :unique_keys false :exprBaseType 0 :location 57} :location 57} {RESTARGET :name <> :indirection <> :val {JSONFUNCEXPR :op 2 :column_name <> :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 86} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :pathspec {A_CONST :val "$.x" :location 89} :passing <> :output {JSONOUTPUT :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 105} :returning {JSONRETURNING :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :typid 0 :typmod 0}} :on_empty {JSONBEHAVIOR :btype 8 :expr {A_CONST :val 0 :location 117} :coerce false :location 109} :on_error {JSONBEHAVIOR :btype 1 :expr <> :coerce false :location 128} :wrapper 0 :quotes 0 :location 75} :location 75} {RESTARGET :name <> :indirection <> :val {JSONFUNCEXPR :op 1 :column_name <> :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 156} :formatted_expr <> :format {JSONFORMAT :format_type 1 :encoding 1 :location 158}} :pathspec {A_CONST :val "$" :location 185} :passing ({JSONARGUMENT :val {JSONVALUEEXPR :raw_expr {A_CONST :val 1 :location 197} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :name x}) :output <> :on_empty {JSONBEHAVIOR :btype 6 :expr <> :coerce false :location 241} :on_error <> :wrapper 2 :quotes 1 :location 145} :location 145} {RESTARGET :name <> :indirection <> :val {JSONFUNCEXPR :op 1 :column_name <> :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 275} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :pathspec {A_CONST :val "$" :location 278} :passing <> :output <> :on_empty <> :on_error {JSONBEHAVIOR :btype 0 :expr <> :coerce false :location 282} :wrapper 0 :quotes 0 :location 264} :location 264} {RESTARGET :name <> :indirection <> :val {JSONFUNCEXPR :op 0 :column_name <> :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 310} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :pathspec {A_CONST :val "$.y" :location 313} :passing <> :output <> :on_empty <> :on_error {JSONBEHAVIOR :btype 3 :expr <> :coerce false :location 319} :wrapper 0 :quotes 0 :location 298} :location 298} {RESTARGET :name <> :indirection <> :val {JSONFUNCEXPR :op 2 :column_name <> :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 346} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :pathspec {A_CONST :val "$" :location 349} :passing <> :output <> :on_empty <> :on_error <> :wrapper 0 :quotes 0 :location 335} :location 335}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 359}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT json_arrayagg(a ORDER BY b ABSENT ON NULL RETURNING jsonb) FILTER (WHERE c) OVER (), json_objectagg(k : v NULL ON NULL WITH UNIQUE KEYS), json_objectagg(k VALUE v) OVER w FROM t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {JSONARRAYAGG :constructor {JSONAGGCONSTRUCTOR :output {JSONOUTPUT :typeName {TYPENAME :names ("jsonb") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 59} :returning {JSONRETURNING :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :typid 0 :typmod 0}} :agg_filter {COLUMNREF :fields ("c") :location 80} :agg_order ({SORTBY :node {COLUMNREF :fields ("b") :location 32} :sortby_dir 0 :sortby_nulls 0 :useOp <> :location -1}) :over {WINDOWDEF :name <> :refname <> :partitionClause <> :orderClause <> :frameOptions 1058 :startOffset <> :endOffset <> :location 88} :location 7} :arg {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 21} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :absent_on_null true} :location 7} {RESTARGET :name <> :indirection <> :val {JSONOBJECTAGG :constructor {JSONAGGCONSTRUCTOR :output <> :agg_filter <> :agg_order <> :over <> :location 92} :arg {JSONKEYVALUE :key {COLUMNREF :fields ("k") :location 107} :value {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("v") :location 111} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}}} :absent_on_null false :unique true} :location 92} {RESTARGET :name <> :indirection <> :val {JSONOBJECTAGG :constructor {JSONAGGCONSTRUCTOR :output <> :agg_filter <> :agg_order <> :over {WINDOWDEF :name w :refname <> :partitionClause <> :orderClause <> :frameOptions 1058 :startOffset <> :endOffset <> :location 176} :location 145} :arg {JSONKEYVALUE :key {COLUMNREF :fields ("k") :location 160} :value {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("v") :location 168} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}}} :absent_on_null false :unique false} :location 145}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 183}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT * FROM JSON_TABLE(a, '$.x' AS p PASSING 1 AS y COLUMNS (id FOR ORDINALITY, b int PATH '$.b' WITH WRAPPER OMIT QUOTES NULL ON EMPTY, c jsonb FORMAT JSON PATH '$.c', d bool EXISTS PATH '$.d' ERROR ON ERROR, e text, NESTED PATH '$.e[*]' COLUMNS (f text), NESTED '$.g' AS q COLUMNS (h int)) EMPTY ON ERROR) AS jt, LATERAL JSON_TABLE(b, '$' COLUMNS (z int)) AS j2(z1)
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ({A_STAR}) :location 7} :location 7}) :fromClause ({JSONTABLE :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("a") :location 25} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$.x" :location 28} :name p :name_location 34 :location 28} :passing ({JSONARGUMENT :val {JSONVALUEEXPR :raw_expr {A_CONST :val 1 :location 47} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :name y}) :columns ({JSONTABLECOLUMN :coltype 0 :name id :typeName <> :pathspec <> :format <> :wrapper 0 :quotes 0 :columns <> :on_empty <> :on_error <> :location 63} {JSONTABLECOLUMN :coltype 1 :name b :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 84} :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$.b" :location 93} :name <> :name_location -1 :location 93} :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :wrapper 3 :quotes 2 :columns <> :on_empty {JSONBEHAVIOR :btype 0 :expr <> :coerce false :location 124} :on_error <> :location 82} {JSONTABLECOLUMN :coltype 3 :name c :typeName {TYPENAME :names ("jsonb") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 141} :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$.c" :location 164} :name <> :name_location -1 :location 164} :format {JSONFORMAT :format_type 1 :encoding 0 :location 147} :wrapper 0 :quotes 0 :columns <> :on_empty <> :on_error <> :location 139} {JSONTABLECOLUMN :coltype 2 :name d :typeName {TYPENAME :names ("bool") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 173} :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$.d" :location 190} :name <> :name_location -1 :location 190} :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :wrapper 1 :quotes 0 :columns <> :on_empty <> :on_error {JSONBEHAVIOR :btype 1 :expr <> :coerce false :location 196} :location 171} {JSONTABLECOLUMN :coltype 1 :name e :typeName {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 214} :pathspec <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :wrapper 0 :quotes 0 :columns <> :on_empty <> :on_error <> :location 212} {JSONTABLECOLUMN :coltype 4 :name <> :typeName <> :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$.e[*]" :location 232} :name <> :name_location -1 :location 232} :format <> :wrapper 0 :quotes 0 :columns ({JSONTABLECOLUMN :coltype 1 :name f :typeName {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 252} :pathspec <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :wrapper 0 :quotes 0 :columns <> :on_empty <> :on_error <> :location 250}) :on_empty <> :on_error <> :location 220} {JSONTABLECOLUMN :coltype 4 :name <> :typeName <> :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$.g" :location 266} :name q :name_location 275 :location 266} :format <> :wrapper 0 :quotes 0 :columns ({JSONTABLECOLUMN :coltype 1 :name h :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 288} :pathspec <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :wrapper 0 :quotes 0 :columns <> :on_empty <> :on_error <> :location 286}) :on_empty <> :on_error <> :location 259}) :on_error {JSONBEHAVIOR :btype 6 :expr <> :coerce false :location 294} :alias {ALIAS :aliasname jt :colnames <>} :lateral false :location 14} {JSONTABLE :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("b") :location 336} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$" :location 339} :name <> :name_location -1 :location 339} :passing <> :columns ({JSONTABLECOLUMN :coltype 1 :name z :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 354} :pathspec <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :wrapper 0 :quotes 0 :columns <> :on_empty <> :on_error <> :location 352}) :on_error <> :alias {ALIAS :aliasname j2 :colnames ("z1")} :lateral true :location 325}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT * FROM JSON_TABLE(a, b COLUMNS (x int))
ERROR 0A000 29 only string constants are supported in JSON_TABLE path specification
> SELECT JSON_VALUE(a FORMAT JSON ENCODING latin1, '$')
ERROR 22023 42 unrecognized JSON encoding: latin1
> SELECT * FROM f() AS (a int), g() AS x(b int), h() AS x, f() y(c int)
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ({A_STAR}) :location 7} :location 7}) :fromClause ({RANGEFUNCTION :lateral false :ordinality false :is_rowsfrom false :functions (({FUNCCALL :funcname ("f") :args <> :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 14} <>)) :alias <> :coldeflist ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 24} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 22})} {RANGEFUNCTION :lateral false :ordinality false :is_rowsfrom false :functions (({FUNCCALL :funcname ("g") :args <> :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 30} <>)) :alias {ALIAS :aliasname x :colnames <>} :coldeflist ({COLUMNDEF :colname b :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 41} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 39})} {RANGEFUNCTION :lateral false :ordinality false :is_rowsfrom false :functions (({FUNCCALL :funcname ("h") :args <> :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 47} <>)) :alias {ALIAS :aliasname x :colnames <>} :coldeflist <>} {RANGEFUNCTION :lateral false :ordinality false :is_rowsfrom false :functions (({FUNCCALL :funcname ("f") :args <> :agg_order <> :agg_filter <> :over <> :ignore_nulls 0 :agg_within_group false :agg_star false :agg_distinct false :func_variadic false :funcformat 0 :location 57} <>)) :alias {ALIAS :aliasname y :colnames <>} :coldeflist ({COLUMNDEF :colname c :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 65} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 63})}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> CHECKPOINT
({RAWSTMT :stmt {CHECKPOINTSTMT :options <>} :stmt_location 0 :stmt_len 0})
> CHECKPOINT (MODE FAST)
({RAWSTMT :stmt {CHECKPOINTSTMT :options ({DEFELEM :defnamespace <> :defname mode :arg "fast" :defaction 0 :location 12})} :stmt_location 0 :stmt_len 0})
> CHECKPOINT (MODE FAST, FLUSH_UNLOGGED true)
({RAWSTMT :stmt {CHECKPOINTSTMT :options ({DEFELEM :defnamespace <> :defname mode :arg "fast" :defaction 0 :location 12} {DEFELEM :defnamespace <> :defname flush_unlogged :arg "true" :defaction 0 :location 23})} :stmt_location 0 :stmt_len 0})
> ALTER SEQUENCE s INCREMENT BY -1.5
({RAWSTMT :stmt {ALTERSEQSTMT :sequence {RANGEVAR :catalogname <> :schemaname <> :relname s :inh true :relpersistence p :alias <> :location 15} :options ({DEFELEM :defnamespace <> :defname increment :arg -1.5 :defaction 0 :location 17}) :for_identity false :missing_ok false} :stmt_location 0 :stmt_len 0})
> CREATE SEQUENCE s MINVALUE -2.5
({RAWSTMT :stmt {CREATESEQSTMT :sequence {RANGEVAR :catalogname <> :schemaname <> :relname s :inh true :relpersistence p :alias <> :location 16} :options ({DEFELEM :defnamespace <> :defname minvalue :arg -2.5 :defaction 0 :location 18}) :ownerId 0 :for_identity false :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (MODULUS 4, REMAINDER 1)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname p1 :inh true :relpersistence p :alias <> :location 13} :tableElts <> :inhRelations ({RANGEVAR :catalogname <> :schemaname <> :relname p :inh true :relpersistence p :alias <> :location 29}) :partbound {PARTITIONBOUNDSPEC :strategy h :is_default false :modulus 4 :remainder 1 :listdatums <> :lowerdatums <> :upperdatums <> :location 42} :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (REMAINDER 1, MODULUS 4)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname p1 :inh true :relpersistence p :alias <> :location 13} :tableElts <> :inhRelations ({RANGEVAR :catalogname <> :schemaname <> :relname p :inh true :relpersistence p :alias <> :location 29}) :partbound {PARTITIONBOUNDSPEC :strategy h :is_default false :modulus 4 :remainder 1 :listdatums <> :lowerdatums <> :upperdatums <> :location 42} :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (MODULUS 4, MODULUS 3)
ERROR 42710 60 modulus for hash partition provided more than once
> CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (REMAINDER 1, REMAINDER 3)
ERROR 42710 62 remainder for hash partition provided more than once
> CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (MODULUS 4)
ERROR 42601 43 remainder for hash partition must be specified
> CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (REMAINDER 4)
ERROR 42601 43 modulus for hash partition must be specified
> CREATE TABLE p1 PARTITION OF p FOR VALUES WITH (MODULUS 4, REMAINDER 1, foo 2)
ERROR 42601 73 unrecognized hash partition bound specification "foo"
> UPDATE t SET (a, b) = (SELECT 1, 2)
({RAWSTMT :stmt {UPDATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 7} :targetList ({RESTARGET :name a :indirection <> :val {MULTIASSIGNREF :source {SUBLINK :subLinkType 4 :subLinkId 0 :testexpr <> :operName <> :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 30} :location 30} {RESTARGET :name <> :indirection <> :val {A_CONST :val 2 :location 33} :location 33}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 22} :colno 1 :ncolumns 2} :location 14} {RESTARGET :name b :indirection <> :val {MULTIASSIGNREF :source {SUBLINK :subLinkType 4 :subLinkId 0 :testexpr <> :operName <> :subselect {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 30} :location 30} {RESTARGET :name <> :indirection <> :val {A_CONST :val 2 :location 33} :location 33}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :location 22} :colno 2 :ncolumns 2} :location 17}) :whereClause <> :fromClause <> :returningClause <> :withClause <>} :stmt_location 0 :stmt_len 0})
> UPDATE t SET (a, b, c) = (1, 2, 3)
({RAWSTMT :stmt {UPDATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 7} :targetList ({RESTARGET :name a :indirection <> :val {MULTIASSIGNREF :source {ROWEXPR :args ({A_CONST :val 1 :location 26} {A_CONST :val 2 :location 29} {A_CONST :val 3 :location 32}) :row_typeid 0 :row_format 2 :colnames <> :location 25} :colno 1 :ncolumns 3} :location 14} {RESTARGET :name b :indirection <> :val {MULTIASSIGNREF :source {ROWEXPR :args ({A_CONST :val 1 :location 26} {A_CONST :val 2 :location 29} {A_CONST :val 3 :location 32}) :row_typeid 0 :row_format 2 :colnames <> :location 25} :colno 2 :ncolumns 3} :location 17} {RESTARGET :name c :indirection <> :val {MULTIASSIGNREF :source {ROWEXPR :args ({A_CONST :val 1 :location 26} {A_CONST :val 2 :location 29} {A_CONST :val 3 :location 32}) :row_typeid 0 :row_format 2 :colnames <> :location 25} :colno 3 :ncolumns 3} :location 20}) :whereClause <> :fromClause <> :returningClause <> :withClause <>} :stmt_location 0 :stmt_len 0})
> UPDATE t SET (a, b[1], c.d) = ROW(1, 2, 3)
({RAWSTMT :stmt {UPDATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 7} :targetList ({RESTARGET :name a :indirection <> :val {MULTIASSIGNREF :source {ROWEXPR :args ({A_CONST :val 1 :location 34} {A_CONST :val 2 :location 37} {A_CONST :val 3 :location 40}) :row_typeid 0 :row_format 0 :colnames <> :location 30} :colno 1 :ncolumns 3} :location 14} {RESTARGET :name b :indirection ({A_INDICES :is_slice false :lidx <> :uidx {A_CONST :val 1 :location 19}}) :val {MULTIASSIGNREF :source {ROWEXPR :args ({A_CONST :val 1 :location 34} {A_CONST :val 2 :location 37} {A_CONST :val 3 :location 40}) :row_typeid 0 :row_format 0 :colnames <> :location 30} :colno 2 :ncolumns 3} :location 17} {RESTARGET :name c :indirection ("d") :val {MULTIASSIGNREF :source {ROWEXPR :args ({A_CONST :val 1 :location 34} {A_CONST :val 2 :location 37} {A_CONST :val 3 :location 40}) :row_typeid 0 :row_format 0 :colnames <> :location 30} :colno 3 :ncolumns 3} :location 23}) :whereClause <> :fromClause <> :returningClause <> :withClause <>} :stmt_location 0 :stmt_len 0})
> SELECT * FROM XMLTABLE('/r' PASSING x COLUMNS a int PATH 'a' DEFAULT 1 NOT NULL)
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ({A_STAR}) :location 7} :location 7}) :fromClause ({RANGETABLEFUNC :lateral false :docexpr {COLUMNREF :fields ("x") :location 36} :rowexpr {A_CONST :val "/r" :location 23} :namespaces <> :columns ({RANGETABLEFUNCCOL :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 48} :for_ordinality false :is_not_null true :colexpr {A_CONST :val "a" :location 57} :coldefexpr {A_CONST :val 1 :location 69} :location 46}) :alias <> :location 14}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT * FROM XMLTABLE('/r' PASSING x COLUMNS a int PATH 'a' PATH 'b')
ERROR 42601 62 only one PATH value per column is allowed
> SELECT * FROM XMLTABLE('/r' PASSING x COLUMNS a int DEFAULT 1 DEFAULT 2)
ERROR 42601 63 only one DEFAULT value is allowed
> SELECT * FROM XMLTABLE('/r' PASSING x COLUMNS a int NULL NOT NULL)
ERROR 42601 58 conflicting or redundant NULL / NOT NULL declarations for column "a"
> SELECT * FROM XMLTABLE('/r' PASSING x COLUMNS a int NOT NULL NOT NULL)
ERROR 42601 62 conflicting or redundant NULL / NOT NULL declarations for column "a"
> SELECT * FROM XMLTABLE('/r' PASSING x COLUMNS a int NULL, b text)
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ({A_STAR}) :location 7} :location 7}) :fromClause ({RANGETABLEFUNC :lateral false :docexpr {COLUMNREF :fields ("x") :location 36} :rowexpr {A_CONST :val "/r" :location 23} :namespaces <> :columns ({RANGETABLEFUNCCOL :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 48} :for_ordinality false :is_not_null false :colexpr <> :coldefexpr <> :location 46} {RANGETABLEFUNCCOL :colname b :typeName {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 60} :for_ordinality false :is_not_null false :colexpr <> :coldefexpr <> :location 58}) :alias <> :location 14}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> SELECT * FROM XMLTABLE('/r' PASSING x COLUMNS a int foo 'x')
ERROR 42601 53 unrecognized column option "foo"
> SET TIME ZONE INTERVAL '+05:30' HOUR TO MINUTE
({RAWSTMT :stmt {VARIABLESETSTMT :kind 0 :name timezone :args ({TYPECAST :arg {A_CONST :val "\+05:30" :location 23} :typeName {TYPENAME :names ("pg_catalog" "interval") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 3072 :location 32}) :typemod -1 :arrayBounds <> :location 14} :location -1}) :jumble_args true :is_local false :location -1} :stmt_location 0 :stmt_len 0})
> SET TIME ZONE INTERVAL '+05' HOUR
({RAWSTMT :stmt {VARIABLESETSTMT :kind 0 :name timezone :args ({TYPECAST :arg {A_CONST :val "\+05" :location 23} :typeName {TYPENAME :names ("pg_catalog" "interval") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 1024 :location 29}) :typemod -1 :arrayBounds <> :location 14} :location -1}) :jumble_args true :is_local false :location -1} :stmt_location 0 :stmt_len 0})
> SET TIME ZONE INTERVAL '1' DAY
ERROR 42601 28 time zone interval must be HOUR or HOUR TO MINUTE
> SET TIME ZONE INTERVAL '1' YEAR TO MONTH
ERROR 42601 28 time zone interval must be HOUR or HOUR TO MINUTE
> SET TIME ZONE INTERVAL '+05:30'
({RAWSTMT :stmt {VARIABLESETSTMT :kind 0 :name timezone :args ({TYPECAST :arg {A_CONST :val "\+05:30" :location 23} :typeName {TYPENAME :names ("pg_catalog" "interval") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 14} :location -1}) :jumble_args true :is_local false :location -1} :stmt_location 0 :stmt_len 0})
> SET TIME ZONE INTERVAL(3) '+05:30'
({RAWSTMT :stmt {VARIABLESETSTMT :kind 0 :name timezone :args ({TYPECAST :arg {A_CONST :val "\+05:30" :location 26} :typeName {TYPENAME :names ("pg_catalog" "interval") :typeOid 0 :setof false :pct_type false :typmods ({A_CONST :val 32767 :location -1} {A_CONST :val 3 :location 23}) :typemod -1 :arrayBounds <> :location 14} :location -1}) :jumble_args true :is_local false :location -1} :stmt_location 0 :stmt_len 0})
> CREATE RECURSIVE VIEW v (a, b) AS SELECT 1, 2
({RAWSTMT :stmt {VIEWSTMT :view {RANGEVAR :catalogname <> :schemaname <> :relname v :inh true :relpersistence p :alias <> :location 22} :aliases ("a" "b") :query {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("a") :location -1} :location -1} {RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("b") :location -1} :location -1}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname v :inh true :relpersistence p :alias <> :location -1}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause {WITHCLAUSE :ctes ({COMMONTABLEEXPR :ctename v :aliascolnames ("a" "b") :ctematerialized 0 :ctequery {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 41} :location 41} {RESTARGET :name <> :indirection <> :val {A_CONST :val 2 :location 44} :location 44}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :search_clause <> :cycle_clause <> :location -1 :cterecursive false :cterefcount 0 :ctecolnames <> :ctecoltypes <> :ctecoltypmods <> :ctecolcollations <>}) :recursive true :location -1} :op 0 :all false :larg <> :rarg <>} :replace false :options <> :withCheckOption 0} :stmt_location 0 :stmt_len 0})
> CREATE OR REPLACE RECURSIVE VIEW s.v (n) AS VALUES (1) UNION ALL SELECT n + 1 FROM v WHERE n < 10
({RAWSTMT :stmt {VIEWSTMT :view {RANGEVAR :catalogname <> :schemaname s :relname v :inh true :relpersistence p :alias <> :location 33} :aliases ("n") :query {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("n") :location -1} :location -1}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname v :inh true :relpersistence p :alias <> :location -1}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause {WITHCLAUSE :ctes ({COMMONTABLEEXPR :ctename v :aliascolnames ("n") :ctematerialized 0 :ctequery {SELECTSTMT :distinctClause <> :intoClause <> :targetList <> :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 1 :all true :larg {SELECTSTMT :distinctClause <> :intoClause <> :targetList <> :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists (({A_CONST :val 1 :location 52})) :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :rarg {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_EXPR :name ("+") :lexpr {COLUMNREF :fields ("n") :location 72} :rexpr {A_CONST :val 1 :location 76} :rexpr_list_start 0 :rexpr_list_end 0 :location 74} :location 72}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname v :inh true :relpersistence p :alias <> :location 83}) :whereClause {A_EXPR :name ("\<") :lexpr {COLUMNREF :fields ("n") :location 91} :rexpr {A_CONST :val 10 :location 95} :rexpr_list_start 0 :rexpr_list_end 0 :location 93} :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>}} :search_clause <> :cycle_clause <> :location -1 :cterecursive false :cterefcount 0 :ctecolnames <> :ctecoltypes <> :ctecoltypmods <> :ctecolcollations <>}) :recursive true :location -1} :op 0 :all false :larg <> :rarg <>} :replace true :options <> :withCheckOption 0} :stmt_location 0 :stmt_len 0})
> CREATE RECURSIVE VIEW v (a) AS SELECT 1 WITH CHECK OPTION
ERROR 0A000 41 WITH CHECK OPTION not supported on recursive views
> CREATE TEMP RECURSIVE VIEW v (a) WITH (security_barrier) AS SELECT 1
({RAWSTMT :stmt {VIEWSTMT :view {RANGEVAR :catalogname <> :schemaname <> :relname v :inh true :relpersistence t :alias <> :location 27} :aliases ("a") :query {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ("a") :location -1} :location -1}) :fromClause ({RANGEVAR :catalogname <> :schemaname <> :relname v :inh true :relpersistence p :alias <> :location -1}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause {WITHCLAUSE :ctes ({COMMONTABLEEXPR :ctename v :aliascolnames ("a") :ctematerialized 0 :ctequery {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 67} :location 67}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :search_clause <> :cycle_clause <> :location -1 :cterecursive false :cterefcount 0 :ctecolnames <> :ctecoltypes <> :ctecoltypmods <> :ctecolcollations <>}) :recursive true :location -1} :op 0 :all false :larg <> :rarg <>} :replace false :options ({DEFELEM :defnamespace <> :defname security_barrier :arg <> :defaction 0 :location 39}) :withCheckOption 0} :stmt_location 0 :stmt_len 0})
> CREATE FUNCTION f(a int) RETURNS TABLE (b int) AS 'select 1' LANGUAGE sql
({RAWSTMT :stmt {CREATEFUNCTIONSTMT :is_procedure false :replace false :funcname ("f") :parameters ({FUNCTIONPARAMETER :name a :argType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 20} :mode 100 :defexpr <> :location 18} {FUNCTIONPARAMETER :name b :argType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 42} :mode 116 :defexpr <> :location 40}) :returnType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof true :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 33} :options ({DEFELEM :defnamespace <> :defname as :arg ("select\ 1") :defaction 0 :location 47} {DEFELEM :defnamespace <> :defname language :arg "sql" :defaction 0 :location 61}) :sql_body <>} :stmt_location 0 :stmt_len 0})
> CREATE FUNCTION f(a int) RETURNS TABLE (b int, c text) AS 'select 1' LANGUAGE sql
({RAWSTMT :stmt {CREATEFUNCTIONSTMT :is_procedure false :replace false :funcname ("f") :parameters ({FUNCTIONPARAMETER :name a :argType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 20} :mode 100 :defexpr <> :location 18} {FUNCTIONPARAMETER :name b :argType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 42} :mode 116 :defexpr <> :location 40} {FUNCTIONPARAMETER :name c :argType {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 49} :mode 116 :defexpr <> :location 47}) :returnType {TYPENAME :names ("pg_catalog" "record") :typeOid 0 :setof true :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 33} :options ({DEFELEM :defnamespace <> :defname as :arg ("select\ 1") :defaction 0 :location 55} {DEFELEM :defnamespace <> :defname language :arg "sql" :defaction 0 :location 69}) :sql_body <>} :stmt_location 0 :stmt_len 0})
> CREATE FUNCTION f(OUT a int) RETURNS TABLE (b int) AS 'select 1' LANGUAGE sql
ERROR 42601 19 OUT and INOUT arguments aren't allowed in TABLE functions
> CREATE FUNCTION f(INOUT a int) RETURNS TABLE (b int) AS 'select 1' LANGUAGE sql
ERROR 42601 19 OUT and INOUT arguments aren't allowed in TABLE functions
> CREATE FUNCTION f(VARIADIC a int[]) RETURNS TABLE (b int[]) AS 'select 1' LANGUAGE sql
({RAWSTMT :stmt {CREATEFUNCTIONSTMT :is_procedure false :replace false :funcname ("f") :parameters ({FUNCTIONPARAMETER :name a :argType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds (-1) :location 29} :mode 118 :defexpr <> :location 18} {FUNCTIONPARAMETER :name b :argType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds (-1) :location 53} :mode 116 :defexpr <> :location 51}) :returnType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof true :pct_type false :typmods <> :typemod -1 :arrayBounds (-1) :location 44} :options ({DEFELEM :defnamespace <> :defname as :arg ("select\ 1") :defaction 0 :location 60} {DEFELEM :defnamespace <> :defname language :arg "sql" :defaction 0 :location 74}) :sql_body <>} :stmt_location 0 :stmt_len 0})
> CREATE PUBLICATION p FOR ALL TABLES
({RAWSTMT :stmt {CREATEPUBLICATIONSTMT :pubname p :options <> :pubobjects <> :for_all_tables true :for_all_sequences false} :stmt_location 0 :stmt_len 0})
> CREATE PUBLICATION p FOR ALL SEQUENCES
({RAWSTMT :stmt {CREATEPUBLICATIONSTMT :pubname p :options <> :pubobjects <> :for_all_tables false :for_all_sequences true} :stmt_location 0 :stmt_len 0})
> CREATE PUBLICATION p FOR ALL TABLES, ALL SEQUENCES
({RAWSTMT :stmt {CREATEPUBLICATIONSTMT :pubname p :options <> :pubobjects <> :for_all_tables true :for_all_sequences true} :stmt_location 0 :stmt_len 0})
> CREATE PUBLICATION p FOR ALL TABLES, ALL TABLES
ERROR 42601 38 invalid publication object list
DETAIL ALL TABLES can be specified only once.
> CREATE PUBLICATION p FOR ALL SEQUENCES, ALL SEQUENCES
ERROR 42601 41 invalid publication object list
DETAIL ALL SEQUENCES can be specified only once.
> CREATE PUBLICATION p FOR ALL TABLES EXCEPT (TABLE a, b)
({RAWSTMT :stmt {CREATEPUBLICATIONSTMT :pubname p :options <> :pubobjects ({PUBLICATIONOBJSPEC :pubobjtype 1 :name <> :pubtable {PUBLICATIONTABLE :relation {RANGEVAR :catalogname <> :schemaname <> :relname a :inh true :relpersistence p :alias <> :location 50} :whereClause <> :columns <> :except true} :location 50} {PUBLICATIONOBJSPEC :pubobjtype 1 :name <> :pubtable {PUBLICATIONTABLE :relation {RANGEVAR :catalogname <> :schemaname <> :relname b :inh true :relpersistence p :alias <> :location 53} :whereClause <> :columns <> :except true} :location 53}) :for_all_tables true :for_all_sequences false} :stmt_location 0 :stmt_len 0})
> CREATE PUBLICATION p FOR ALL TABLES EXCEPT TABLE a, b
ERROR 42601 44 syntax error at or near "TABLE"
> ALTER PUBLICATION p SET ALL TABLES
({RAWSTMT :stmt {ALTERPUBLICATIONSTMT :pubname p :options <> :pubobjects <> :action 2 :for_all_tables true :for_all_sequences false} :stmt_location 0 :stmt_len 0})
> ALTER PUBLICATION p SET ALL TABLES, ALL TABLES
ERROR 42601 37 invalid publication object list
DETAIL ALL TABLES can be specified only once.
> CREATE CAST (int AS text) WITH FUNCTION f(int) AS IMPLICIT
({RAWSTMT :stmt {CREATECASTSTMT :sourcetype {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 13} :targettype {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 20} :func {OBJECTWITHARGS :objname ("f") :objargs ({TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 42}) :objfuncargs ({FUNCTIONPARAMETER :name <> :argType {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 42} :mode 100 :defexpr <> :location 42}) :args_unspecified false} :context 0 :inout false} :stmt_location 0 :stmt_len 0})
> CREATE CAST (int AS text) WITH FUNCTION f AS ASSIGNMENT
({RAWSTMT :stmt {CREATECASTSTMT :sourcetype {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 13} :targettype {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 20} :func {OBJECTWITHARGS :objname ("f") :objargs <> :objfuncargs <> :args_unspecified true} :context 1 :inout false} :stmt_location 0 :stmt_len 0})
> CREATE CAST (int AS text) WITHOUT FUNCTION
({RAWSTMT :stmt {CREATECASTSTMT :sourcetype {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 13} :targettype {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 20} :func <> :context 3 :inout false} :stmt_location 0 :stmt_len 0})
> CREATE CAST (int AS text) WITH INOUT AS ASSIGNMENT
({RAWSTMT :stmt {CREATECASTSTMT :sourcetype {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 13} :targettype {TYPENAME :names ("text") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 20} :func <> :context 1 :inout true} :stmt_location 0 :stmt_len 0})
> CREATE TRIGGER t BEFORE INSERT ON a FOR EACH ROW EXECUTE FUNCTION f()
({RAWSTMT :stmt {CREATETRIGSTMT :replace false :isconstraint false :trigname t :relation {RANGEVAR :catalogname <> :schemaname <> :relname a :inh true :relpersistence p :alias <> :location 34} :funcname ("f") :args <> :row true :timing 2 :events 4 :columns <> :whenClause <> :transitionRels <> :deferrable false :initdeferred false :constrrel <>} :stmt_location 0 :stmt_len 0})
> CREATE CONSTRAINT TRIGGER t AFTER INSERT ON a DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE FUNCTION f()
({RAWSTMT :stmt {CREATETRIGSTMT :replace false :isconstraint true :trigname t :relation {RANGEVAR :catalogname <> :schemaname <> :relname a :inh true :relpersistence p :alias <> :location 44} :funcname ("f") :args <> :row true :timing 0 :events 4 :columns <> :whenClause <> :transitionRels <> :deferrable true :initdeferred true :constrrel <>} :stmt_location 0 :stmt_len 0})
> CREATE CONSTRAINT TRIGGER t AFTER INSERT ON a NOT VALID FOR EACH ROW EXECUTE FUNCTION f()
ERROR 0A000 47 constraint triggers cannot be marked NOT VALID
> CREATE CONSTRAINT TRIGGER t AFTER INSERT ON a NO INHERIT FOR EACH ROW EXECUTE FUNCTION f()
ERROR 0A000 47 constraint triggers cannot be marked NO INHERIT
> REVOKE ADMIN OPTION FOR r FROM u
({RAWSTMT :stmt {GRANTROLESTMT :granted_roles ({ACCESSPRIV :priv_name r :cols <>}) :grantee_roles ({ROLESPEC :roletype 0 :rolename u :location 31}) :is_grant false :opt ({DEFELEM :defnamespace <> :defname admin :arg false :defaction 0 :location 7}) :grantor <> :behavior 0} :stmt_location 0 :stmt_len 0})
> REVOKE INHERIT OPTION FOR r FROM u CASCADE
({RAWSTMT :stmt {GRANTROLESTMT :granted_roles ({ACCESSPRIV :priv_name r :cols <>}) :grantee_roles ({ROLESPEC :roletype 0 :rolename u :location 33}) :is_grant false :opt ({DEFELEM :defnamespace <> :defname inherit :arg false :defaction 0 :location 7}) :grantor <> :behavior 1} :stmt_location 0 :stmt_len 0})
> REVOKE SET OPTION FOR r FROM u GRANTED BY v
({RAWSTMT :stmt {GRANTROLESTMT :granted_roles ({ACCESSPRIV :priv_name r :cols <>}) :grantee_roles ({ROLESPEC :roletype 0 :rolename u :location 29}) :is_grant false :opt ({DEFELEM :defnamespace <> :defname set :arg false :defaction 0 :location 7}) :grantor {ROLESPEC :roletype 0 :rolename v :location 42} :behavior 0} :stmt_location 0 :stmt_len 0})
> CREATE ASSERTION a CHECK (true)
ERROR 0A000 1 CREATE ASSERTION is not yet implemented
> CREATE TABLE t (a int REFERENCES b MATCH PARTIAL)
ERROR 0A000 36 MATCH PARTIAL not yet implemented
> CREATE TABLE t (a int REFERENCES b MATCH FULL)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 13} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 18} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints ({CONSTRAINT :contype 9 :conname <> :deferrable false :initdeferred false :is_enforced true :skip_validation false :initially_valid true :is_no_inherit false :raw_expr <> :cooked_expr <> :generated_when <> :generated_kind <> :nulls_not_distinct false :keys <> :without_overlaps false :including <> :exclusions <> :options <> :indexname <> :indexspace <> :reset_default_tblspc false :access_method <> :where_clause <> :pktable {RANGEVAR :catalogname <> :schemaname <> :relname b :inh true :relpersistence p :alias <> :location 33} :fk_attrs <> :pk_attrs <> :fk_with_period false :pk_with_period false :fk_matchtype f :fk_upd_action a :fk_del_action a :fk_del_set_cols <> :old_conpfeqop <> :old_pktable_oid 0 :location 22}) :fdwoptions <> :location 16}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> SET SESSION AUTHORIZATION DEFAULT
({RAWSTMT :stmt {VARIABLESETSTMT :kind 1 :name session_authorization :args <> :jumble_args false :is_local false :location -1} :stmt_location 0 :stmt_len 0})
> SET XML OPTION DOCUMENT
({RAWSTMT :stmt {VARIABLESETSTMT :kind 0 :name xmloption :args ({A_CONST :val "DOCUMENT" :location 15}) :jumble_args true :is_local false :location -1} :stmt_location 0 :stmt_len 0})
> SET TRANSACTION SNAPSHOT 'x'
({RAWSTMT :stmt {VARIABLESETSTMT :kind 3 :name TRANSACTION\ SNAPSHOT :args ({A_CONST :val "x" :location 25}) :jumble_args false :is_local false :location 25} :stmt_location 0 :stmt_len 0})
> CREATE TABLE t (a int, FOREIGN KEY (a, PERIOD b) REFERENCES c (x, PERIOD y))
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 13} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 18} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 16} {CONSTRAINT :contype 9 :conname <> :deferrable false :initdeferred false :is_enforced true :skip_validation false :initially_valid true :is_no_inherit false :raw_expr <> :cooked_expr <> :generated_when <> :generated_kind <> :nulls_not_distinct false :keys <> :without_overlaps false :including <> :exclusions <> :options <> :indexname <> :indexspace <> :reset_default_tblspc false :access_method <> :where_clause <> :pktable {RANGEVAR :catalogname <> :schemaname <> :relname c :inh true :relpersistence p :alias <> :location 60} :fk_attrs ("a" "b") :pk_attrs ("x" "y") :fk_with_period true :pk_with_period true :fk_matchtype s :fk_upd_action a :fk_del_action a :fk_del_set_cols <> :old_conpfeqop <> :old_pktable_oid 0 :location 23}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE TABLE t (a int, FOREIGN KEY (a, PERIOD b) REFERENCES c)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 13} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 18} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 16} {CONSTRAINT :contype 9 :conname <> :deferrable false :initdeferred false :is_enforced true :skip_validation false :initially_valid true :is_no_inherit false :raw_expr <> :cooked_expr <> :generated_when <> :generated_kind <> :nulls_not_distinct false :keys <> :without_overlaps false :including <> :exclusions <> :options <> :indexname <> :indexspace <> :reset_default_tblspc false :access_method <> :where_clause <> :pktable {RANGEVAR :catalogname <> :schemaname <> :relname c :inh true :relpersistence p :alias <> :location 60} :fk_attrs ("a" "b") :pk_attrs <> :fk_with_period true :pk_with_period false :fk_matchtype s :fk_upd_action a :fk_del_action a :fk_del_set_cols <> :old_conpfeqop <> :old_pktable_oid 0 :location 23}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE TABLE t (a int, FOREIGN KEY (a) REFERENCES c (x, PERIOD y))
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 13} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 18} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 16} {CONSTRAINT :contype 9 :conname <> :deferrable false :initdeferred false :is_enforced true :skip_validation false :initially_valid true :is_no_inherit false :raw_expr <> :cooked_expr <> :generated_when <> :generated_kind <> :nulls_not_distinct false :keys <> :without_overlaps false :including <> :exclusions <> :options <> :indexname <> :indexspace <> :reset_default_tblspc false :access_method <> :where_clause <> :pktable {RANGEVAR :catalogname <> :schemaname <> :relname c :inh true :relpersistence p :alias <> :location 50} :fk_attrs ("a") :pk_attrs ("x" "y") :fk_with_period false :pk_with_period true :fk_matchtype s :fk_upd_action a :fk_del_action a :fk_del_set_cols <> :old_conpfeqop <> :old_pktable_oid 0 :location 23}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE TABLE t (a int, FOREIGN KEY (a) REFERENCES c ON DELETE SET NULL (a) NOT VALID)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 13} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 18} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 16} {CONSTRAINT :contype 9 :conname <> :deferrable false :initdeferred false :is_enforced true :skip_validation true :initially_valid false :is_no_inherit false :raw_expr <> :cooked_expr <> :generated_when <> :generated_kind <> :nulls_not_distinct false :keys <> :without_overlaps false :including <> :exclusions <> :options <> :indexname <> :indexspace <> :reset_default_tblspc false :access_method <> :where_clause <> :pktable {RANGEVAR :catalogname <> :schemaname <> :relname c :inh true :relpersistence p :alias <> :location 50} :fk_attrs ("a") :pk_attrs <> :fk_with_period false :pk_with_period false :fk_matchtype s :fk_upd_action a :fk_del_action n :fk_del_set_cols ("a") :old_conpfeqop <> :old_pktable_oid 0 :location 23}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE INDEX ON t (a)
({RAWSTMT :stmt {INDEXSTMT :idxname <> :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence p :alias <> :location 16} :accessMethod btree :tableSpace <> :indexParams ({INDEXELEM :name a :expr <> :indexcolname <> :collation <> :opclass <> :opclassopts <> :ordering 0 :nulls_ordering 0 :location 19}) :indexIncludingParams <> :options <> :whereClause <> :excludeOpNames <> :idxcomment <> :indexOid 0 :oldNumber 0 :oldCreateSubid 0 :oldFirstRelfilelocatorSubid 0 :unique false :nulls_not_distinct false :primary false :isconstraint false :iswithoutoverlaps false :deferrable false :initdeferred false :transformed false :concurrent false :if_not_exists false :reset_default_tblspc false} :stmt_location 0 :stmt_len 0})
> CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS i ON ONLY t USING btree (a) INCLUDE (b) NULLS NOT DISTINCT WITH (fillfactor = 70) TABLESPACE x WHERE a > 0
({RAWSTMT :stmt {INDEXSTMT :idxname i :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh false :relpersistence p :alias <> :location 57} :accessMethod btree :tableSpace x :indexParams ({INDEXELEM :name a :expr <> :indexcolname <> :collation <> :opclass <> :opclassopts <> :ordering 0 :nulls_ordering 0 :location 72}) :indexIncludingParams ({INDEXELEM :name b :expr <> :indexcolname <> :collation <> :opclass <> :opclassopts <> :ordering 0 :nulls_ordering 0 :location 84}) :options ({DEFELEM :defnamespace <> :defname fillfactor :arg 70 :defaction 0 :location 112}) :whereClause {A_EXPR :name (">") :lexpr {COLUMNREF :fields ("a") :location 148} :rexpr {A_CONST :val 0 :location 152} :rexpr_list_start 0 :rexpr_list_end 0 :location 150} :excludeOpNames <> :idxcomment <> :indexOid 0 :oldNumber 0 :oldCreateSubid 0 :oldFirstRelfilelocatorSubid 0 :unique true :nulls_not_distinct true :primary false :isconstraint false :iswithoutoverlaps false :deferrable false :initdeferred false :transformed false :concurrent true :if_not_exists true :reset_default_tblspc false} :stmt_location 0 :stmt_len 0})
> CREATE GLOBAL TEMP TABLE t (a int)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence t :alias <> :location 25} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 30} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 28}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> CREATE GLOBAL TEMPORARY TABLE t (a int)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence t :alias <> :location 30} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 35} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 33}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> SELECT 1 INTO GLOBAL TEMP t
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause {INTOCLAUSE :rel {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence t :alias <> :location 26} :colNames <> :accessMethod <> :options <> :onCommit 0 :tableSpaceName <> :viewQuery <> :skipData false} :targetList ({RESTARGET :name <> :indirection <> :val {A_CONST :val 1 :location 7} :location 7}) :fromClause <> :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> CREATE LOCAL TEMP TABLE t (a int)
({RAWSTMT :stmt {CREATESTMT :relation {RANGEVAR :catalogname <> :schemaname <> :relname t :inh true :relpersistence t :alias <> :location 24} :tableElts ({COLUMNDEF :colname a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 29} :compression <> :inhcount 0 :is_local true :is_not_null false :is_from_type false :storage <> :storage_name <> :raw_default <> :cooked_default <> :identity <> :identitySequence <> :generated <> :collClause <> :collOid 0 :constraints <> :fdwoptions <> :location 27}) :inhRelations <> :partbound <> :partspec <> :ofTypename <> :constraints <> :nnconstraints <> :options <> :oncommit 0 :tablespacename <> :accessMethod <> :if_not_exists false} :stmt_location 0 :stmt_len 0})
> SELECT * FROM JSON_TABLE(j, '$' COLUMNS (a int PATH '$.a'))
({RAWSTMT :stmt {SELECTSTMT :distinctClause <> :intoClause <> :targetList ({RESTARGET :name <> :indirection <> :val {COLUMNREF :fields ({A_STAR}) :location 7} :location 7}) :fromClause ({JSONTABLE :context_item {JSONVALUEEXPR :raw_expr {COLUMNREF :fields ("j") :location 25} :formatted_expr <> :format {JSONFORMAT :format_type 0 :encoding 0 :location -1}} :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$" :location 28} :name <> :name_location -1 :location 28} :passing <> :columns ({JSONTABLECOLUMN :coltype 1 :name a :typeName {TYPENAME :names ("pg_catalog" "int4") :typeOid 0 :setof false :pct_type false :typmods <> :typemod -1 :arrayBounds <> :location 43} :pathspec {JSONTABLEPATHSPEC :string {A_CONST :val "$.a" :location 52} :name <> :name_location -1 :location 52} :format {JSONFORMAT :format_type 0 :encoding 0 :location -1} :wrapper 0 :quotes 0 :columns <> :on_empty <> :on_error <> :location 41}) :on_error <> :alias <> :lateral false :location 14}) :whereClause <> :groupClause <> :groupDistinct false :havingClause <> :windowClause <> :valuesLists <> :sortClause <> :limitOffset <> :limitCount <> :limitOption 0 :lockingClause <> :withClause <> :op 0 :all false :larg <> :rarg <>} :stmt_location 0 :stmt_len 0})
> CREATE TABLE a PARTITION OF p FOR VALUES WITH (MODULUS 4, MODULUS 3)
ERROR 42710 59 modulus for hash partition provided more than once
> CREATE TABLE a PARTITION OF p FOR VALUES WITH (REMAINDER 1, REMAINDER 3)
ERROR 42710 61 remainder for hash partition provided more than once
> CREATE TABLE a PARTITION OF p FOR VALUES WITH (foo 2)
ERROR 42601 48 unrecognized hash partition bound specification "foo"
> SELECT FROM XMLTABLE('/' PASSING x COLUMNS a int PATH 'a' PATH 'b')
ERROR 42601 59 only one PATH value per column is allowed
> SELECT FROM XMLTABLE('/' PASSING x COLUMNS a int DEFAULT 1 DEFAULT 2)
ERROR 42601 60 only one DEFAULT value is allowed
> SELECT FROM XMLTABLE('/' PASSING x COLUMNS a int NULL NOT NULL)
ERROR 42601 55 conflicting or redundant NULL / NOT NULL declarations for column "a"
> SELECT FROM XMLTABLE('/' PASSING x COLUMNS a int NOT NULL NULL)
ERROR 42601 59 conflicting or redundant NULL / NOT NULL declarations for column "a"