From 44a1cd02b9d9f3e11eed6d02ac5fe4649e6f6dd7 Mon Sep 17 00:00:00 2001 From: Maxim Yurchuk Date: Fri, 5 Jul 2024 16:27:50 +0300 Subject: [PATCH] Initial commit for stable-24-3 (#6321) --- .github/config/muted_ya.txt | 1 + ydb/apps/version/version_definition.cpp | 17 +- ydb/core/driver_lib/version/version.cpp | 8 +- ydb/core/formats/arrow/ssa_runtime_version.h | 2 +- ydb/core/protos/feature_flags.proto | 10 +- ydb/core/protos/table_service_config.proto | 6 +- .../yql/minikql/mkql_runtime_version.h | 2 +- .../yql/tests/postgresql/cases/json.err | 3999 ---------- .../yql/tests/postgresql/cases/json.out | 999 --- .../yql/tests/postgresql/cases/json.sql | 271 - .../yql/tests/postgresql/cases/jsonb.err | 6964 ----------------- .../yql/tests/postgresql/cases/jsonb.out | 2987 ------- .../yql/tests/postgresql/cases/jsonb.sql | 627 -- .../yql/tests/postgresql/cases/select.err | 656 -- .../yql/tests/postgresql/cases/select.out | 204 - .../yql/tests/postgresql/cases/select.sql | 52 - .../sql/suites/pg/record_from_table_row.sql | 4 - .../join_join_range_right.sql.plan | 8 +- 18 files changed, 37 insertions(+), 16780 deletions(-) delete mode 100644 ydb/library/yql/tests/postgresql/cases/json.err delete mode 100644 ydb/library/yql/tests/postgresql/cases/json.out delete mode 100644 ydb/library/yql/tests/postgresql/cases/json.sql delete mode 100644 ydb/library/yql/tests/postgresql/cases/jsonb.err delete mode 100644 ydb/library/yql/tests/postgresql/cases/jsonb.out delete mode 100644 ydb/library/yql/tests/postgresql/cases/jsonb.sql delete mode 100644 ydb/library/yql/tests/postgresql/cases/select.err delete mode 100644 ydb/library/yql/tests/postgresql/cases/select.out delete mode 100644 ydb/library/yql/tests/postgresql/cases/select.sql delete mode 100644 ydb/library/yql/tests/sql/suites/pg/record_from_table_row.sql diff --git a/.github/config/muted_ya.txt b/.github/config/muted_ya.txt index 63a8df0cbe9f..af469721619e 100644 --- a/.github/config/muted_ya.txt +++ b/.github/config/muted_ya.txt @@ -98,6 +98,7 @@ ydb/tests/fq/yds * ydb/tests/fq/control_plane_storage * ydb/tests/functional/audit * ydb/tests/functional/blobstorage test_replication.py.TestReplicationAfterNodesRestart.test_replication* +ydb/tests/functional/clickbench test.py.test_plans[column] ydb/tests/functional/kqp/kqp_indexes ConsistentIndexRead.InteractiveTx ydb/tests/functional/kqp/kqp_query_session KqpQuerySession.NoLocalAttach ydb/tests/functional/restarts test_restarts.py.* diff --git a/ydb/apps/version/version_definition.cpp b/ydb/apps/version/version_definition.cpp index 4cfb93b74f79..8d7273d188fc 100644 --- a/ydb/apps/version/version_definition.cpp +++ b/ydb/apps/version/version_definition.cpp @@ -2,10 +2,21 @@ NKikimrConfig::TCurrentCompatibilityInfo NKikimr::TCompatibilityInfo::MakeCurrent() { using TCurrentConstructor = NKikimr::TCompatibilityInfo::TProtoConstructor::TCurrentCompatibilityInfo; - // using TVersionConstructor = NKikimr::TCompatibilityInfo::TProtoConstructor::TVersion; - // using TCompatibilityRuleConstructor = NKikimr::TCompatibilityInfo::TProtoConstructor::TCompatibilityRule; + using TVersionConstructor = NKikimr::TCompatibilityInfo::TProtoConstructor::TVersion; + using TCompatibilityRuleConstructor = NKikimr::TCompatibilityInfo::TProtoConstructor::TCompatibilityRule; return TCurrentConstructor{ .Application = "ydb", + .Version = TVersionConstructor{ + .Year = 24, + .Major = 3, + }, + .CanConnectTo = { + TCompatibilityRuleConstructor{ + .Application = "nbs", + .LowerLimit = TVersionConstructor{ .Year = 23, .Major = 3 }, + .UpperLimit = TVersionConstructor{ .Year = 24, .Major = 3 }, + } + } }.ToPB(); -} +} \ No newline at end of file diff --git a/ydb/core/driver_lib/version/version.cpp b/ydb/core/driver_lib/version/version.cpp index adc22dfeeca6..85effd8a57d0 100644 --- a/ydb/core/driver_lib/version/version.cpp +++ b/ydb/core/driver_lib/version/version.cpp @@ -26,7 +26,8 @@ TCompatibilityInfo::TCompatibilityInfo() { auto current = MakeCurrent(); - // bool success = CompleteFromTag(current); + bool success = CompleteFromTag(current); + Y_UNUSED(success); // Y_ABORT_UNLESS(success); CurrentCompatibilityInfo.CopyFrom(current); @@ -72,12 +73,13 @@ const TStored* TCompatibilityInfo::GetDefault(TComponentId componentId) const { // obsolete version control TMaybe VERSION = NActors::TInterconnectProxyCommon::TVersionInfo{ // version of this binary - "trunk", + "stable-24-3", // compatible versions; must include all compatible old ones, including this one; version verification occurs on both // peers and connection is accepted if at least one of peers accepts the version of the other peer { - "trunk" + "stable-24-2", + "stable-24-3" } }; diff --git a/ydb/core/formats/arrow/ssa_runtime_version.h b/ydb/core/formats/arrow/ssa_runtime_version.h index 500074420fda..cdf3f6bdc09d 100644 --- a/ydb/core/formats/arrow/ssa_runtime_version.h +++ b/ydb/core/formats/arrow/ssa_runtime_version.h @@ -19,7 +19,7 @@ namespace NKikimr::NSsa { // Bump this version every time incompatible runtime functions are introduced. #ifndef SSA_RUNTIME_VERSION -#define SSA_RUNTIME_VERSION 5U +#define SSA_RUNTIME_VERSION 4U #endif // History: diff --git a/ydb/core/protos/feature_flags.proto b/ydb/core/protos/feature_flags.proto index eaf0172f27b8..fbf345b2ad71 100644 --- a/ydb/core/protos/feature_flags.proto +++ b/ydb/core/protos/feature_flags.proto @@ -97,15 +97,15 @@ message TFeatureFlags { optional bool EnableAlterDatabaseCreateHiveFirst = 82 [default = false]; reserved 83; // EnableKqpDataQuerySourceRead optional bool EnableSmallDiskOptimization = 84 [default = true]; - optional bool EnableDataShardVolatileTransactions = 85 [default = true]; + optional bool EnableDataShardVolatileTransactions = 85 [default = false]; optional bool EnableTopicServiceTx = 86 [default = false]; - optional bool EnableLLVMCache = 87 [default = false]; + optional bool EnableLLVMCache = 87 [default = true]; optional bool EnableExternalDataSources = 88 [default = false]; optional bool EnableTopicDiskSubDomainQuota = 89 [default = true]; - optional bool EnableSeparationComputeActorsFromRead = 90 [default = false]; + optional bool EnableSeparationComputeActorsFromRead = 90 [default = true]; optional bool EnablePQConfigTransactionsAtSchemeShard = 91 [default = false]; optional bool EnableScriptExecutionOperations = 92 [default = true]; - optional bool EnableImplicitQueryParameterTypes = 93 [default = true]; + optional bool EnableImplicitQueryParameterTypes = 93 [default = false]; optional bool EnableForceImmediateEffectsExecution = 94 [default = false]; optional bool EnableTopicSplitMerge = 95 [default = false]; optional bool EnableChangefeedDynamoDBStreamsFormat = 96 [default = true]; @@ -121,7 +121,7 @@ message TFeatureFlags { optional bool EnableStatistics = 106 [default = false]; optional bool EnableUuidAsPrimaryKey = 107 [default = false]; optional bool EnableTablePgTypes = 108 [default = false]; - optional bool EnableLocalDBBtreeIndex = 109 [default = true]; + optional bool EnableLocalDBBtreeIndex = 109 [default = false]; optional bool EnablePDiskHighHDDInFlight = 110 [default = false]; optional bool UseVDisksBalancing = 111 [default = false]; optional bool EnableViews = 112 [default = false]; diff --git a/ydb/core/protos/table_service_config.proto b/ydb/core/protos/table_service_config.proto index ad87e0afe42f..d98a24fd8fb3 100644 --- a/ydb/core/protos/table_service_config.proto +++ b/ydb/core/protos/table_service_config.proto @@ -225,7 +225,7 @@ message TTableServiceConfig { optional uint64 SessionIdleDurationSeconds = 28 [default = 600]; optional TAggregationConfig AggregationConfig = 29; optional bool EnableKqpScanQueryStreamLookup = 30 [default = true]; - optional bool EnableKqpDataQueryStreamLookup = 31 [default = true]; + optional bool EnableKqpDataQueryStreamLookup = 31 [default = false]; optional TExecuterRetriesConfig ExecuterRetriesConfig = 32; reserved 33; // optional bool EnableKqpDataQueryStreamPointLookup = 33 [default = false]; optional bool EnablePublishKqpProxyByRM = 34 [default = true]; @@ -236,7 +236,7 @@ message TTableServiceConfig { optional bool EnableKqpImmediateEffects = 38 [default = true]; reserved 39; // optional bool EnableSequentialReads = 39 [default = true]; optional bool EnablePreparedDdl = 42 [default = true]; - optional bool EnableSequences = 43 [default = true]; + optional bool EnableSequences = 43 [default = false]; optional bool EnableAsyncComputationPatternCompilation = 48 [default = true]; optional TCompileComputationPatternServiceConfig CompileComputationPatternServiceConfig = 47; @@ -280,7 +280,7 @@ message TTableServiceConfig { optional bool EnableCreateTableAs = 57 [default = true]; optional uint64 IdxLookupJoinPointsLimit = 58 [default = 1]; - optional bool OldLookupJoinBehaviour = 59 [default = false]; + optional bool OldLookupJoinBehaviour = 59 [default = true]; optional bool EnableOltpSink = 60 [default = false]; diff --git a/ydb/library/yql/minikql/mkql_runtime_version.h b/ydb/library/yql/minikql/mkql_runtime_version.h index 22072157e87f..e7f39f9b250b 100644 --- a/ydb/library/yql/minikql/mkql_runtime_version.h +++ b/ydb/library/yql/minikql/mkql_runtime_version.h @@ -24,7 +24,7 @@ namespace NMiniKQL { // 1. Bump this version every time incompatible runtime nodes are introduced. // 2. Make sure you provide runtime node generation for previous runtime versions. #ifndef MKQL_RUNTIME_VERSION -#define MKQL_RUNTIME_VERSION 50U +#define MKQL_RUNTIME_VERSION 47U #endif // History: diff --git a/ydb/library/yql/tests/postgresql/cases/json.err b/ydb/library/yql/tests/postgresql/cases/json.err deleted file mode 100644 index ce678513766a..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/json.err +++ /dev/null @@ -1,3999 +0,0 @@ - --- Strings. -SELECT '""'::json; -- OK. - - -SELECT $$''$$::json; -- ERROR, single quotes are not allowed - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT $$''$$::json; -- ERROR, single quotes are not allowed - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "'" is invalid. -CONTEXT: JSON data, line 1: '... - - SELECT $$''$$::json; -- ERROR, single quotes are not allowed - ^ - -SELECT '"abc"'::json; -- OK - - -SELECT '"abc'::json; -- ERROR, quotes not closed - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '"abc'::json; -- ERROR, quotes not closed - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token ""abc" is invalid. -CONTEXT: JSON data, line 1: "abc - - SELECT '"abc'::json; -- ERROR, quotes not closed - ^ - -SELECT '"abc -def"'::json; -- ERROR, unescaped newline in string constant - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '"abc - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Character with value 0x0a must be escaped. -CONTEXT: JSON data, line 1: "abc - - SELECT '"abc - ^ - -SELECT '"\n\"\\"'::json; -- OK, legal escapes - - -SELECT '"\v"'::json; -- ERROR, not a valid JSON escape - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '"\v"'::json; -- ERROR, not a valid JSON escape - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Escape sequence "\v" is invalid. -CONTEXT: JSON data, line 1: "\v... - - SELECT '"\v"'::json; -- ERROR, not a valid JSON escape - ^ - --- see json_encoding test for input with unicode escapes --- Numbers. -SELECT '1'::json; -- OK - - -SELECT '0'::json; -- OK - - -SELECT '01'::json; -- ERROR, not valid according to JSON spec - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '01'::json; -- ERROR, not valid according to JSON spec - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "01" is invalid. -CONTEXT: JSON data, line 1: 01 - - SELECT '01'::json; -- ERROR, not valid according to JSON spec - ^ - -SELECT '0.1'::json; -- OK - - -SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8 - - -SELECT '1e100'::json; -- OK - - -SELECT '1.3e100'::json; -- OK - - -SELECT '1f2'::json; -- ERROR - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '1f2'::json; -- ERROR - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "1f2" is invalid. -CONTEXT: JSON data, line 1: 1f2 - - SELECT '1f2'::json; -- ERROR - ^ - -SELECT '0.x1'::json; -- ERROR - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '0.x1'::json; -- ERROR - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "0.x1" is invalid. -CONTEXT: JSON data, line 1: 0.x1 - - SELECT '0.x1'::json; -- ERROR - ^ - -SELECT '1.3ex100'::json; -- ERROR - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '1.3ex100'::json; -- ERROR - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "1.3ex100" is invalid. -CONTEXT: JSON data, line 1: 1.3ex100 - - SELECT '1.3ex100'::json; -- ERROR - ^ - --- Arrays. -SELECT '[]'::json; -- OK - - -SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::json; -- OK - - -SELECT '[1,2]'::json; -- OK - - -SELECT '[1,2,]'::json; -- ERROR, trailing comma - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '[1,2,]'::json; -- ERROR, trailing comma - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found "]". -CONTEXT: JSON data, line 1: [1,2,] - - SELECT '[1,2,]'::json; -- ERROR, trailing comma - ^ - -SELECT '[1,2'::json; -- ERROR, no closing bracket - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '[1,2'::json; -- ERROR, no closing bracket - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,2 - - SELECT '[1,2'::json; -- ERROR, no closing bracket - ^ - -SELECT '[1,[2]'::json; -- ERROR, no closing bracket - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '[1,[2]'::json; -- ERROR, no closing bracket - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,[2] - - SELECT '[1,[2]'::json; -- ERROR, no closing bracket - ^ - --- Objects. -SELECT '{}'::json; -- OK - - -SELECT '{"abc"}'::json; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc"}'::json; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected ":", but found "}". -CONTEXT: JSON data, line 1: {"abc"} - - SELECT '{"abc"}'::json; -- ERROR, no value - ^ - -SELECT '{"abc":1}'::json; -- OK - - -SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected string or "}", but found "1". -CONTEXT: JSON data, line 1: {1... - - SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings - ^ - -SELECT '{"abc",1}'::json; -- ERROR, wrong separator - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc",1}'::json; -- ERROR, wrong separator - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected ":", but found ",". -CONTEXT: JSON data, line 1: {"abc",... - - SELECT '{"abc",1}'::json; -- ERROR, wrong separator - ^ - -SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "=" is invalid. -CONTEXT: JSON data, line 1: {"abc"=... - - SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator - ^ - -SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found ":". -CONTEXT: JSON data, line 1: {"abc"::... - - SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator - ^ - -SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK - - -SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected "," or "}", but found ":". -CONTEXT: JSON data, line 1: {"abc":1:... - - SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot - ^ - -SELECT '{"abc":1,3}'::json; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc":1,3}'::json; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected string, but found "3". -CONTEXT: JSON data, line 1: {"abc":1,3... - - SELECT '{"abc":1,3}'::json; -- ERROR, no value - ^ - --- Miscellaneous stuff. -SELECT 'true'::json; -- OK - - -SELECT 'false'::json; -- OK - - -SELECT 'null'::json; -- OK - - -SELECT ' true '::json; -- OK, even with extra whitespace - - -SELECT 'true false'::json; -- ERROR, too many values - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'true false'::json; -- ERROR, too many values - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected end of input, but found "false". -CONTEXT: JSON data, line 1: true false - - SELECT 'true false'::json; -- ERROR, too many values - ^ - -SELECT 'true, false'::json; -- ERROR, too many values - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'true, false'::json; -- ERROR, too many values - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected end of input, but found ",". -CONTEXT: JSON data, line 1: true,... - - SELECT 'true, false'::json; -- ERROR, too many values - ^ - -SELECT 'truf'::json; -- ERROR, not a keyword - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'truf'::json; -- ERROR, not a keyword - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "truf" is invalid. -CONTEXT: JSON data, line 1: truf - - SELECT 'truf'::json; -- ERROR, not a keyword - ^ - -SELECT 'trues'::json; -- ERROR, not a keyword - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'trues'::json; -- ERROR, not a keyword - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "trues" is invalid. -CONTEXT: JSON data, line 1: trues - - SELECT 'trues'::json; -- ERROR, not a keyword - ^ - -SELECT ''::json; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT ''::json; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: - - SELECT ''::json; -- ERROR, no value - ^ - -SELECT ' '::json; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT ' '::json; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: - - SELECT ' '::json; -- ERROR, no value - ^ - --- Multi-line JSON input to check ERROR reporting -SELECT '{ - "one": 1, - "two":"two", - "three": - true}'::json; -- OK - - -SELECT '{ - "one": 1, - "two":,"two", -- ERROR extraneous comma before field "two" - "three": - true}'::json; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{ - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found ",". -CONTEXT: JSON data, line 3: "two":,... - - SELECT '{ - ^ - -SELECT '{ - "one": 1, - "two":"two", - "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{ - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found "}". -CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":} - - SELECT '{ - ^ - --- ERROR missing value for last field ---constructors --- array_to_json -SELECT array_to_json(array(select 1 as a)); - - -SELECT array_to_json(array_agg(q),false) from (select x as b, x * 2 as c from generate_series(1,3) x) q; - --stdin-:
: Fatal: No such type: 0 - - -SELECT array_to_json(array_agg(q),true) from (select x as b, x * 2 as c from generate_series(1,3) x) q; - --stdin-:
: Fatal: No such type: 0 - - -SELECT array_to_json(array_agg(q),false) - FROM ( SELECT $$a$$ || x AS b, y AS c, - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ROW(y.*,ARRAY[4,5,6])] AS z - FROM generate_series(1,2) x, - generate_series(4,5) y) q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:3:16: Error: alternative is not implemented yet : 138 - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - SELECT array_to_json(array_agg(q),false) - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - SELECT array_to_json(array_agg(q),false) - ^ - -SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x; - - -SELECT array_to_json('{{1,5},{99,100}}'::int[]); - - --- row_to_json -SELECT row_to_json(row(1,'foo')); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: alternative is not implemented yet : 138 - SELECT row_to_json(row(1,'foo')); - ^ - -SELECT row_to_json(q) -FROM (SELECT $$a$$ || x AS b, - y AS c, - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ROW(y.*,ARRAY[4,5,6])] AS z - FROM generate_series(1,2) x, - generate_series(4,5) y) q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:4:10: Error: alternative is not implemented yet : 138 - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - SELECT row_to_json(q) - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - SELECT row_to_json(q) - ^ - -SELECT row_to_json(q,true) -FROM (SELECT $$a$$ || x AS b, - y AS c, - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ROW(y.*,ARRAY[4,5,6])] AS z - FROM generate_series(1,2) x, - generate_series(4,5) y) q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:4:10: Error: alternative is not implemented yet : 138 - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - SELECT row_to_json(q,true) - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - SELECT row_to_json(q,true) - ^ - -CREATE TEMP TABLE rows AS -SELECT x, 'txt' || x as y -FROM generate_series(1,3) AS x; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 277 - CREATE TEMP TABLE rows AS - ^ - -SELECT row_to_json(q,true) -FROM rows q; - --stdin-:
: Fatal: Table metadata loading - - -stdin-:
: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.rows - - -SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: alternative is not implemented yet : 138 - SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false); - ^ - --- anyarray column -analyze rows; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 275 - -- anyarray column - ^ - -select attname, to_json(histogram_bounds) histogram_bounds -from pg_stats -where tablename = 'rows' and - schemaname = pg_my_temp_schema()::regnamespace::text -order by 1; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select attname, to_json(histogram_bounds) histogram_bounds - ^ - -stdin-:
:1:17: Error: At function: PgCall - select attname, to_json(histogram_bounds) histogram_bounds - ^ - -stdin-:
:1:17: Error: Unable to find an overload for proc to_json with given argument types: (anyarray) - select attname, to_json(histogram_bounds) histogram_bounds - ^ - --- to_json, timestamps -select to_json(timestamp '2014-05-28 12:22:35.614298'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- to_json, timestamps - ^ - -stdin-:
:2:8: Error: At function: PgCall - select to_json(timestamp '2014-05-28 12:22:35.614298'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamp) - select to_json(timestamp '2014-05-28 12:22:35.614298'); - ^ - -BEGIN; - - -SET LOCAL TIME ZONE 10.5; - - -select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz) - select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -SET LOCAL TIME ZONE -8; - - -select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz) - select to_json(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -COMMIT; - - -select to_json(date '2014-05-28'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(date '2014-05-28'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(date '2014-05-28'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (date) - select to_json(date '2014-05-28'); - ^ - -select to_json(date 'Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(date 'Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(date 'Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (date) - select to_json(date 'Infinity'); - ^ - -select to_json(date '-Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(date '-Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(date '-Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (date) - select to_json(date '-Infinity'); - ^ - -select to_json(timestamp 'Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(timestamp 'Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(timestamp 'Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamp) - select to_json(timestamp 'Infinity'); - ^ - -select to_json(timestamp '-Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(timestamp '-Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(timestamp '-Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamp) - select to_json(timestamp '-Infinity'); - ^ - -select to_json(timestamptz 'Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(timestamptz 'Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(timestamptz 'Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz) - select to_json(timestamptz 'Infinity'); - ^ - -select to_json(timestamptz '-Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_json(timestamptz '-Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_json(timestamptz '-Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_json with given argument types: (timestamptz) - select to_json(timestamptz '-Infinity'); - ^ - ---json_agg -SELECT json_agg(q) - FROM ( SELECT $$a$$ || x AS b, y AS c, - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ROW(y.*,ARRAY[4,5,6])] AS z - FROM generate_series(1,2) x, - generate_series(4,5) y) q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:4:16: Error: alternative is not implemented yet : 138 - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - --json_agg - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - --json_agg - ^ - -SELECT json_agg(q ORDER BY x, y) - FROM rows q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported agg_order - SELECT json_agg(q ORDER BY x, y) - ^ - -UPDATE rows SET x = NULL WHERE x = 1; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -SELECT json_agg(q ORDER BY x NULLS FIRST, y) - FROM rows q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported agg_order - SELECT json_agg(q ORDER BY x NULLS FIRST, y) - ^ - --- non-numeric output -SELECT row_to_json(q) -FROM (SELECT 'NaN'::float8 AS "float8field") q; - - -SELECT row_to_json(q) -FROM (SELECT 'Infinity'::float8 AS "float8field") q; - - -SELECT row_to_json(q) -FROM (SELECT '-Infinity'::float8 AS "float8field") q; - - --- json input -SELECT row_to_json(q) -FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q; - - --- json extraction functions -CREATE TEMP TABLE test_json ( - json_type text, - test_json json -); - - -INSERT INTO test_json VALUES -('scalar','"a scalar"'), -('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'), -('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}'); - - -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'scalar'; - - -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'array'; - - -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'object'; - - -SELECT test_json->'field2' -FROM test_json -WHERE json_type = 'object'; - - -SELECT test_json->>'field2' -FROM test_json -WHERE json_type = 'object'; - - -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'scalar'; - - -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'array'; - - -SELECT test_json -> -1 -FROM test_json -WHERE json_type = 'array'; - - -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'object'; - - -SELECT test_json->>2 -FROM test_json -WHERE json_type = 'array'; - - -SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array'; - - -SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array'; - - -SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object'; - - -SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object'; - - -SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object'; - - -SELECT json_object_keys(test_json) -FROM test_json -WHERE json_type = 'scalar'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT json_object_keys(test_json) - ^ - -SELECT json_object_keys(test_json) -FROM test_json -WHERE json_type = 'array'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT json_object_keys(test_json) - ^ - -SELECT json_object_keys(test_json) -FROM test_json -WHERE json_type = 'object'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT json_object_keys(test_json) - ^ - --- test extending object_keys resultset - initial resultset size is 256 -select count(*) from - (select json_object_keys(json_object(array_agg(g))) - from (select unnest(array['f'||n,n::text])as g - from generate_series(1,300) as n) x ) y; - --stdin-:
: Error: Parse Sql - - -stdin-:
:4:19: Error: Generator functions are not allowed in: SELECT - from (select unnest(array['f'||n,n::text])as g - ^ - -stdin-:
:3:13: Error: Generator functions are not allowed in: SELECT - (select json_object_keys(json_object(array_agg(g))) - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - -- test extending object_keys resultset - initial resultset size is 256 - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - -- test extending object_keys resultset - initial resultset size is 256 - ^ - --- nulls -select (test_json->'field3') is null as expect_false -from test_json -where json_type = 'object'; - - -select (test_json->>'field3') is null as expect_true -from test_json -where json_type = 'object'; - - -select (test_json->3) is null as expect_false -from test_json -where json_type = 'array'; - - -select (test_json->>3) is null as expect_true -from test_json -where json_type = 'array'; - - --- corner cases -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z'; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> ''; - - -select '[{"b": "c"}, {"b": "cc"}]'::json -> 1; - - -select '[{"b": "c"}, {"b": "cc"}]'::json -> 3; - - -select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z'; - - -select '{"a": "c", "b": null}'::json -> 'b'; - - -select '"foo"'::json -> 1; - - -select '"foo"'::json -> 'z'; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z'; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> ''; - - -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1; - - -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3; - - -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z'; - - -select '{"a": "c", "b": null}'::json ->> 'b'; - - -select '"foo"'::json ->> 1; - - -select '"foo"'::json ->> 'z'; - - --- array length -SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); - - -SELECT json_array_length('[]'); - - -SELECT json_array_length('{"f1":1,"f2":[5,6]}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_array_length('{"f1":1,"f2":[5,6]}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot get array length of a non-array - - SELECT json_array_length('{"f1":1,"f2":[5,6]}'); - ^ - -SELECT json_array_length('4'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_array_length('4'); - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot get array length of a scalar - - SELECT json_array_length('4'); - ^ - --- each -select json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - select json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}'); - ^ - -select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - - -select json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - select json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}'); - ^ - -select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - - --- extract_path, extract_path_as_text -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - - -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - - -select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - - -select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - - -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - - -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - - -select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - - -select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - - --- extract_path nulls -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false; - - -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true; - - -select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false; - - -select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true; - - --- extract_path operators -select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- extract_path operators - ^ - -stdin-:
:2:61: Error: At function: PgOp - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6']; - ^ - -stdin-:
:2:61: Error: No such operator: #> - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f4','f6']; - ^ - -select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2']; - ^ - -stdin-:
:1:61: Error: At function: PgOp - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2']; - ^ - -stdin-:
:1:61: Error: No such operator: #> - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2']; - ^ - -select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0']; - ^ - -stdin-:
:1:61: Error: At function: PgOp - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0']; - ^ - -stdin-:
:1:61: Error: No such operator: #> - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','0']; - ^ - -select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1']; - ^ - -stdin-:
:1:61: Error: At function: PgOp - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1']; - ^ - -stdin-:
:1:61: Error: No such operator: #> - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>array['f2','1']; - ^ - -select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6']; - ^ - -stdin-:
:1:61: Error: At function: PgOp - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6']; - ^ - -stdin-:
:1:61: Error: No such operator: #>> - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f4','f6']; - ^ - -select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2']; - ^ - -stdin-:
:1:61: Error: At function: PgOp - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2']; - ^ - -stdin-:
:1:61: Error: No such operator: #>> - select '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2']; - ^ - -select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0']; - ^ - -stdin-:
:1:61: Error: At function: PgOp - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0']; - ^ - -stdin-:
:1:61: Error: No such operator: #>> - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','0']; - ^ - -select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1']; - ^ - -stdin-:
:1:61: Error: At function: PgOp - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1']; - ^ - -stdin-:
:1:61: Error: No such operator: #>> - select '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::json#>>array['f2','1']; - ^ - --- corner cases for same -select '{"a": {"b":{"c": "foo"}}}'::json #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- corner cases for same - ^ - -stdin-:
:2:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> '{}'; - ^ - -stdin-:
:2:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> '{}'; - ^ - -select '[1,2,3]'::json #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[1,2,3]'::json #> '{}'; - ^ - -stdin-:
:1:24: Error: At function: PgOp - select '[1,2,3]'::json #> '{}'; - ^ - -stdin-:
:1:24: Error: No such operator: #> - select '[1,2,3]'::json #> '{}'; - ^ - -select '"foo"'::json #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::json #> '{}'; - ^ - -stdin-:
:1:22: Error: At function: PgOp - select '"foo"'::json #> '{}'; - ^ - -stdin-:
:1:22: Error: No such operator: #> - select '"foo"'::json #> '{}'; - ^ - -select '42'::json #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::json #> '{}'; - ^ - -stdin-:
:1:19: Error: At function: PgOp - select '42'::json #> '{}'; - ^ - -stdin-:
:1:19: Error: No such operator: #> - select '42'::json #> '{}'; - ^ - -select 'null'::json #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select 'null'::json #> '{}'; - ^ - -stdin-:
:1:21: Error: At function: PgOp - select 'null'::json #> '{}'; - ^ - -stdin-:
:1:21: Error: No such operator: #> - select 'null'::json #> '{}'; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #> array['a']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null]; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null]; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null]; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', null]; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', '']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', '']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', '']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a', '']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','b','c','d']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::json #> array['a','z','c']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b']; - ^ - -stdin-:
:1:49: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b']; - ^ - -stdin-:
:1:49: Error: No such operator: #> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','1','b']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b']; - ^ - -stdin-:
:1:49: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b']; - ^ - -stdin-:
:1:49: Error: No such operator: #> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #> array['a','z','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '[{"b": "c"}, {"b": "cc"}]'::json #> array['1','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '[{"b": "c"}, {"b": "cc"}]'::json #> array['z','b']; - ^ - -select '[{"b": "c"}, {"b": null}]'::json #> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": null}]'::json #> array['1','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '[{"b": "c"}, {"b": null}]'::json #> array['1','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #> - select '[{"b": "c"}, {"b": null}]'::json #> array['1','b']; - ^ - -select '"foo"'::json #> array['z']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::json #> array['z']; - ^ - -stdin-:
:1:22: Error: At function: PgOp - select '"foo"'::json #> array['z']; - ^ - -stdin-:
:1:22: Error: No such operator: #> - select '"foo"'::json #> array['z']; - ^ - -select '42'::json #> array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::json #> array['f2']; - ^ - -stdin-:
:1:19: Error: At function: PgOp - select '42'::json #> array['f2']; - ^ - -stdin-:
:1:19: Error: No such operator: #> - select '42'::json #> array['f2']; - ^ - -select '42'::json #> array['0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::json #> array['0']; - ^ - -stdin-:
:1:19: Error: At function: PgOp - select '42'::json #> array['0']; - ^ - -stdin-:
:1:19: Error: No such operator: #> - select '42'::json #> array['0']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}'; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}'; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> '{}'; - ^ - -select '[1,2,3]'::json #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[1,2,3]'::json #>> '{}'; - ^ - -stdin-:
:1:24: Error: At function: PgOp - select '[1,2,3]'::json #>> '{}'; - ^ - -stdin-:
:1:24: Error: No such operator: #>> - select '[1,2,3]'::json #>> '{}'; - ^ - -select '"foo"'::json #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::json #>> '{}'; - ^ - -stdin-:
:1:22: Error: At function: PgOp - select '"foo"'::json #>> '{}'; - ^ - -stdin-:
:1:22: Error: No such operator: #>> - select '"foo"'::json #>> '{}'; - ^ - -select '42'::json #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::json #>> '{}'; - ^ - -stdin-:
:1:19: Error: At function: PgOp - select '42'::json #>> '{}'; - ^ - -stdin-:
:1:19: Error: No such operator: #>> - select '42'::json #>> '{}'; - ^ - -select 'null'::json #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select 'null'::json #>> '{}'; - ^ - -stdin-:
:1:21: Error: At function: PgOp - select 'null'::json #>> '{}'; - ^ - -stdin-:
:1:21: Error: No such operator: #>> - select 'null'::json #>> '{}'; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null]; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null]; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null]; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', null]; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', '']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', '']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', '']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a', '']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','b','c','d']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::json #>> array['a','z','c']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b']; - ^ - -stdin-:
:1:49: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b']; - ^ - -stdin-:
:1:49: Error: No such operator: #>> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','1','b']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b']; - ^ - -stdin-:
:1:49: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b']; - ^ - -stdin-:
:1:49: Error: No such operator: #>> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json #>> array['a','z','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['1','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '[{"b": "c"}, {"b": "cc"}]'::json #>> array['z','b']; - ^ - -select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b']; - ^ - -stdin-:
:1:42: Error: At function: PgOp - select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b']; - ^ - -stdin-:
:1:42: Error: No such operator: #>> - select '[{"b": "c"}, {"b": null}]'::json #>> array['1','b']; - ^ - -select '"foo"'::json #>> array['z']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::json #>> array['z']; - ^ - -stdin-:
:1:22: Error: At function: PgOp - select '"foo"'::json #>> array['z']; - ^ - -stdin-:
:1:22: Error: No such operator: #>> - select '"foo"'::json #>> array['z']; - ^ - -select '42'::json #>> array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::json #>> array['f2']; - ^ - -stdin-:
:1:19: Error: At function: PgOp - select '42'::json #>> array['f2']; - ^ - -stdin-:
:1:19: Error: No such operator: #>> - select '42'::json #>> array['f2']; - ^ - -select '42'::json #>> array['0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::json #>> array['0']; - ^ - -stdin-:
:1:19: Error: At function: PgOp - select '42'::json #>> array['0']; - ^ - -stdin-:
:1:19: Error: No such operator: #>> - select '42'::json #>> array['0']; - ^ - --- array_elements -select json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - select json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]'); - ^ - -select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; - - -select json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - select json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]'); - ^ - -select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; - - --- populate_record -create type jpop as (a text, b int, c timestamp); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - -- populate_record - ^ - -CREATE DOMAIN js_int_not_null AS int NOT NULL; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - CREATE DOMAIN js_int_not_null AS int NOT NULL; - ^ - -CREATE DOMAIN js_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - CREATE DOMAIN js_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3); - ^ - -CREATE DOMAIN js_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - CREATE DOMAIN js_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3); - ^ - -create type j_unordered_pair as (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - create type j_unordered_pair as (x int, y int); - ^ - -create domain j_ordered_pair as j_unordered_pair check((value).x <= (value).y); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - create domain j_ordered_pair as j_unordered_pair check((value).x <= (value).y); - ^ - -CREATE TYPE jsrec AS ( - i int, - ia _int4, - ia1 int[], - ia2 int[][], - ia3 int[][][], - ia1d js_int_array_1d, - ia2d js_int_array_2d, - t text, - ta text[], - c char(10), - ca char(10)[], - ts timestamp, - js json, - jsb jsonb, - jsa json[], - rec jpop, - reca jpop[] -); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - CREATE TYPE jsrec AS ( - ^ - -CREATE TYPE jsrec_i_not_null AS ( - i js_int_not_null -); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - CREATE TYPE jsrec_i_not_null AS ( - ^ - -select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jpop - select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q; - ^ - -select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:70: Error: alternative is not implemented yet : 138 - select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q; - ^ - -select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jpop - select * from json_populate_record(null::jpop,'{"a":"blurfl","x":43.2}') q; - ^ - -select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:70: Error: alternative is not implemented yet : 138 - select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":"blurfl","x":43.2}') q; - ^ - -select * from json_populate_record(null::jpop,'{"a":[100,200,false],"x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jpop - select * from json_populate_record(null::jpop,'{"a":[100,200,false],"x":43.2}') q; - ^ - -select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":[100,200,false],"x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:70: Error: alternative is not implemented yet : 138 - select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"a":[100,200,false],"x":43.2}') q; - ^ - -select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"c":[100,200,false],"x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:70: Error: alternative is not implemented yet : 138 - select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{"c":[100,200,false],"x":43.2}') q; - ^ - -select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:70: Error: alternative is not implemented yet : 138 - select * from json_populate_record(row('x',3,'2012-12-31 15:30:56')::jpop,'{}') q; - ^ - -SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"x": 43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jsrec_i_not_null - SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"x": 43.2}') q; - ^ - -SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jsrec_i_not_null - SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": null}') q; - ^ - -SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": 12345}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jsrec_i_not_null - SELECT i FROM json_populate_record(NULL::jsrec_i_not_null, '{"i": 12345}') q; - ^ - -SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": null}') q; - ^ - -SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": 123}') q; - ^ - -SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [1, "2", null, 4]}') q; - ^ - -SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1, 2], [3, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1, 2], [3, 4]]}') q; - ^ - -SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], 2]}') q; - ^ - -SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": [[1], [2, 3]]}') q; - ^ - -SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ia FROM json_populate_record(NULL::jsrec, '{"ia": "{1,2,3}"}') q; - ^ - -SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": null}') q; - ^ - -SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": 123}') q; - ^ - -SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [1, "2", null, 4]}') q; - ^ - -SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [[1, 2, 3]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia1 FROM json_populate_record(NULL::jsrec, '{"ia1": [[1, 2, 3]]}') q; - ^ - -SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": null}') q; - ^ - -SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": 123}') q; - ^ - -SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null, 4]}') q; - ^ - -SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT ia1d FROM json_populate_record(NULL::jsrec, '{"ia1d": [1, "2", null]}') q; - ^ - -SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [1, "2", null, 4]}') q; - ^ - -SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [null, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [null, 4]]}') q; - ^ - -SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[], []]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[], []]}') q; - ^ - -SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], [3]]}') q; - ^ - -SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia2 FROM json_populate_record(NULL::jsrec, '{"ia2": [[1, 2], 3, 4]}') q; - ^ - -SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2"], [null, 4]]}') q; - ^ - -SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT ia2d FROM json_populate_record(NULL::jsrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q; - ^ - -SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [1, "2", null, 4]}') q; - ^ - -SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [[1, 2], [null, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [[1, 2], [null, 4]]}') q; - ^ - -SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q; - ^ - -SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q; - ^ - -SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q; - ^ - -SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT ia3 FROM json_populate_record(NULL::jsrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q; - ^ - -SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": null}') q; - ^ - -SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": 123}') q; - ^ - -SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [1, "2", null, 4]}') q; - ^ - -SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ta FROM json_populate_record(NULL::jsrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q; - ^ - -SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jsrec - SELECT c FROM json_populate_record(NULL::jsrec, '{"c": null}') q; - ^ - -SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaa"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jsrec - SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaa"}') q; - ^ - -SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaa"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jsrec - SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaa"}') q; - ^ - -SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaaaaa"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:42: Error: Unknown type: jsrec - SELECT c FROM json_populate_record(NULL::jsrec, '{"c": "aaaaaaaaaaaaa"}') q; - ^ - -SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": null}') q; - ^ - -SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": 123}') q; - ^ - -SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [1, "2", null, 4]}') q; - ^ - -SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q; - ^ - -SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT ca FROM json_populate_record(NULL::jsrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q; - ^ - -SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT js FROM json_populate_record(NULL::jsrec, '{"js": null}') q; - ^ - -SELECT js FROM json_populate_record(NULL::jsrec, '{"js": true}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT js FROM json_populate_record(NULL::jsrec, '{"js": true}') q; - ^ - -SELECT js FROM json_populate_record(NULL::jsrec, '{"js": 123.45}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT js FROM json_populate_record(NULL::jsrec, '{"js": 123.45}') q; - ^ - -SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "123.45"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "123.45"}') q; - ^ - -SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "abc"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT js FROM json_populate_record(NULL::jsrec, '{"js": "abc"}') q; - ^ - -SELECT js FROM json_populate_record(NULL::jsrec, '{"js": [123, "123", null, {"key": "value"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT js FROM json_populate_record(NULL::jsrec, '{"js": [123, "123", null, {"key": "value"}]}') q; - ^ - -SELECT js FROM json_populate_record(NULL::jsrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsrec - SELECT js FROM json_populate_record(NULL::jsrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q; - ^ - -SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": null}') q; - ^ - -SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": true}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": true}') q; - ^ - -SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": 123.45}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": 123.45}') q; - ^ - -SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "123.45"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "123.45"}') q; - ^ - -SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "abc"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": "abc"}') q; - ^ - -SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q; - ^ - -SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsb FROM json_populate_record(NULL::jsrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q; - ^ - -SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": null}') q; - ^ - -SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": 123}') q; - ^ - -SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": [1, "2", null, 4]}') q; - ^ - -SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT jsa FROM json_populate_record(NULL::jsrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q; - ^ - -SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": 123}') q; - ^ - -SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": [1, 2]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": [1, 2]}') q; - ^ - -SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q; - ^ - -SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": "(abc,42,01.02.2003)"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsrec - SELECT rec FROM json_populate_record(NULL::jsrec, '{"rec": "(abc,42,01.02.2003)"}') q; - ^ - -SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": 123}') q; - ^ - -SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [1, 2]}') q; - ^ - -SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q; - ^ - -SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": ["(abc,42,01.02.2003)"]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": ["(abc,42,01.02.2003)"]}') q; - ^ - -SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsrec - SELECT reca FROM json_populate_record(NULL::jsrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q; - ^ - -SELECT rec FROM json_populate_record( - row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - row('x',3,'2012-12-31 15:30:56')::jpop,NULL)::jsrec, - '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}' -) q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:3:49: Error: alternative is not implemented yet : 138 - row('x',3,'2012-12-31 15:30:56')::jpop,NULL)::jsrec, - ^ - --- anonymous record type -SELECT json_populate_record(null::record, '{"x": 0, "y": 1}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- anonymous record type - ^ - -stdin-:
:2:8: Error: At function: PgCall - SELECT json_populate_record(null::record, '{"x": 0, "y": 1}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc json_populate_record with given argument types: (record,unknown) - SELECT json_populate_record(null::record, '{"x": 0, "y": 1}'); - ^ - -SELECT json_populate_record(row(1,2), '{"f1": 0, "f2": 1}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: alternative is not implemented yet : 138 - SELECT json_populate_record(row(1,2), '{"f1": 0, "f2": 1}'); - ^ - -SELECT * FROM - json_populate_record(null::record, '{"x": 776}') AS (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - SELECT * FROM - ^ - --- composite domain -SELECT json_populate_record(null::j_ordered_pair, '{"x": 0, "y": 1}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:35: Error: Unknown type: j_ordered_pair - SELECT json_populate_record(null::j_ordered_pair, '{"x": 0, "y": 1}'); - ^ - -SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 0}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:39: Error: alternative is not implemented yet : 138 - SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 0}'); - ^ - -SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 1, "y": 0}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:39: Error: alternative is not implemented yet : 138 - SELECT json_populate_record(row(1,2)::j_ordered_pair, '{"x": 1, "y": 0}'); - ^ - --- populate_recordset -select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:45: Error: Unknown type: jpop - select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:59: Error: alternative is not implemented yet : 138 - select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jpop - select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:59: Error: alternative is not implemented yet : 138 - select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:59: Error: alternative is not implemented yet : 138 - select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -select * from json_populate_recordset(row('def',99,null)::jpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:59: Error: alternative is not implemented yet : 138 - select * from json_populate_recordset(row('def',99,null)::jpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -create type jpop2 as (a int, b json, c int, d int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - create type jpop2 as (a int, b json, c int, d int); - ^ - -select * from json_populate_recordset(null::jpop2, '[{"a":2,"c":3,"b":{"z":4},"d":6}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jpop2 - select * from json_populate_recordset(null::jpop2, '[{"a":2,"c":3,"b":{"z":4},"d":6}]') q; - ^ - -select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jpop - select * from json_populate_recordset(null::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:59: Error: alternative is not implemented yet : 138 - select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:59: Error: alternative is not implemented yet : 138 - select * from json_populate_recordset(row('def',99,null)::jpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - --- anonymous record type -SELECT json_populate_recordset(null::record, '[{"x": 0, "y": 1}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT json_populate_recordset(null::record, '[{"x": 0, "y": 1}]'); - ^ - -SELECT json_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT json_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]'); - ^ - -SELECT i, json_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]') -FROM (VALUES (1),(2)) v(i); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:11: Error: Generator functions are not allowed in: SELECT - SELECT i, json_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]') - ^ - -SELECT * FROM - json_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - SELECT * FROM - ^ - --- empty array is a corner case -SELECT json_populate_recordset(null::record, '[]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT json_populate_recordset(null::record, '[]'); - ^ - -SELECT json_populate_recordset(row(1,2), '[]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT json_populate_recordset(row(1,2), '[]'); - ^ - -SELECT * FROM json_populate_recordset(NULL::jpop,'[]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jpop - SELECT * FROM json_populate_recordset(NULL::jpop,'[]') q; - ^ - -SELECT * FROM - json_populate_recordset(null::record, '[]') AS (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - SELECT * FROM - ^ - --- composite domain -SELECT json_populate_recordset(null::j_ordered_pair, '[{"x": 0, "y": 1}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT json_populate_recordset(null::j_ordered_pair, '[{"x": 0, "y": 1}]'); - ^ - -SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 0}, {"y": 3}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 0}, {"y": 3}]'); - ^ - -SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 1, "y": 0}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT json_populate_recordset(row(1,2)::j_ordered_pair, '[{"x": 1, "y": 0}]'); - ^ - --- negative cases where the wrong record type is supplied -select * from json_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - -- negative cases where the wrong record type is supplied - ^ - -select * from json_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - ^ - -select * from json_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - ^ - -select * from json_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text); - ^ - --- test type info caching in json_populate_record() -CREATE TEMP TABLE jspoptest (js json); - - -INSERT INTO jspoptest -SELECT '{ - "jsa": [1, "2", null, 4], - "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}, - "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}] -}'::json -FROM generate_series(1, 3); - - -SELECT (json_populate_record(NULL::jsrec, js)).* FROM jspoptest; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - SELECT (json_populate_record(NULL::jsrec, js)).* FROM jspoptest; - ^ - -DROP TYPE jsrec; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP TYPE jsrec; - ^ - -DROP TYPE jsrec_i_not_null; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP TYPE jsrec_i_not_null; - ^ - -DROP DOMAIN js_int_not_null; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN js_int_not_null; - ^ - -DROP DOMAIN js_int_array_1d; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN js_int_array_1d; - ^ - -DROP DOMAIN js_int_array_2d; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN js_int_array_2d; - ^ - -DROP DOMAIN j_ordered_pair; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN j_ordered_pair; - ^ - -DROP TYPE j_unordered_pair; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP TYPE j_unordered_pair; - ^ - ---json_typeof() function -select value, json_typeof(value) - from (values (json '123.4'), - (json '-1'), - (json '"foo"'), - (json 'true'), - (json 'false'), - (json 'null'), - (json '[1, 2, 3]'), - (json '[]'), - (json '{"x":"foo", "y":123}'), - (json '{}'), - (NULL::json)) - as data(value); - - --- json_build_array, json_build_object, json_object_agg -SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - - -SELECT json_build_array('a', NULL); -- ok - - -SELECT json_build_array(VARIADIC NULL::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_array(VARIADIC NULL::text[]); -- ok - ^ - -SELECT json_build_array(VARIADIC '{}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_array(VARIADIC '{}'::text[]); -- ok - ^ - -SELECT json_build_array(VARIADIC '{a,b,c}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_array(VARIADIC '{a,b,c}'::text[]); -- ok - ^ - -SELECT json_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok - ^ - -SELECT json_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok - ^ - -SELECT json_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok - ^ - -SELECT json_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - ^ - -SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - - -SELECT json_build_object( - 'a', json_build_object('b',false,'c',99), - 'd', json_build_object('e',array[9,8,7]::int[], - 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r))); - - -SELECT json_build_object('{a,b,c}'::text[]); -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_build_object('{a,b,c}'::text[]); -- error - ^ - -stdin-:
:1:1: Fatal: ERROR: argument list must have even number of elements -HINT: The arguments of json_build_object() must consist of alternating keys and values. - - SELECT json_build_object('{a,b,c}'::text[]); -- error - ^ - -SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array - ^ - -SELECT json_build_object('a', 'b', 'c'); -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_build_object('a', 'b', 'c'); -- error - ^ - -stdin-:
:1:1: Fatal: ERROR: argument list must have even number of elements -HINT: The arguments of json_build_object() must consist of alternating keys and values. - - SELECT json_build_object('a', 'b', 'c'); -- error - ^ - -SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL - ^ - -stdin-:
:1:1: Fatal: ERROR: argument 1 cannot be null -HINT: Object keys should be text. - - SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL - ^ - -SELECT json_build_object('a', NULL); -- ok - - -SELECT json_build_object(VARIADIC NULL::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC NULL::text[]); -- ok - ^ - -SELECT json_build_object(VARIADIC '{}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC '{}'::text[]); -- ok - ^ - -SELECT json_build_object(VARIADIC '{a,b,c}'::text[]); -- error - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC '{a,b,c}'::text[]); -- error - ^ - -SELECT json_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok - ^ - -SELECT json_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL - ^ - -SELECT json_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok - ^ - -SELECT json_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok - ^ - -SELECT json_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT json_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - ^ - --- empty objects/arrays -SELECT json_build_array(); - - -SELECT json_build_object(); - - --- make sure keys are quoted -SELECT json_build_object(1,2); - - --- keys must be scalar and not null -SELECT json_build_object(null,2); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- keys must be scalar and not null - ^ - -stdin-:
:1:1: Fatal: ERROR: argument 1 cannot be null -HINT: Object keys should be text. - - -- keys must be scalar and not null - ^ - -SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; - ^ - -SELECT json_build_object(json '{"a":1,"b":2}', 3); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_build_object(json '{"a":1,"b":2}', 3); - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT json_build_object(json '{"a":1,"b":2}', 3); - ^ - -SELECT json_build_object('{1,2,3}'::int[], 3); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT json_build_object('{1,2,3}'::int[], 3); - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT json_build_object('{1,2,3}'::int[], 3); - ^ - -CREATE TEMP TABLE foo (serial_num int, name text, type text); - - -INSERT INTO foo VALUES (847001,'t15','GE1043'); - - -INSERT INTO foo VALUES (847002,'t16','GE1043'); - - -INSERT INTO foo VALUES (847003,'sub-alpha','GESS90'); - - -SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type))) -FROM foo; - - -SELECT json_object_agg(name, type) FROM foo; - - -INSERT INTO foo VALUES (999999, NULL, 'bar'); - - -SELECT json_object_agg(name, type) FROM foo; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: YtMapReduce! - SELECT json_object_agg(name, type) FROM foo; - ^ - -stdin-:
:1:1: Fatal: ERROR: field name must not be null - - SELECT json_object_agg(name, type) FROM foo; - ^ - --- json_object --- empty object, one dimension -SELECT json_object('{}'); - - --- empty object, two dimensions -SELECT json_object('{}', '{}'); - - --- one dimension -SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}'); - - --- same but with two dimensions -SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); - - --- odd number error -SELECT json_object('{a,b,c}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- odd number error - ^ - -stdin-:
:1:1: Fatal: ERROR: array must have even number of elements - - -- odd number error - ^ - --- one column error -SELECT json_object('{{a},{b}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- one column error - ^ - -stdin-:
:1:1: Fatal: ERROR: array must have two columns - - -- one column error - ^ - --- too many columns error -SELECT json_object('{{a,b,c},{b,c,d}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- too many columns error - ^ - -stdin-:
:1:1: Fatal: ERROR: array must have two columns - - -- too many columns error - ^ - --- too many dimensions error -SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- too many dimensions error - ^ - -stdin-:
:1:1: Fatal: ERROR: wrong number of array subscripts - - -- too many dimensions error - ^ - ---two argument form of json_object -select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}'); - - --- too many dimensions -SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- too many dimensions - ^ - -stdin-:
:1:1: Fatal: ERROR: wrong number of array subscripts - - -- too many dimensions - ^ - --- mismatched dimensions -select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- mismatched dimensions - ^ - -stdin-:
:1:1: Fatal: ERROR: mismatched array dimensions - - -- mismatched dimensions - ^ - -select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: mismatched array dimensions - - select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); - ^ - --- null key error -select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- null key error - ^ - -stdin-:
:1:1: Fatal: ERROR: null value not allowed for object key - - -- null key error - ^ - --- empty key is allowed -select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}'); - - --- json_to_record and json_to_recordset -select * from json_to_record('{"a":1,"b":"foo","c":"bar"}') - as x(a int, b text, d text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - -- json_to_record and json_to_recordset - ^ - -select * from json_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]') - as x(a int, b text, c boolean); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]') - ^ - -select * from json_to_recordset('[{"a":1,"b":{"d":"foo"},"c":true},{"a":2,"c":false,"b":{"d":"bar"}}]') - as x(a int, b json, c boolean); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_recordset('[{"a":1,"b":{"d":"foo"},"c":true},{"a":2,"c":false,"b":{"d":"bar"}}]') - ^ - -select *, c is null as c_is_null -from json_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::json) - as t(a int, b json, c text, x int, ca char(5)[], ia int[][], r jpop); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select *, c is null as c_is_null - ^ - -select *, c is null as c_is_null -from json_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::json) - as t(a int, b json, c text, x int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select *, c is null as c_is_null - ^ - -select * from json_to_record('{"ia": null}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia": null}') as x(ia _int4); - ^ - -select * from json_to_record('{"ia": 123}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia": 123}') as x(ia _int4); - ^ - -select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4); - ^ - -select * from json_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4); - ^ - -select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia": [[1], 2]}') as x(ia _int4); - ^ - -select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4); - ^ - -select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]); - ^ - -select * from json_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]); - ^ - -select * from json_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]); - ^ - -select * from json_to_record('{"out": {"key": 1}}') as x(out json); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"out": {"key": 1}}') as x(out json); - ^ - -select * from json_to_record('{"out": [{"key": 1}]}') as x(out json); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"out": [{"key": 1}]}') as x(out json); - ^ - -select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out json); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out json); - ^ - -select * from json_to_record('{"out": {"key": 1}}') as x(out jsonb); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"out": {"key": 1}}') as x(out jsonb); - ^ - -select * from json_to_record('{"out": [{"key": 1}]}') as x(out jsonb); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"out": [{"key": 1}]}') as x(out jsonb); - ^ - -select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from json_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb); - ^ - --- json_strip_nulls -select json_strip_nulls(null); - - -select json_strip_nulls('1'); - - -select json_strip_nulls('"a string"'); - - -select json_strip_nulls('null'); - - -select json_strip_nulls('[1,2,null,3,4]'); - - -select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}'); - - -select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]'); - - --- an empty object is not null and should not be stripped -select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }'); - - --- json to tsvector -select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- json to tsvector - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - -- json to tsvector - ^ - --- json to tsvector with config -select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- json to tsvector with config - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "simple" does not exist - - -- json to tsvector with config - ^ - --- json to tsvector with stop words -select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- json to tsvector with stop words - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - -- json to tsvector with stop words - ^ - --- json to tsvector with numeric values -select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- json to tsvector with numeric values - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - -- json to tsvector with numeric values - ^ - --- json_to_tsvector -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- json_to_tsvector - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - -- json_to_tsvector - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"all"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"key"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"string"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"numeric"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '"boolean"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["string", "numeric"]'); - ^ - --- to_tsvector corner cases -select to_tsvector('""'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- to_tsvector corner cases - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - -- to_tsvector corner cases - ^ - -select to_tsvector('{}'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select to_tsvector('{}'::json); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select to_tsvector('{}'::json); - ^ - -select to_tsvector('[]'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select to_tsvector('[]'::json); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select to_tsvector('[]'::json); - ^ - -select to_tsvector('null'::json); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select to_tsvector('null'::json); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select to_tsvector('null'::json); - ^ - --- json_to_tsvector corner cases -select json_to_tsvector('""'::json, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- json_to_tsvector corner cases - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - -- json_to_tsvector corner cases - ^ - -select json_to_tsvector('{}'::json, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('{}'::json, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select json_to_tsvector('{}'::json, '"all"'); - ^ - -select json_to_tsvector('[]'::json, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('[]'::json, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select json_to_tsvector('[]'::json, '"all"'); - ^ - -select json_to_tsvector('null'::json, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('null'::json, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select json_to_tsvector('null'::json, '"all"'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '""'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '{}'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '[]'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, 'null'); - ^ - -select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select json_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]'); - ^ - --- ts_headline for json -select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- ts_headline for json - ^ - -stdin-:
:2:8: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:2:121: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:2:121: Error: No such proc: tsquery - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - ^ - -select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:1:113: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:1:113: Error: No such proc: tsquery - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh')); - ^ - -select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:121: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:121: Error: No such proc: tsquery - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:132: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:132: Error: No such proc: tsquery - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::json, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - --- corner cases for ts_headline with json -select ts_headline('null'::json, tsquery('aaa & bbb')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- corner cases for ts_headline with json - ^ - -stdin-:
:2:8: Error: At function: PgCall - select ts_headline('null'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:2:34: Error: At function: PgCall - select ts_headline('null'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:2:34: Error: No such proc: tsquery - select ts_headline('null'::json, tsquery('aaa & bbb')); - ^ - -select ts_headline('{}'::json, tsquery('aaa & bbb')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('{}'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('{}'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:32: Error: At function: PgCall - select ts_headline('{}'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:32: Error: No such proc: tsquery - select ts_headline('{}'::json, tsquery('aaa & bbb')); - ^ - -select ts_headline('[]'::json, tsquery('aaa & bbb')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('[]'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('[]'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:32: Error: At function: PgCall - select ts_headline('[]'::json, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:32: Error: No such proc: tsquery - select ts_headline('[]'::json, tsquery('aaa & bbb')); - ^ diff --git a/ydb/library/yql/tests/postgresql/cases/json.out b/ydb/library/yql/tests/postgresql/cases/json.out deleted file mode 100644 index 218af2696ac7..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/json.out +++ /dev/null @@ -1,999 +0,0 @@ --- Strings. -SELECT '""'::json; -- OK. - json ------- - "" -(1 row) - -SELECT $$''$$::json; -- ERROR, single quotes are not allowed -ERROR: invalid input syntax for type json -LINE 1: SELECT $$''$$::json; - ^ -DETAIL: Token "'" is invalid. -CONTEXT: JSON data, line 1: '... -SELECT '"abc"'::json; -- OK - json -------- - "abc" -(1 row) - -SELECT '"abc'::json; -- ERROR, quotes not closed -ERROR: invalid input syntax for type json -LINE 1: SELECT '"abc'::json; - ^ -DETAIL: Token ""abc" is invalid. -CONTEXT: JSON data, line 1: "abc -SELECT '"abc -def"'::json; -- ERROR, unescaped newline in string constant -ERROR: invalid input syntax for type json -LINE 1: SELECT '"abc - ^ -DETAIL: Character with value 0x0a must be escaped. -CONTEXT: JSON data, line 1: "abc -SELECT '"\n\"\\"'::json; -- OK, legal escapes - json ----------- - "\n\"\\" -(1 row) - -SELECT '"\v"'::json; -- ERROR, not a valid JSON escape -ERROR: invalid input syntax for type json -LINE 1: SELECT '"\v"'::json; - ^ -DETAIL: Escape sequence "\v" is invalid. -CONTEXT: JSON data, line 1: "\v... --- see json_encoding test for input with unicode escapes --- Numbers. -SELECT '1'::json; -- OK - json ------- - 1 -(1 row) - -SELECT '0'::json; -- OK - json ------- - 0 -(1 row) - -SELECT '01'::json; -- ERROR, not valid according to JSON spec -ERROR: invalid input syntax for type json -LINE 1: SELECT '01'::json; - ^ -DETAIL: Token "01" is invalid. -CONTEXT: JSON data, line 1: 01 -SELECT '0.1'::json; -- OK - json ------- - 0.1 -(1 row) - -SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8 - json ---------------------- - 9223372036854775808 -(1 row) - -SELECT '1e100'::json; -- OK - json -------- - 1e100 -(1 row) - -SELECT '1.3e100'::json; -- OK - json ---------- - 1.3e100 -(1 row) - -SELECT '1f2'::json; -- ERROR -ERROR: invalid input syntax for type json -LINE 1: SELECT '1f2'::json; - ^ -DETAIL: Token "1f2" is invalid. -CONTEXT: JSON data, line 1: 1f2 -SELECT '0.x1'::json; -- ERROR -ERROR: invalid input syntax for type json -LINE 1: SELECT '0.x1'::json; - ^ -DETAIL: Token "0.x1" is invalid. -CONTEXT: JSON data, line 1: 0.x1 -SELECT '1.3ex100'::json; -- ERROR -ERROR: invalid input syntax for type json -LINE 1: SELECT '1.3ex100'::json; - ^ -DETAIL: Token "1.3ex100" is invalid. -CONTEXT: JSON data, line 1: 1.3ex100 --- Arrays. -SELECT '[]'::json; -- OK - json ------- - [] -(1 row) - -SELECT '[1,2]'::json; -- OK - json -------- - [1,2] -(1 row) - -SELECT '[1,2,]'::json; -- ERROR, trailing comma -ERROR: invalid input syntax for type json -LINE 1: SELECT '[1,2,]'::json; - ^ -DETAIL: Expected JSON value, but found "]". -CONTEXT: JSON data, line 1: [1,2,] -SELECT '[1,2'::json; -- ERROR, no closing bracket -ERROR: invalid input syntax for type json -LINE 1: SELECT '[1,2'::json; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,2 -SELECT '[1,[2]'::json; -- ERROR, no closing bracket -ERROR: invalid input syntax for type json -LINE 1: SELECT '[1,[2]'::json; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,[2] --- Objects. -SELECT '{}'::json; -- OK - json ------- - {} -(1 row) - -SELECT '{"abc"}'::json; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc"}'::json; - ^ -DETAIL: Expected ":", but found "}". -CONTEXT: JSON data, line 1: {"abc"} -SELECT '{"abc":1}'::json; -- OK - json ------------ - {"abc":1} -(1 row) - -SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings -ERROR: invalid input syntax for type json -LINE 1: SELECT '{1:"abc"}'::json; - ^ -DETAIL: Expected string or "}", but found "1". -CONTEXT: JSON data, line 1: {1... -SELECT '{"abc",1}'::json; -- ERROR, wrong separator -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc",1}'::json; - ^ -DETAIL: Expected ":", but found ",". -CONTEXT: JSON data, line 1: {"abc",... -SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc"=1}'::json; - ^ -DETAIL: Token "=" is invalid. -CONTEXT: JSON data, line 1: {"abc"=... -SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc"::1}'::json; - ^ -DETAIL: Expected JSON value, but found ":". -CONTEXT: JSON data, line 1: {"abc"::... -SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK - json ---------------------------------------------------------- - {"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}} -(1 row) - -SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc":1:2}'::json; - ^ -DETAIL: Expected "," or "}", but found ":". -CONTEXT: JSON data, line 1: {"abc":1:... -SELECT '{"abc":1,3}'::json; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc":1,3}'::json; - ^ -DETAIL: Expected string, but found "3". -CONTEXT: JSON data, line 1: {"abc":1,3... --- Miscellaneous stuff. -SELECT 'true'::json; -- OK - json ------- - true -(1 row) - -SELECT 'false'::json; -- OK - json -------- - false -(1 row) - -SELECT 'null'::json; -- OK - json ------- - null -(1 row) - -SELECT ' true '::json; -- OK, even with extra whitespace - json --------- - true -(1 row) - -SELECT 'true false'::json; -- ERROR, too many values -ERROR: invalid input syntax for type json -LINE 1: SELECT 'true false'::json; - ^ -DETAIL: Expected end of input, but found "false". -CONTEXT: JSON data, line 1: true false -SELECT 'true, false'::json; -- ERROR, too many values -ERROR: invalid input syntax for type json -LINE 1: SELECT 'true, false'::json; - ^ -DETAIL: Expected end of input, but found ",". -CONTEXT: JSON data, line 1: true,... -SELECT 'truf'::json; -- ERROR, not a keyword -ERROR: invalid input syntax for type json -LINE 1: SELECT 'truf'::json; - ^ -DETAIL: Token "truf" is invalid. -CONTEXT: JSON data, line 1: truf -SELECT 'trues'::json; -- ERROR, not a keyword -ERROR: invalid input syntax for type json -LINE 1: SELECT 'trues'::json; - ^ -DETAIL: Token "trues" is invalid. -CONTEXT: JSON data, line 1: trues -SELECT ''::json; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT ''::json; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: -SELECT ' '::json; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT ' '::json; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: -SELECT '{ - "one": 1, - "two":,"two", -- ERROR extraneous comma before field "two" - "three": - true}'::json; -ERROR: invalid input syntax for type json -LINE 1: SELECT '{ - ^ -DETAIL: Expected JSON value, but found ",". -CONTEXT: JSON data, line 3: "two":,... -SELECT '{ - "one": 1, - "two":"two", - "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json; -ERROR: invalid input syntax for type json -LINE 1: SELECT '{ - ^ -DETAIL: Expected JSON value, but found "}". -CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":} --- ERROR missing value for last field ---constructors --- array_to_json -SELECT array_to_json(array(select 1 as a)); - array_to_json ---------------- - [1] -(1 row) - -SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x; - array_to_json ----------------- - [5,6,7,8,9,10] -(1 row) - -SELECT array_to_json('{{1,5},{99,100}}'::int[]); - array_to_json ------------------- - [[1,5],[99,100]] -(1 row) - -BEGIN; -SET LOCAL TIME ZONE 10.5; -SET LOCAL TIME ZONE -8; -COMMIT; --- non-numeric output -SELECT row_to_json(q) -FROM (SELECT 'NaN'::float8 AS "float8field") q; - row_to_json ------------------------ - {"float8field":"NaN"} -(1 row) - -SELECT row_to_json(q) -FROM (SELECT 'Infinity'::float8 AS "float8field") q; - row_to_json ----------------------------- - {"float8field":"Infinity"} -(1 row) - -SELECT row_to_json(q) -FROM (SELECT '-Infinity'::float8 AS "float8field") q; - row_to_json ------------------------------ - {"float8field":"-Infinity"} -(1 row) - --- json input -SELECT row_to_json(q) -FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q; - row_to_json ------------------------------------------------------------------- - {"jsonfield":{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}} -(1 row) - --- json extraction functions -CREATE TEMP TABLE test_json ( - json_type text, - test_json json -); -INSERT INTO test_json VALUES -('scalar','"a scalar"'), -('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'), -('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}'); -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'scalar'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'array'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'object'; - ?column? ----------- - -(1 row) - -SELECT test_json->'field2' -FROM test_json -WHERE json_type = 'object'; - ?column? ----------- - "val2" -(1 row) - -SELECT test_json->>'field2' -FROM test_json -WHERE json_type = 'object'; - ?column? ----------- - val2 -(1 row) - -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'scalar'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'array'; - ?column? ----------- - "two" -(1 row) - -SELECT test_json -> -1 -FROM test_json -WHERE json_type = 'array'; - ?column? ----------- - {"f1":9} -(1 row) - -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'object'; - ?column? ----------- - -(1 row) - -SELECT test_json->>2 -FROM test_json -WHERE json_type = 'array'; - ?column? ----------- - two -(1 row) - -SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array'; - ?column? ----------- - [1,2,3] -(1 row) - -SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array'; - ?column? ----------- - {"f1":9} -(1 row) - -SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object'; - ?column? ----------- - 4 -(1 row) - -SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object'; - ?column? ----------- - [1,2,3] -(1 row) - -SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object'; - ?column? ----------- - {"f1":9} -(1 row) - --- nulls -select (test_json->'field3') is null as expect_false -from test_json -where json_type = 'object'; - expect_false --------------- - f -(1 row) - -select (test_json->>'field3') is null as expect_true -from test_json -where json_type = 'object'; - expect_true -------------- - t -(1 row) - -select (test_json->3) is null as expect_false -from test_json -where json_type = 'array'; - expect_false --------------- - f -(1 row) - -select (test_json->>3) is null as expect_true -from test_json -where json_type = 'array'; - expect_true -------------- - t -(1 row) - --- corner cases -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> ''; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::json -> 1; - ?column? -------------- - {"b": "cc"} -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::json -> 3; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": "c", "b": null}'::json -> 'b'; - ?column? ----------- - null -(1 row) - -select '"foo"'::json -> 1; - ?column? ----------- - -(1 row) - -select '"foo"'::json -> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> ''; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1; - ?column? -------------- - {"b": "cc"} -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": "c", "b": null}'::json ->> 'b'; - ?column? ----------- - -(1 row) - -select '"foo"'::json ->> 1; - ?column? ----------- - -(1 row) - -select '"foo"'::json ->> 'z'; - ?column? ----------- - -(1 row) - --- array length -SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); - json_array_length -------------------- - 5 -(1 row) - -SELECT json_array_length('[]'); - json_array_length -------------------- - 0 -(1 row) - -SELECT json_array_length('{"f1":1,"f2":[5,6]}'); -ERROR: cannot get array length of a non-array -SELECT json_array_length('4'); -ERROR: cannot get array length of a scalar -select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - key | value ------+----------- - f1 | [1,2,3] - f2 | {"f3":1} - f4 | null - f5 | 99 - f6 | "stringy" -(5 rows) - -select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - key | value ------+---------- - f1 | [1,2,3] - f2 | {"f3":1} - f4 | - f5 | 99 - f6 | stringy -(5 rows) - --- extract_path, extract_path_as_text -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - json_extract_path -------------------- - "stringy" -(1 row) - -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - json_extract_path -------------------- - {"f3":1} -(1 row) - -select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - json_extract_path -------------------- - "f3" -(1 row) - -select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - json_extract_path -------------------- - 1 -(1 row) - -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - json_extract_path_text ------------------------- - stringy -(1 row) - -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - json_extract_path_text ------------------------- - {"f3":1} -(1 row) - -select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - json_extract_path_text ------------------------- - f3 -(1 row) - -select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - json_extract_path_text ------------------------- - 1 -(1 row) - --- extract_path nulls -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false; - expect_false --------------- - f -(1 row) - -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true; - expect_true -------------- - t -(1 row) - -select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false; - expect_false --------------- - f -(1 row) - -select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true; - expect_true -------------- - t -(1 row) - -select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; - value ------------------------ - 1 - true - [1,[2,3]] - null - {"f1":1,"f2":[7,8,9]} - false - "stringy" -(7 rows) - -select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; - value ------------------------ - 1 - true - [1,[2,3]] - - {"f1":1,"f2":[7,8,9]} - false - stringy -(7 rows) - --- test type info caching in json_populate_record() -CREATE TEMP TABLE jspoptest (js json); -INSERT INTO jspoptest -SELECT '{ - "jsa": [1, "2", null, 4], - "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}, - "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}] -}'::json -FROM generate_series(1, 3); ---json_typeof() function -select value, json_typeof(value) - from (values (json '123.4'), - (json '-1'), - (json '"foo"'), - (json 'true'), - (json 'false'), - (json 'null'), - (json '[1, 2, 3]'), - (json '[]'), - (json '{"x":"foo", "y":123}'), - (json '{}'), - (NULL::json)) - as data(value); - value | json_typeof -----------------------+------------- - 123.4 | number - -1 | number - "foo" | string - true | boolean - false | boolean - null | null - [1, 2, 3] | array - [] | array - {"x":"foo", "y":123} | object - {} | object - | -(11 rows) - --- json_build_array, json_build_object, json_object_agg -SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - json_build_array ------------------------------------------------------------------------ - ["a", 1, "b", 1.2, "c", true, "d", null, "e", {"x": 3, "y": [1,2,3]}] -(1 row) - -SELECT json_build_array('a', NULL); -- ok - json_build_array ------------------- - ["a", null] -(1 row) - -SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - json_build_object ----------------------------------------------------------------------------- - {"a" : 1, "b" : 1.2, "c" : true, "d" : null, "e" : {"x": 3, "y": [1,2,3]}} -(1 row) - -SELECT json_build_object('{a,b,c}'::text[]); -- error -ERROR: argument list must have even number of elements -HINT: The arguments of json_build_object() must consist of alternating keys and values. -SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array -ERROR: key value must be scalar, not array, composite, or json -SELECT json_build_object('a', 'b', 'c'); -- error -ERROR: argument list must have even number of elements -HINT: The arguments of json_build_object() must consist of alternating keys and values. -SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL -ERROR: argument 1 cannot be null -HINT: Object keys should be text. -SELECT json_build_object('a', NULL); -- ok - json_build_object -------------------- - {"a" : null} -(1 row) - --- empty objects/arrays -SELECT json_build_array(); - json_build_array ------------------- - [] -(1 row) - -SELECT json_build_object(); - json_build_object -------------------- - {} -(1 row) - --- make sure keys are quoted -SELECT json_build_object(1,2); - json_build_object -------------------- - {"1" : 2} -(1 row) - --- keys must be scalar and not null -SELECT json_build_object(null,2); -ERROR: argument 1 cannot be null -HINT: Object keys should be text. -SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; -ERROR: key value must be scalar, not array, composite, or json -SELECT json_build_object(json '{"a":1,"b":2}', 3); -ERROR: key value must be scalar, not array, composite, or json -SELECT json_build_object('{1,2,3}'::int[], 3); -ERROR: key value must be scalar, not array, composite, or json -CREATE TEMP TABLE foo (serial_num int, name text, type text); -INSERT INTO foo VALUES (847001,'t15','GE1043'); -INSERT INTO foo VALUES (847002,'t16','GE1043'); -INSERT INTO foo VALUES (847003,'sub-alpha','GESS90'); -SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type))) -FROM foo; - json_build_object -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - {"turbines" : { "847001" : {"name" : "t15", "type" : "GE1043"}, "847002" : {"name" : "t16", "type" : "GE1043"}, "847003" : {"name" : "sub-alpha", "type" : "GESS90"} }} -(1 row) - -SELECT json_object_agg(name, type) FROM foo; - json_object_agg ----------------------------------------------------------------- - { "t15" : "GE1043", "t16" : "GE1043", "sub-alpha" : "GESS90" } -(1 row) - -INSERT INTO foo VALUES (999999, NULL, 'bar'); -SELECT json_object_agg(name, type) FROM foo; -ERROR: field name must not be null --- json_object --- empty object, one dimension -SELECT json_object('{}'); - json_object -------------- - {} -(1 row) - --- empty object, two dimensions -SELECT json_object('{}', '{}'); - json_object -------------- - {} -(1 row) - --- one dimension -SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}'); - json_object -------------------------------------------------------- - {"a" : "1", "b" : "2", "3" : null, "d e f" : "a b c"} -(1 row) - --- same but with two dimensions -SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); - json_object -------------------------------------------------------- - {"a" : "1", "b" : "2", "3" : null, "d e f" : "a b c"} -(1 row) - --- odd number error -SELECT json_object('{a,b,c}'); -ERROR: array must have even number of elements --- one column error -SELECT json_object('{{a},{b}}'); -ERROR: array must have two columns --- too many columns error -SELECT json_object('{{a,b,c},{b,c,d}}'); -ERROR: array must have two columns --- too many dimensions error -SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}'); -ERROR: wrong number of array subscripts ---two argument form of json_object -select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}'); - json_object ------------------------------------------------------- - {"a" : "1", "b" : "2", "c" : "3", "d e f" : "a b c"} -(1 row) - --- too many dimensions -SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); -ERROR: wrong number of array subscripts --- mismatched dimensions -select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}'); -ERROR: mismatched array dimensions -select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); -ERROR: mismatched array dimensions --- null key error -select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}'); -ERROR: null value not allowed for object key --- empty key is allowed -select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}'); - json_object ------------------------------------------------------ - {"a" : "1", "b" : "2", "" : "3", "d e f" : "a b c"} -(1 row) - --- json_strip_nulls -select json_strip_nulls(null); - json_strip_nulls ------------------- - -(1 row) - -select json_strip_nulls('1'); - json_strip_nulls ------------------- - 1 -(1 row) - -select json_strip_nulls('"a string"'); - json_strip_nulls ------------------- - "a string" -(1 row) - -select json_strip_nulls('null'); - json_strip_nulls ------------------- - null -(1 row) - -select json_strip_nulls('[1,2,null,3,4]'); - json_strip_nulls ------------------- - [1,2,null,3,4] -(1 row) - -select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}'); - json_strip_nulls ------------------------------------- - {"a":1,"c":[2,null,3],"d":{"e":4}} -(1 row) - -select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]'); - json_strip_nulls ---------------------- - [1,{"a":1,"c":2},3] -(1 row) - --- an empty object is not null and should not be stripped -select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }'); - json_strip_nulls ------------------- - {"a":{},"d":{}} -(1 row) - diff --git a/ydb/library/yql/tests/postgresql/cases/json.sql b/ydb/library/yql/tests/postgresql/cases/json.sql deleted file mode 100644 index 83bcc80518f4..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/json.sql +++ /dev/null @@ -1,271 +0,0 @@ --- Strings. -SELECT '""'::json; -- OK. -SELECT $$''$$::json; -- ERROR, single quotes are not allowed -SELECT '"abc"'::json; -- OK -SELECT '"abc'::json; -- ERROR, quotes not closed -SELECT '"abc -def"'::json; -- ERROR, unescaped newline in string constant -SELECT '"\n\"\\"'::json; -- OK, legal escapes -SELECT '"\v"'::json; -- ERROR, not a valid JSON escape --- see json_encoding test for input with unicode escapes --- Numbers. -SELECT '1'::json; -- OK -SELECT '0'::json; -- OK -SELECT '01'::json; -- ERROR, not valid according to JSON spec -SELECT '0.1'::json; -- OK -SELECT '9223372036854775808'::json; -- OK, even though it's too large for int8 -SELECT '1e100'::json; -- OK -SELECT '1.3e100'::json; -- OK -SELECT '1f2'::json; -- ERROR -SELECT '0.x1'::json; -- ERROR -SELECT '1.3ex100'::json; -- ERROR --- Arrays. -SELECT '[]'::json; -- OK -SELECT '[1,2]'::json; -- OK -SELECT '[1,2,]'::json; -- ERROR, trailing comma -SELECT '[1,2'::json; -- ERROR, no closing bracket -SELECT '[1,[2]'::json; -- ERROR, no closing bracket --- Objects. -SELECT '{}'::json; -- OK -SELECT '{"abc"}'::json; -- ERROR, no value -SELECT '{"abc":1}'::json; -- OK -SELECT '{1:"abc"}'::json; -- ERROR, keys must be strings -SELECT '{"abc",1}'::json; -- ERROR, wrong separator -SELECT '{"abc"=1}'::json; -- ERROR, totally wrong separator -SELECT '{"abc"::1}'::json; -- ERROR, another wrong separator -SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::json; -- OK -SELECT '{"abc":1:2}'::json; -- ERROR, colon in wrong spot -SELECT '{"abc":1,3}'::json; -- ERROR, no value --- Miscellaneous stuff. -SELECT 'true'::json; -- OK -SELECT 'false'::json; -- OK -SELECT 'null'::json; -- OK -SELECT ' true '::json; -- OK, even with extra whitespace -SELECT 'true false'::json; -- ERROR, too many values -SELECT 'true, false'::json; -- ERROR, too many values -SELECT 'truf'::json; -- ERROR, not a keyword -SELECT 'trues'::json; -- ERROR, not a keyword -SELECT ''::json; -- ERROR, no value -SELECT ' '::json; -- ERROR, no value -SELECT '{ - "one": 1, - "two":,"two", -- ERROR extraneous comma before field "two" - "three": - true}'::json; -SELECT '{ - "one": 1, - "two":"two", - "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::json; --- ERROR missing value for last field ---constructors --- array_to_json -SELECT array_to_json(array(select 1 as a)); -SELECT array_to_json(array_agg(x),false) from generate_series(5,10) x; -SELECT array_to_json('{{1,5},{99,100}}'::int[]); -BEGIN; -SET LOCAL TIME ZONE 10.5; -SET LOCAL TIME ZONE -8; -COMMIT; --- non-numeric output -SELECT row_to_json(q) -FROM (SELECT 'NaN'::float8 AS "float8field") q; -SELECT row_to_json(q) -FROM (SELECT 'Infinity'::float8 AS "float8field") q; -SELECT row_to_json(q) -FROM (SELECT '-Infinity'::float8 AS "float8field") q; --- json input -SELECT row_to_json(q) -FROM (SELECT '{"a":1,"b": [2,3,4,"d","e","f"],"c":{"p":1,"q":2}}'::json AS "jsonfield") q; --- json extraction functions -CREATE TEMP TABLE test_json ( - json_type text, - test_json json -); -INSERT INTO test_json VALUES -('scalar','"a scalar"'), -('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'), -('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}'); -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'scalar'; -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'array'; -SELECT test_json -> 'x' -FROM test_json -WHERE json_type = 'object'; -SELECT test_json->'field2' -FROM test_json -WHERE json_type = 'object'; -SELECT test_json->>'field2' -FROM test_json -WHERE json_type = 'object'; -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'scalar'; -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'array'; -SELECT test_json -> -1 -FROM test_json -WHERE json_type = 'array'; -SELECT test_json -> 2 -FROM test_json -WHERE json_type = 'object'; -SELECT test_json->>2 -FROM test_json -WHERE json_type = 'array'; -SELECT test_json ->> 6 FROM test_json WHERE json_type = 'array'; -SELECT test_json ->> 7 FROM test_json WHERE json_type = 'array'; -SELECT test_json ->> 'field4' FROM test_json WHERE json_type = 'object'; -SELECT test_json ->> 'field5' FROM test_json WHERE json_type = 'object'; -SELECT test_json ->> 'field6' FROM test_json WHERE json_type = 'object'; --- nulls -select (test_json->'field3') is null as expect_false -from test_json -where json_type = 'object'; -select (test_json->>'field3') is null as expect_true -from test_json -where json_type = 'object'; -select (test_json->3) is null as expect_false -from test_json -where json_type = 'array'; -select (test_json->>3) is null as expect_true -from test_json -where json_type = 'array'; --- corner cases -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::text; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> null::int; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 1; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> -1; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> 'z'; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json -> ''; -select '[{"b": "c"}, {"b": "cc"}]'::json -> 1; -select '[{"b": "c"}, {"b": "cc"}]'::json -> 3; -select '[{"b": "c"}, {"b": "cc"}]'::json -> 'z'; -select '{"a": "c", "b": null}'::json -> 'b'; -select '"foo"'::json -> 1; -select '"foo"'::json -> 'z'; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::text; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> null::int; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 1; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> 'z'; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::json ->> ''; -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 1; -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 3; -select '[{"b": "c"}, {"b": "cc"}]'::json ->> 'z'; -select '{"a": "c", "b": null}'::json ->> 'b'; -select '"foo"'::json ->> 1; -select '"foo"'::json ->> 'z'; --- array length -SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); -SELECT json_array_length('[]'); -SELECT json_array_length('{"f1":1,"f2":[5,6]}'); -SELECT json_array_length('4'); -select * from json_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; -select * from json_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; --- extract_path, extract_path_as_text -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); -select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); -select json_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); -select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); -select json_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); --- extract_path nulls -select json_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_false; -select json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') is null as expect_true; -select json_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_false; -select json_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') is null as expect_true; -select * from json_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; -select * from json_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; --- test type info caching in json_populate_record() -CREATE TEMP TABLE jspoptest (js json); -INSERT INTO jspoptest -SELECT '{ - "jsa": [1, "2", null, 4], - "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}, - "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}] -}'::json -FROM generate_series(1, 3); ---json_typeof() function -select value, json_typeof(value) - from (values (json '123.4'), - (json '-1'), - (json '"foo"'), - (json 'true'), - (json 'false'), - (json 'null'), - (json '[1, 2, 3]'), - (json '[]'), - (json '{"x":"foo", "y":123}'), - (json '{}'), - (NULL::json)) - as data(value); --- json_build_array, json_build_object, json_object_agg -SELECT json_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); -SELECT json_build_array('a', NULL); -- ok -SELECT json_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); -SELECT json_build_object('{a,b,c}'::text[]); -- error -SELECT json_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array -SELECT json_build_object('a', 'b', 'c'); -- error -SELECT json_build_object(NULL, 'a'); -- error, key cannot be NULL -SELECT json_build_object('a', NULL); -- ok --- empty objects/arrays -SELECT json_build_array(); -SELECT json_build_object(); --- make sure keys are quoted -SELECT json_build_object(1,2); --- keys must be scalar and not null -SELECT json_build_object(null,2); -SELECT json_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; -SELECT json_build_object(json '{"a":1,"b":2}', 3); -SELECT json_build_object('{1,2,3}'::int[], 3); -CREATE TEMP TABLE foo (serial_num int, name text, type text); -INSERT INTO foo VALUES (847001,'t15','GE1043'); -INSERT INTO foo VALUES (847002,'t16','GE1043'); -INSERT INTO foo VALUES (847003,'sub-alpha','GESS90'); -SELECT json_build_object('turbines',json_object_agg(serial_num,json_build_object('name',name,'type',type))) -FROM foo; -SELECT json_object_agg(name, type) FROM foo; -INSERT INTO foo VALUES (999999, NULL, 'bar'); -SELECT json_object_agg(name, type) FROM foo; --- json_object --- empty object, one dimension -SELECT json_object('{}'); --- empty object, two dimensions -SELECT json_object('{}', '{}'); --- one dimension -SELECT json_object('{a,1,b,2,3,NULL,"d e f","a b c"}'); --- same but with two dimensions -SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); --- odd number error -SELECT json_object('{a,b,c}'); --- one column error -SELECT json_object('{{a},{b}}'); --- too many columns error -SELECT json_object('{{a,b,c},{b,c,d}}'); --- too many dimensions error -SELECT json_object('{{{a,b},{c,d}},{{b,c},{d,e}}}'); ---two argument form of json_object -select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}'); --- too many dimensions -SELECT json_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); --- mismatched dimensions -select json_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}'); -select json_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); --- null key error -select json_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}'); --- empty key is allowed -select json_object('{a,b,"","d e f"}','{1,2,3,"a b c"}'); --- json_strip_nulls -select json_strip_nulls(null); -select json_strip_nulls('1'); -select json_strip_nulls('"a string"'); -select json_strip_nulls('null'); -select json_strip_nulls('[1,2,null,3,4]'); -select json_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}'); -select json_strip_nulls('[1,{"a":1,"b":null,"c":2},3]'); --- an empty object is not null and should not be stripped -select json_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }'); diff --git a/ydb/library/yql/tests/postgresql/cases/jsonb.err b/ydb/library/yql/tests/postgresql/cases/jsonb.err deleted file mode 100644 index 7b99270eb494..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/jsonb.err +++ /dev/null @@ -1,6964 +0,0 @@ -Registering pre-existing tables - testjsonb - --- Strings. -SELECT '""'::jsonb; -- OK. - - -SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "'" is invalid. -CONTEXT: JSON data, line 1: '... - - SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed - ^ - -SELECT '"abc"'::jsonb; -- OK - - -SELECT '"abc'::jsonb; -- ERROR, quotes not closed - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '"abc'::jsonb; -- ERROR, quotes not closed - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token ""abc" is invalid. -CONTEXT: JSON data, line 1: "abc - - SELECT '"abc'::jsonb; -- ERROR, quotes not closed - ^ - -SELECT '"abc -def"'::jsonb; -- ERROR, unescaped newline in string constant - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '"abc - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Character with value 0x0a must be escaped. -CONTEXT: JSON data, line 1: "abc - - SELECT '"abc - ^ - -SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes - - -SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Escape sequence "\v" is invalid. -CONTEXT: JSON data, line 1: "\v... - - SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape - ^ - --- see json_encoding test for input with unicode escapes --- Numbers. -SELECT '1'::jsonb; -- OK - - -SELECT '0'::jsonb; -- OK - - -SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "01" is invalid. -CONTEXT: JSON data, line 1: 01 - - SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec - ^ - -SELECT '0.1'::jsonb; -- OK - - -SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8 - - -SELECT '1e100'::jsonb; -- OK - - -SELECT '1.3e100'::jsonb; -- OK - - -SELECT '1f2'::jsonb; -- ERROR - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '1f2'::jsonb; -- ERROR - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "1f2" is invalid. -CONTEXT: JSON data, line 1: 1f2 - - SELECT '1f2'::jsonb; -- ERROR - ^ - -SELECT '0.x1'::jsonb; -- ERROR - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '0.x1'::jsonb; -- ERROR - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "0.x1" is invalid. -CONTEXT: JSON data, line 1: 0.x1 - - SELECT '0.x1'::jsonb; -- ERROR - ^ - -SELECT '1.3ex100'::jsonb; -- ERROR - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '1.3ex100'::jsonb; -- ERROR - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "1.3ex100" is invalid. -CONTEXT: JSON data, line 1: 1.3ex100 - - SELECT '1.3ex100'::jsonb; -- ERROR - ^ - --- Arrays. -SELECT '[]'::jsonb; -- OK - - -SELECT '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'::jsonb; -- OK - - -SELECT '[1,2]'::jsonb; -- OK - - -SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found "]". -CONTEXT: JSON data, line 1: [1,2,] - - SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma - ^ - -SELECT '[1,2'::jsonb; -- ERROR, no closing bracket - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '[1,2'::jsonb; -- ERROR, no closing bracket - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,2 - - SELECT '[1,2'::jsonb; -- ERROR, no closing bracket - ^ - -SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,[2] - - SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket - ^ - --- Objects. -SELECT '{}'::jsonb; -- OK - - -SELECT '{"abc"}'::jsonb; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc"}'::jsonb; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected ":", but found "}". -CONTEXT: JSON data, line 1: {"abc"} - - SELECT '{"abc"}'::jsonb; -- ERROR, no value - ^ - -SELECT '{"abc":1}'::jsonb; -- OK - - -SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected string or "}", but found "1". -CONTEXT: JSON data, line 1: {1... - - SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings - ^ - -SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected ":", but found ",". -CONTEXT: JSON data, line 1: {"abc",... - - SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator - ^ - -SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "=" is invalid. -CONTEXT: JSON data, line 1: {"abc"=... - - SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator - ^ - -SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found ":". -CONTEXT: JSON data, line 1: {"abc"::... - - SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator - ^ - -SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK - - -SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected "," or "}", but found ":". -CONTEXT: JSON data, line 1: {"abc":1:... - - SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot - ^ - -SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected string, but found "3". -CONTEXT: JSON data, line 1: {"abc":1,3... - - SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value - ^ - --- Miscellaneous stuff. -SELECT 'true'::jsonb; -- OK - - -SELECT 'false'::jsonb; -- OK - - -SELECT 'null'::jsonb; -- OK - - -SELECT ' true '::jsonb; -- OK, even with extra whitespace - - -SELECT 'true false'::jsonb; -- ERROR, too many values - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'true false'::jsonb; -- ERROR, too many values - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected end of input, but found "false". -CONTEXT: JSON data, line 1: true false - - SELECT 'true false'::jsonb; -- ERROR, too many values - ^ - -SELECT 'true, false'::jsonb; -- ERROR, too many values - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'true, false'::jsonb; -- ERROR, too many values - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected end of input, but found ",". -CONTEXT: JSON data, line 1: true,... - - SELECT 'true, false'::jsonb; -- ERROR, too many values - ^ - -SELECT 'truf'::jsonb; -- ERROR, not a keyword - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'truf'::jsonb; -- ERROR, not a keyword - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "truf" is invalid. -CONTEXT: JSON data, line 1: truf - - SELECT 'truf'::jsonb; -- ERROR, not a keyword - ^ - -SELECT 'trues'::jsonb; -- ERROR, not a keyword - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT 'trues'::jsonb; -- ERROR, not a keyword - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Token "trues" is invalid. -CONTEXT: JSON data, line 1: trues - - SELECT 'trues'::jsonb; -- ERROR, not a keyword - ^ - -SELECT ''::jsonb; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT ''::jsonb; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: - - SELECT ''::jsonb; -- ERROR, no value - ^ - -SELECT ' '::jsonb; -- ERROR, no value - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT ' '::jsonb; -- ERROR, no value - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: - - SELECT ' '::jsonb; -- ERROR, no value - ^ - --- Multi-line JSON input to check ERROR reporting -SELECT '{ - "one": 1, - "two":"two", - "three": - true}'::jsonb; -- OK - - -SELECT '{ - "one": 1, - "two":,"two", -- ERROR extraneous comma before field "two" - "three": - true}'::jsonb; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{ - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found ",". -CONTEXT: JSON data, line 3: "two":,... - - SELECT '{ - ^ - -SELECT '{ - "one": 1, - "two":"two", - "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT '{ - ^ - -stdin-:
:1:1: Fatal: ERROR: invalid input syntax for type json -DETAIL: Expected JSON value, but found "}". -CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":} - - SELECT '{ - ^ - --- ERROR missing value for last field --- make sure jsonb is passed through json generators without being escaped -SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']); - - --- anyarray column -CREATE TEMP TABLE rows AS -SELECT x, 'txt' || x as y -FROM generate_series(1,3) AS x; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 277 - -- anyarray column - ^ - -analyze rows; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 275 - analyze rows; - ^ - -select attname, to_jsonb(histogram_bounds) histogram_bounds -from pg_stats -where tablename = 'rows' and - schemaname = pg_my_temp_schema()::regnamespace::text -order by 1; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select attname, to_jsonb(histogram_bounds) histogram_bounds - ^ - -stdin-:
:1:17: Error: At function: PgCall - select attname, to_jsonb(histogram_bounds) histogram_bounds - ^ - -stdin-:
:1:17: Error: Unable to find an overload for proc to_jsonb with given argument types: (anyarray) - select attname, to_jsonb(histogram_bounds) histogram_bounds - ^ - --- to_jsonb, timestamps -select to_jsonb(timestamp '2014-05-28 12:22:35.614298'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- to_jsonb, timestamps - ^ - -stdin-:
:2:8: Error: At function: PgCall - select to_jsonb(timestamp '2014-05-28 12:22:35.614298'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamp) - select to_jsonb(timestamp '2014-05-28 12:22:35.614298'); - ^ - -BEGIN; - - -SET LOCAL TIME ZONE 10.5; - - -select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz) - select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -SET LOCAL TIME ZONE -8; - - -select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz) - select to_jsonb(timestamptz '2014-05-28 12:22:35.614298-04'); - ^ - -COMMIT; - - -select to_jsonb(date '2014-05-28'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(date '2014-05-28'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(date '2014-05-28'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (date) - select to_jsonb(date '2014-05-28'); - ^ - -select to_jsonb(date 'Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(date 'Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(date 'Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (date) - select to_jsonb(date 'Infinity'); - ^ - -select to_jsonb(date '-Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(date '-Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(date '-Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (date) - select to_jsonb(date '-Infinity'); - ^ - -select to_jsonb(timestamp 'Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(timestamp 'Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(timestamp 'Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamp) - select to_jsonb(timestamp 'Infinity'); - ^ - -select to_jsonb(timestamp '-Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(timestamp '-Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(timestamp '-Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamp) - select to_jsonb(timestamp '-Infinity'); - ^ - -select to_jsonb(timestamptz 'Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(timestamptz 'Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(timestamptz 'Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz) - select to_jsonb(timestamptz 'Infinity'); - ^ - -select to_jsonb(timestamptz '-Infinity'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select to_jsonb(timestamptz '-Infinity'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select to_jsonb(timestamptz '-Infinity'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc to_jsonb with given argument types: (timestamptz) - select to_jsonb(timestamptz '-Infinity'); - ^ - ---jsonb_agg -SELECT jsonb_agg(q) - FROM ( SELECT $$a$$ || x AS b, y AS c, - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ROW(y.*,ARRAY[4,5,6])] AS z - FROM generate_series(1,2) x, - generate_series(4,5) y) q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:4:16: Error: alternative is not implemented yet : 138 - ARRAY[ROW(x.*,ARRAY[1,2,3]), - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - --jsonb_agg - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - --jsonb_agg - ^ - -SELECT jsonb_agg(q ORDER BY x, y) - FROM rows q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported agg_order - SELECT jsonb_agg(q ORDER BY x, y) - ^ - -UPDATE rows SET x = NULL WHERE x = 1; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -SELECT jsonb_agg(q ORDER BY x NULLS FIRST, y) - FROM rows q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported agg_order - SELECT jsonb_agg(q ORDER BY x NULLS FIRST, y) - ^ - --- jsonb extraction functions -CREATE TEMP TABLE test_jsonb ( - json_type text, - test_json jsonb -); - - -INSERT INTO test_jsonb VALUES -('scalar','"a scalar"'), -('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'), -('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}'); - - -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar'; - - -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array'; - - -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object'; - - -SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object'; - - -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar'; - - -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array'; - - -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object'; - - -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar'; - - -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array'; - - -SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array'; - - -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object'; - - -SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array'; - - -SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array'; - - -SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object'; - - -SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object'; - - -SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object'; - - -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar'; - - -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array'; - - -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object'; - - -SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'scalar'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'scalar'; - ^ - -SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'array'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'array'; - ^ - -SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'object'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_object_keys(test_json) FROM test_jsonb WHERE json_type = 'object'; - ^ - --- nulls -SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object'; - - -SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object'; - - -SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array'; - - -SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array'; - - --- corner cases -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z'; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> ''; - - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1; - - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3; - - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z'; - - -select '{"a": "c", "b": null}'::jsonb -> 'b'; - - -select '"foo"'::jsonb -> 1; - - -select '"foo"'::jsonb -> 'z'; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z'; - - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> ''; - - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1; - - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3; - - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z'; - - -select '{"a": "c", "b": null}'::jsonb ->> 'b'; - - -select '"foo"'::jsonb ->> 1; - - -select '"foo"'::jsonb ->> 'z'; - - --- equality and inequality -SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb; - - -SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb; - - -SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb; - - -SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb; - - --- containment -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}'); - - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}'); - - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}'); - - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}'); - - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}'); - - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}'); - - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}'); - - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}'; - - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}'; - - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}'; - - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}'; - - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}'; - - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}'; - - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}'; - - -SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb; - - -SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb; - - -SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb; - - -SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb; - - -SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb; - - -SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb; - - -SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}'); - - -SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}'); - - -SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}'); - - -SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}'); - - -SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}'); - - -SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}'); - - -SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}'); - - -SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - - -SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - - -SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - - -SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - - -SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - - -SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - - -SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - - --- Raw scalar may contain another raw scalar, array may contain a raw scalar -SELECT '[5]'::jsonb @> '[5]'; - - -SELECT '5'::jsonb @> '5'; - - -SELECT '[5]'::jsonb @> '5'; - - --- But a raw scalar cannot contain an array -SELECT '5'::jsonb @> '[5]'; - - --- In general, one thing should always contain itself. Test array containment: -SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb; - - -SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb; - - --- array containment string matching confusion bug -SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}'; - - --- array length -SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); - - -SELECT jsonb_array_length('[]'); - - -SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot get array length of a non-array - - SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}'); - ^ - -SELECT jsonb_array_length('4'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_array_length('4'); - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot get array length of a scalar - - SELECT jsonb_array_length('4'); - ^ - --- each -SELECT jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null}'); - ^ - -SELECT jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - ^ - -SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - - -SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - - -SELECT jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":"null"}'); - ^ - -SELECT jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - ^ - -SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - - -SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - - --- exists -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a'); - - -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b'); - - -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c'); - - -SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a'); - - -SELECT jsonb '{"a":null, "b":"qq"}' ? 'a'; - - -SELECT jsonb '{"a":null, "b":"qq"}' ? 'b'; - - -SELECT jsonb '{"a":null, "b":"qq"}' ? 'c'; - - -SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a'; - - --- array exists - array elements should behave as keys -SELECT count(*) from testjsonb WHERE j->'array' ? 'bar'; - - --- type sensitive array exists - should return no rows (since "exists" only --- matches strings that are either object keys or array elements) -SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text; - - --- However, a raw scalar is *contained* within the array -SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb; - - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']); - - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']); - - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']); - - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']); - - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]); - - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[]; - - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']); - - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']); - - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']); - - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']); - - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]); - - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b']; - - -SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[]; - - --- typeof -SELECT jsonb_typeof('{}') AS object; - - -SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object; - - -SELECT jsonb_typeof('[]') AS array; - - -SELECT jsonb_typeof('["a", 1]') AS array; - - -SELECT jsonb_typeof('null') AS "null"; - - -SELECT jsonb_typeof('1') AS number; - - -SELECT jsonb_typeof('-1') AS number; - - -SELECT jsonb_typeof('1.0') AS number; - - -SELECT jsonb_typeof('1e2') AS number; - - -SELECT jsonb_typeof('-1.0') AS number; - - -SELECT jsonb_typeof('true') AS boolean; - - -SELECT jsonb_typeof('false') AS boolean; - - -SELECT jsonb_typeof('"hello"') AS string; - - -SELECT jsonb_typeof('"true"') AS string; - - -SELECT jsonb_typeof('"1.0"') AS string; - - --- jsonb_build_array, jsonb_build_object, jsonb_object_agg -SELECT jsonb_build_array('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- jsonb_build_array, jsonb_build_object, jsonb_object_agg - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - -- jsonb_build_array, jsonb_build_object, jsonb_object_agg - ^ - -SELECT jsonb_build_array('a', NULL); -- ok - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_array('a', NULL); -- ok - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - SELECT jsonb_build_array('a', NULL); -- ok - ^ - -SELECT jsonb_build_array(VARIADIC NULL::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_array(VARIADIC NULL::text[]); -- ok - ^ - -SELECT jsonb_build_array(VARIADIC '{}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_array(VARIADIC '{}'::text[]); -- ok - ^ - -SELECT jsonb_build_array(VARIADIC '{a,b,c}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_array(VARIADIC '{a,b,c}'::text[]); -- ok - ^ - -SELECT jsonb_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_array(VARIADIC ARRAY['a', NULL]::text[]); -- ok - ^ - -SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::text[]); -- ok - ^ - -SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_array(VARIADIC '{1,2,3,4}'::int[]); -- ok - ^ - -SELECT jsonb_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_array(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - ^ - -SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - SELECT jsonb_build_object('a',1,'b',1.2,'c',true,'d',null,'e',json '{"x": 3, "y": [1,2,3]}'); - ^ - -SELECT jsonb_build_object( - 'a', jsonb_build_object('b',false,'c',99), - 'd', jsonb_build_object('e',array[9,8,7]::int[], - 'f', (select row_to_json(r) from ( select relkind, oid::regclass as name from pg_class where relname = 'pg_class') r))); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object( - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - SELECT jsonb_build_object( - ^ - -SELECT jsonb_build_object('{a,b,c}'::text[]); -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object('{a,b,c}'::text[]); -- error - ^ - -stdin-:
:1:1: Fatal: ERROR: argument list must have even number of elements -HINT: The arguments of jsonb_build_object() must consist of alternating keys and values. - - SELECT jsonb_build_object('{a,b,c}'::text[]); -- error - ^ - -SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array - ^ - -SELECT jsonb_build_object('a', 'b', 'c'); -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object('a', 'b', 'c'); -- error - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - SELECT jsonb_build_object('a', 'b', 'c'); -- error - ^ - -SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - SELECT jsonb_build_object(NULL, 'a'); -- error, key cannot be NULL - ^ - -SELECT jsonb_build_object('a', NULL); -- ok - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object('a', NULL); -- ok - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - SELECT jsonb_build_object('a', NULL); -- ok - ^ - -SELECT jsonb_build_object(VARIADIC NULL::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC NULL::text[]); -- ok - ^ - -SELECT jsonb_build_object(VARIADIC '{}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC '{}'::text[]); -- ok - ^ - -SELECT jsonb_build_object(VARIADIC '{a,b,c}'::text[]); -- error - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC '{a,b,c}'::text[]); -- error - ^ - -SELECT jsonb_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC ARRAY['a', NULL]::text[]); -- ok - ^ - -SELECT jsonb_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC ARRAY[NULL, 'a']::text[]); -- error, key cannot be NULL - ^ - -SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::text[]); -- ok - ^ - -SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC '{1,2,3,4}'::int[]); -- ok - ^ - -SELECT jsonb_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: FuncCall: unsupported func_variadic - SELECT jsonb_build_object(VARIADIC '{{1,4},{2,5},{3,6}}'::int[][]); -- ok - ^ - --- empty objects/arrays -SELECT jsonb_build_array(); - - -SELECT jsonb_build_object(); - - --- make sure keys are quoted -SELECT jsonb_build_object(1,2); - - --- keys must be scalar and not null -SELECT jsonb_build_object(null,2); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- keys must be scalar and not null - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - -- keys must be scalar and not null - ^ - -SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; - ^ - -SELECT jsonb_build_object(json '{"a":1,"b":2}', 3); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object(json '{"a":1,"b":2}', 3); - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT jsonb_build_object(json '{"a":1,"b":2}', 3); - ^ - -SELECT jsonb_build_object('{1,2,3}'::int[], 3); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_build_object('{1,2,3}'::int[], 3); - ^ - -stdin-:
:1:1: Fatal: ERROR: key value must be scalar, not array, composite, or json - - SELECT jsonb_build_object('{1,2,3}'::int[], 3); - ^ - --- handling of NULL values -SELECT jsonb_object_agg(1, NULL::jsonb); - - -SELECT jsonb_object_agg(NULL, '{"a":1}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - SELECT jsonb_object_agg(NULL, '{"a":1}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: field name must not be null - - SELECT jsonb_object_agg(NULL, '{"a":1}'); - ^ - -CREATE TEMP TABLE foo (serial_num int, name text, type text); - - -INSERT INTO foo VALUES (847001,'t15','GE1043'); - - -INSERT INTO foo VALUES (847002,'t16','GE1043'); - - -INSERT INTO foo VALUES (847003,'sub-alpha','GESS90'); - - -SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type))) -FROM foo; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: YtMapReduce! - SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type))) - ^ - -stdin-:
:1:1: Fatal: ERROR: could not determine data type for argument 1 - - SELECT jsonb_build_object('turbines',jsonb_object_agg(serial_num,jsonb_build_object('name',name,'type',type))) - ^ - -SELECT jsonb_object_agg(name, type) FROM foo; - - -INSERT INTO foo VALUES (999999, NULL, 'bar'); - - -SELECT jsonb_object_agg(name, type) FROM foo; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: YtMapReduce! - SELECT jsonb_object_agg(name, type) FROM foo; - ^ - -stdin-:
:1:1: Fatal: ERROR: field name must not be null - - SELECT jsonb_object_agg(name, type) FROM foo; - ^ - --- jsonb_object --- empty object, one dimension -SELECT jsonb_object('{}'); - - --- empty object, two dimensions -SELECT jsonb_object('{}', '{}'); - - --- one dimension -SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}'); - - --- same but with two dimensions -SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); - - --- odd number error -SELECT jsonb_object('{a,b,c}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- odd number error - ^ - -stdin-:
:1:1: Fatal: ERROR: array must have even number of elements - - -- odd number error - ^ - --- one column error -SELECT jsonb_object('{{a},{b}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- one column error - ^ - -stdin-:
:1:1: Fatal: ERROR: array must have two columns - - -- one column error - ^ - --- too many columns error -SELECT jsonb_object('{{a,b,c},{b,c,d}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- too many columns error - ^ - -stdin-:
:1:1: Fatal: ERROR: array must have two columns - - -- too many columns error - ^ - --- too many dimensions error -SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- too many dimensions error - ^ - -stdin-:
:1:1: Fatal: ERROR: wrong number of array subscripts - - -- too many dimensions error - ^ - ---two argument form of jsonb_object -select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}'); - - --- too many dimensions -SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- too many dimensions - ^ - -stdin-:
:1:1: Fatal: ERROR: wrong number of array subscripts - - -- too many dimensions - ^ - --- mismatched dimensions -select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- mismatched dimensions - ^ - -stdin-:
:1:1: Fatal: ERROR: mismatched array dimensions - - -- mismatched dimensions - ^ - -select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: mismatched array dimensions - - select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); - ^ - --- null key error -select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- null key error - ^ - -stdin-:
:1:1: Fatal: ERROR: null value not allowed for object key - - -- null key error - ^ - --- empty key is allowed -select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}'); - - --- extract_path, extract_path_as_text -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - - -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - - -SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - - -SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - - -SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - - -SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - - --- extract_path nulls -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false; - - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true; - - -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false; - - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true; - - --- extract_path operators -SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- extract_path operators - ^ - -stdin-:
:2:62: Error: At function: PgOp - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6']; - ^ - -stdin-:
:2:62: Error: No such operator: #> - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f4','f6']; - ^ - -SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2']; - ^ - -stdin-:
:1:62: Error: At function: PgOp - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2']; - ^ - -stdin-:
:1:62: Error: No such operator: #> - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2']; - ^ - -SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0']; - ^ - -stdin-:
:1:62: Error: At function: PgOp - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0']; - ^ - -stdin-:
:1:62: Error: No such operator: #> - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','0']; - ^ - -SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1']; - ^ - -stdin-:
:1:62: Error: At function: PgOp - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1']; - ^ - -stdin-:
:1:62: Error: No such operator: #> - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>array['f2','1']; - ^ - -SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6']; - ^ - -stdin-:
:1:62: Error: At function: PgOp - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6']; - ^ - -stdin-:
:1:62: Error: No such operator: #>> - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f4','f6']; - ^ - -SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2']; - ^ - -stdin-:
:1:62: Error: At function: PgOp - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2']; - ^ - -stdin-:
:1:62: Error: No such operator: #>> - SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2']; - ^ - -SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0']; - ^ - -stdin-:
:1:62: Error: At function: PgOp - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0']; - ^ - -stdin-:
:1:62: Error: No such operator: #>> - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','0']; - ^ - -SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1']; - ^ - -stdin-:
:1:62: Error: At function: PgOp - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1']; - ^ - -stdin-:
:1:62: Error: No such operator: #>> - SELECT '{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}'::jsonb#>>array['f2','1']; - ^ - --- corner cases for same -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- corner cases for same - ^ - -stdin-:
:2:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}'; - ^ - -stdin-:
:2:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}'; - ^ - -select '[1,2,3]'::jsonb #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[1,2,3]'::jsonb #> '{}'; - ^ - -stdin-:
:1:25: Error: At function: PgOp - select '[1,2,3]'::jsonb #> '{}'; - ^ - -stdin-:
:1:25: Error: No such operator: #> - select '[1,2,3]'::jsonb #> '{}'; - ^ - -select '"foo"'::jsonb #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::jsonb #> '{}'; - ^ - -stdin-:
:1:23: Error: At function: PgOp - select '"foo"'::jsonb #> '{}'; - ^ - -stdin-:
:1:23: Error: No such operator: #> - select '"foo"'::jsonb #> '{}'; - ^ - -select '42'::jsonb #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::jsonb #> '{}'; - ^ - -stdin-:
:1:20: Error: At function: PgOp - select '42'::jsonb #> '{}'; - ^ - -stdin-:
:1:20: Error: No such operator: #> - select '42'::jsonb #> '{}'; - ^ - -select 'null'::jsonb #> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select 'null'::jsonb #> '{}'; - ^ - -stdin-:
:1:22: Error: At function: PgOp - select 'null'::jsonb #> '{}'; - ^ - -stdin-:
:1:22: Error: No such operator: #> - select 'null'::jsonb #> '{}'; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null]; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null]; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null]; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', null]; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', '']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', '']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', '']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a', '']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','b','c','d']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #> array['a','z','c']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b']; - ^ - -stdin-:
:1:50: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b']; - ^ - -stdin-:
:1:50: Error: No such operator: #> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','1','b']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b']; - ^ - -stdin-:
:1:50: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b']; - ^ - -stdin-:
:1:50: Error: No such operator: #> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #> array['a','z','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['1','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #> array['z','b']; - ^ - -select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #> - select '[{"b": "c"}, {"b": null}]'::jsonb #> array['1','b']; - ^ - -select '"foo"'::jsonb #> array['z']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::jsonb #> array['z']; - ^ - -stdin-:
:1:23: Error: At function: PgOp - select '"foo"'::jsonb #> array['z']; - ^ - -stdin-:
:1:23: Error: No such operator: #> - select '"foo"'::jsonb #> array['z']; - ^ - -select '42'::jsonb #> array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::jsonb #> array['f2']; - ^ - -stdin-:
:1:20: Error: At function: PgOp - select '42'::jsonb #> array['f2']; - ^ - -stdin-:
:1:20: Error: No such operator: #> - select '42'::jsonb #> array['f2']; - ^ - -select '42'::jsonb #> array['0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::jsonb #> array['0']; - ^ - -stdin-:
:1:20: Error: At function: PgOp - select '42'::jsonb #> array['0']; - ^ - -stdin-:
:1:20: Error: No such operator: #> - select '42'::jsonb #> array['0']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}'; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}'; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> '{}'; - ^ - -select '[1,2,3]'::jsonb #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[1,2,3]'::jsonb #>> '{}'; - ^ - -stdin-:
:1:25: Error: At function: PgOp - select '[1,2,3]'::jsonb #>> '{}'; - ^ - -stdin-:
:1:25: Error: No such operator: #>> - select '[1,2,3]'::jsonb #>> '{}'; - ^ - -select '"foo"'::jsonb #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::jsonb #>> '{}'; - ^ - -stdin-:
:1:23: Error: At function: PgOp - select '"foo"'::jsonb #>> '{}'; - ^ - -stdin-:
:1:23: Error: No such operator: #>> - select '"foo"'::jsonb #>> '{}'; - ^ - -select '42'::jsonb #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::jsonb #>> '{}'; - ^ - -stdin-:
:1:20: Error: At function: PgOp - select '42'::jsonb #>> '{}'; - ^ - -stdin-:
:1:20: Error: No such operator: #>> - select '42'::jsonb #>> '{}'; - ^ - -select 'null'::jsonb #>> '{}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select 'null'::jsonb #>> '{}'; - ^ - -stdin-:
:1:22: Error: At function: PgOp - select 'null'::jsonb #>> '{}'; - ^ - -stdin-:
:1:22: Error: No such operator: #>> - select 'null'::jsonb #>> '{}'; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null]; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null]; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null]; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', null]; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', '']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', '']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', '']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a', '']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','b','c','d']; - ^ - -select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '{"a": {"b":{"c": "foo"}}}'::jsonb #>> array['a','z','c']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b']; - ^ - -stdin-:
:1:50: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b']; - ^ - -stdin-:
:1:50: Error: No such operator: #>> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','1','b']; - ^ - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b']; - ^ - -stdin-:
:1:50: Error: At function: PgOp - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b']; - ^ - -stdin-:
:1:50: Error: No such operator: #>> - select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb #>> array['a','z','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['1','b']; - ^ - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '[{"b": "c"}, {"b": "cc"}]'::jsonb #>> array['z','b']; - ^ - -select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b']; - ^ - -stdin-:
:1:43: Error: At function: PgOp - select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b']; - ^ - -stdin-:
:1:43: Error: No such operator: #>> - select '[{"b": "c"}, {"b": null}]'::jsonb #>> array['1','b']; - ^ - -select '"foo"'::jsonb #>> array['z']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '"foo"'::jsonb #>> array['z']; - ^ - -stdin-:
:1:23: Error: At function: PgOp - select '"foo"'::jsonb #>> array['z']; - ^ - -stdin-:
:1:23: Error: No such operator: #>> - select '"foo"'::jsonb #>> array['z']; - ^ - -select '42'::jsonb #>> array['f2']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::jsonb #>> array['f2']; - ^ - -stdin-:
:1:20: Error: At function: PgOp - select '42'::jsonb #>> array['f2']; - ^ - -stdin-:
:1:20: Error: No such operator: #>> - select '42'::jsonb #>> array['f2']; - ^ - -select '42'::jsonb #>> array['0']; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '42'::jsonb #>> array['0']; - ^ - -stdin-:
:1:20: Error: At function: PgOp - select '42'::jsonb #>> array['0']; - ^ - -stdin-:
:1:20: Error: No such operator: #>> - select '42'::jsonb #>> array['0']; - ^ - --- array_elements -SELECT jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]'); - ^ - -SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q; - - -SELECT jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]'); - ^ - -SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; - - --- populate_record -CREATE TYPE jbpop AS (a text, b int, c timestamp); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - -- populate_record - ^ - -CREATE DOMAIN jsb_int_not_null AS int NOT NULL; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - CREATE DOMAIN jsb_int_not_null AS int NOT NULL; - ^ - -CREATE DOMAIN jsb_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - CREATE DOMAIN jsb_int_array_1d AS int[] CHECK(array_length(VALUE, 1) = 3); - ^ - -CREATE DOMAIN jsb_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - CREATE DOMAIN jsb_int_array_2d AS int[][] CHECK(array_length(VALUE, 2) = 3); - ^ - -create type jb_unordered_pair as (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - create type jb_unordered_pair as (x int, y int); - ^ - -create domain jb_ordered_pair as jb_unordered_pair check((value).x <= (value).y); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 272 - create domain jb_ordered_pair as jb_unordered_pair check((value).x <= (value).y); - ^ - -CREATE TYPE jsbrec AS ( - i int, - ia _int4, - ia1 int[], - ia2 int[][], - ia3 int[][][], - ia1d jsb_int_array_1d, - ia2d jsb_int_array_2d, - t text, - ta text[], - c char(10), - ca char(10)[], - ts timestamp, - js json, - jsb jsonb, - jsa json[], - rec jbpop, - reca jbpop[] -); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - CREATE TYPE jsbrec AS ( - ^ - -CREATE TYPE jsbrec_i_not_null AS ( - i jsb_int_not_null -); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 314 - CREATE TYPE jsbrec_i_not_null AS ( - ^ - -SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jbpop - SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q; - ^ - -SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:71: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q; - ^ - -SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jbpop - SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":"blurfl","x":43.2}') q; - ^ - -SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:71: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":"blurfl","x":43.2}') q; - ^ - -SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":[100,200,false],"x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jbpop - SELECT * FROM jsonb_populate_record(NULL::jbpop,'{"a":[100,200,false],"x":43.2}') q; - ^ - -SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":[100,200,false],"x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:71: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"a":[100,200,false],"x":43.2}') q; - ^ - -SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"c":[100,200,false],"x":43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:71: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop,'{"c":[100,200,false],"x":43.2}') q; - ^ - -SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop, '{}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:71: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_record(row('x',3,'2012-12-31 15:30:56')::jbpop, '{}') q; - ^ - -SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"x": 43.2}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsbrec_i_not_null - SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"x": 43.2}') q; - ^ - -SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsbrec_i_not_null - SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": null}') q; - ^ - -SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": 12345}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsbrec_i_not_null - SELECT i FROM jsonb_populate_record(NULL::jsbrec_i_not_null, '{"i": 12345}') q; - ^ - -SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": null}') q; - ^ - -SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": 123}') q; - ^ - -SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [1, "2", null, 4]}') q; - ^ - -SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1, 2], [3, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1, 2], [3, 4]]}') q; - ^ - -SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], 2]}') q; - ^ - -SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": [[1], [2, 3]]}') q; - ^ - -SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ia FROM jsonb_populate_record(NULL::jsbrec, '{"ia": "{1,2,3}"}') q; - ^ - -SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": null}') q; - ^ - -SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": 123}') q; - ^ - -SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [1, "2", null, 4]}') q; - ^ - -SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [[1, 2, 3]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia1 FROM jsonb_populate_record(NULL::jsbrec, '{"ia1": [[1, 2, 3]]}') q; - ^ - -SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": null}') q; - ^ - -SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": 123}') q; - ^ - -SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null, 4]}') q; - ^ - -SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT ia1d FROM jsonb_populate_record(NULL::jsbrec, '{"ia1d": [1, "2", null]}') q; - ^ - -SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [1, "2", null, 4]}') q; - ^ - -SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [null, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [null, 4]]}') q; - ^ - -SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[], []]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[], []]}') q; - ^ - -SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], [3]]}') q; - ^ - -SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia2 FROM jsonb_populate_record(NULL::jsbrec, '{"ia2": [[1, 2], 3, 4]}') q; - ^ - -SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2"], [null, 4]]}') q; - ^ - -SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT ia2d FROM jsonb_populate_record(NULL::jsbrec, '{"ia2d": [[1, "2", 3], [null, 5, 6]]}') q; - ^ - -SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [1, "2", null, 4]}') q; - ^ - -SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [[1, 2], [null, 4]]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [[1, 2], [null, 4]]}') q; - ^ - -SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[], []], [[], []], [[], []] ]}') q; - ^ - -SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2]], [[3, 4]] ]}') q; - ^ - -SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8]] ]}') q; - ^ - -SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT ia3 FROM jsonb_populate_record(NULL::jsbrec, '{"ia3": [ [[1, 2], [3, 4]], [[5, 6], [7, 8], [9, 10]] ]}') q; - ^ - -SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": null}') q; - ^ - -SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": 123}') q; - ^ - -SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [1, "2", null, 4]}') q; - ^ - -SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ta FROM jsonb_populate_record(NULL::jsbrec, '{"ta": [[1, 2, 3], {"k": "v"}]}') q; - ^ - -SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsbrec - SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": null}') q; - ^ - -SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaa"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsbrec - SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaa"}') q; - ^ - -SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaa"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsbrec - SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaa"}') q; - ^ - -SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaaaaa"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:43: Error: Unknown type: jsbrec - SELECT c FROM jsonb_populate_record(NULL::jsbrec, '{"c": "aaaaaaaaaaaaa"}') q; - ^ - -SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": null}') q; - ^ - -SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": 123}') q; - ^ - -SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [1, "2", null, 4]}') q; - ^ - -SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": ["aaaaaaaaaaaaaaaa"]}') q; - ^ - -SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT ca FROM jsonb_populate_record(NULL::jsbrec, '{"ca": [[1, 2, 3], {"k": "v"}]}') q; - ^ - -SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": null}') q; - ^ - -SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": true}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": true}') q; - ^ - -SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": 123.45}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": 123.45}') q; - ^ - -SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "123.45"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "123.45"}') q; - ^ - -SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "abc"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": "abc"}') q; - ^ - -SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": [123, "123", null, {"key": "value"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": [123, "123", null, {"key": "value"}]}') q; - ^ - -SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:44: Error: Unknown type: jsbrec - SELECT js FROM jsonb_populate_record(NULL::jsbrec, '{"js": {"a": "bbb", "b": null, "c": 123.45}}') q; - ^ - -SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": null}') q; - ^ - -SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": true}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": true}') q; - ^ - -SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": 123.45}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": 123.45}') q; - ^ - -SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "123.45"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "123.45"}') q; - ^ - -SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "abc"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": "abc"}') q; - ^ - -SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": [123, "123", null, {"key": "value"}]}') q; - ^ - -SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsb FROM jsonb_populate_record(NULL::jsbrec, '{"jsb": {"a": "bbb", "b": null, "c": 123.45}}') q; - ^ - -SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": null}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": null}') q; - ^ - -SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": 123}') q; - ^ - -SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": [1, "2", null, 4]}') q; - ^ - -SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q; - ^ - -SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": 123}') q; - ^ - -SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": [1, 2]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": [1, 2]}') q; - ^ - -SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}') q; - ^ - -SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": "(abc,42,01.02.2003)"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:45: Error: Unknown type: jsbrec - SELECT rec FROM jsonb_populate_record(NULL::jsbrec, '{"rec": "(abc,42,01.02.2003)"}') q; - ^ - -SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": 123}') q; - ^ - -SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [1, 2]}') q; - ^ - -SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}]}') q; - ^ - -SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": ["(abc,42,01.02.2003)"]}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": ["(abc,42,01.02.2003)"]}') q; - ^ - -SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jsbrec - SELECT reca FROM jsonb_populate_record(NULL::jsbrec, '{"reca": "{\"(abc,42,01.02.2003)\"}"}') q; - ^ - -SELECT rec FROM jsonb_populate_record( - row(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - row('x',3,'2012-12-31 15:30:56')::jbpop,NULL)::jsbrec, - '{"rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}}' -) q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:3:50: Error: alternative is not implemented yet : 138 - row('x',3,'2012-12-31 15:30:56')::jbpop,NULL)::jsbrec, - ^ - --- anonymous record type -SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 1}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- anonymous record type - ^ - -stdin-:
:2:8: Error: At function: PgCall - SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 1}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_populate_record with given argument types: (record,unknown) - SELECT jsonb_populate_record(null::record, '{"x": 0, "y": 1}'); - ^ - -SELECT jsonb_populate_record(row(1,2), '{"f1": 0, "f2": 1}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: alternative is not implemented yet : 138 - SELECT jsonb_populate_record(row(1,2), '{"f1": 0, "f2": 1}'); - ^ - -SELECT * FROM - jsonb_populate_record(null::record, '{"x": 776}') AS (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - SELECT * FROM - ^ - --- composite domain -SELECT jsonb_populate_record(null::jb_ordered_pair, '{"x": 0, "y": 1}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:36: Error: Unknown type: jb_ordered_pair - SELECT jsonb_populate_record(null::jb_ordered_pair, '{"x": 0, "y": 1}'); - ^ - -SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 0}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:40: Error: alternative is not implemented yet : 138 - SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 0}'); - ^ - -SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 1, "y": 0}'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:40: Error: alternative is not implemented yet : 138 - SELECT jsonb_populate_record(row(1,2)::jb_ordered_pair, '{"x": 1, "y": 0}'); - ^ - --- populate_recordset -SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:46: Error: Unknown type: jbpop - SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:60: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jbpop - SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:60: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:60: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:60: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jbpop - SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:60: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":"blurfl","x":43.2},{"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - -SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:60: Error: alternative is not implemented yet : 138 - SELECT * FROM jsonb_populate_recordset(row('def',99,NULL)::jbpop,'[{"a":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q; - ^ - --- anonymous record type -SELECT jsonb_populate_recordset(null::record, '[{"x": 0, "y": 1}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_populate_recordset(null::record, '[{"x": 0, "y": 1}]'); - ^ - -SELECT jsonb_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_populate_recordset(row(1,2), '[{"f1": 0, "f2": 1}]'); - ^ - -SELECT i, jsonb_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]') -FROM (VALUES (1),(2)) v(i); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:11: Error: Generator functions are not allowed in: SELECT - SELECT i, jsonb_populate_recordset(row(i,50), '[{"f1":"42"},{"f2":"43"}]') - ^ - -SELECT * FROM - jsonb_populate_recordset(null::record, '[{"x": 776}]') AS (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - SELECT * FROM - ^ - --- empty array is a corner case -SELECT jsonb_populate_recordset(null::record, '[]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_populate_recordset(null::record, '[]'); - ^ - -SELECT jsonb_populate_recordset(row(1,2), '[]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_populate_recordset(row(1,2), '[]'); - ^ - -SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[]') q; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:46: Error: Unknown type: jbpop - SELECT * FROM jsonb_populate_recordset(NULL::jbpop,'[]') q; - ^ - -SELECT * FROM - jsonb_populate_recordset(null::record, '[]') AS (x int, y int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - SELECT * FROM - ^ - --- composite domain -SELECT jsonb_populate_recordset(null::jb_ordered_pair, '[{"x": 0, "y": 1}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_populate_recordset(null::jb_ordered_pair, '[{"x": 0, "y": 1}]'); - ^ - -SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 0}, {"y": 3}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 0}, {"y": 3}]'); - ^ - -SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 1, "y": 0}]'); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: Generator functions are not allowed in: SELECT - SELECT jsonb_populate_recordset(row(1,2)::jb_ordered_pair, '[{"x": 1, "y": 0}]'); - ^ - --- negative cases where the wrong record type is supplied -select * from jsonb_populate_recordset(row(0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - -- negative cases where the wrong record type is supplied - ^ - -select * from jsonb_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_populate_recordset(row(0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - ^ - -select * from jsonb_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_populate_recordset(row(0::int,0::int,0::int),'[{"a":"1","b":"2"},{"a":"3"}]') q (a text, b text); - ^ - -select * from jsonb_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_populate_recordset(row(1000000000::int,50::int),'[{"b":"2"},{"a":"3"}]') q (a text, b text); - ^ - --- jsonb_to_record and jsonb_to_recordset -select * from jsonb_to_record('{"a":1,"b":"foo","c":"bar"}') - as x(a int, b text, d text); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - -- jsonb_to_record and jsonb_to_recordset - ^ - -select * from jsonb_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]') - as x(a int, b text, c boolean); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_recordset('[{"a":1,"b":"foo","d":false},{"a":2,"b":"bar","c":true}]') - ^ - -select *, c is null as c_is_null -from jsonb_to_record('{"a":1, "b":{"c":16, "d":2}, "x":8, "ca": ["1 2", 3], "ia": [[1,2],[3,4]], "r": {"a": "aaa", "b": 123}}'::jsonb) - as t(a int, b jsonb, c text, x int, ca char(5)[], ia int[][], r jbpop); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select *, c is null as c_is_null - ^ - -select *, c is null as c_is_null -from jsonb_to_recordset('[{"a":1, "b":{"c":16, "d":2}, "x":8}]'::jsonb) - as t(a int, b jsonb, c text, x int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select *, c is null as c_is_null - ^ - -select * from jsonb_to_record('{"ia": null}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia": null}') as x(ia _int4); - ^ - -select * from jsonb_to_record('{"ia": 123}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia": 123}') as x(ia _int4); - ^ - -select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia": [1, "2", null, 4]}') as x(ia _int4); - ^ - -select * from jsonb_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia": [[1, 2], [3, 4]]}') as x(ia _int4); - ^ - -select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia": [[1], 2]}') as x(ia _int4); - ^ - -select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia": [[1], [2, 3]]}') as x(ia _int4); - ^ - -select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia2": [1, 2, 3]}') as x(ia2 int[][]); - ^ - -select * from jsonb_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia2": [[1, 2], [3, 4]]}') as x(ia2 int4[][]); - ^ - -select * from jsonb_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"ia2": [[[1], [2], [3]]]}') as x(ia2 int4[][]); - ^ - -select * from jsonb_to_record('{"out": {"key": 1}}') as x(out json); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"out": {"key": 1}}') as x(out json); - ^ - -select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out json); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out json); - ^ - -select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out json); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out json); - ^ - -select * from jsonb_to_record('{"out": {"key": 1}}') as x(out jsonb); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"out": {"key": 1}}') as x(out jsonb); - ^ - -select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out jsonb); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"out": [{"key": 1}]}') as x(out jsonb); - ^ - -select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeFunction: unsupported coldeflist - select * from jsonb_to_record('{"out": "{\"key\": 1}"}') as x(out jsonb); - ^ - --- test type info caching in jsonb_populate_record() -CREATE TEMP TABLE jsbpoptest (js jsonb); - - -INSERT INTO jsbpoptest -SELECT '{ - "jsa": [1, "2", null, 4], - "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}, - "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}] -}'::jsonb -FROM generate_series(1, 3); - - -SELECT (jsonb_populate_record(NULL::jsbrec, js)).* FROM jsbpoptest; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - SELECT (jsonb_populate_record(NULL::jsbrec, js)).* FROM jsbpoptest; - ^ - -DROP TYPE jsbrec; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP TYPE jsbrec; - ^ - -DROP TYPE jsbrec_i_not_null; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP TYPE jsbrec_i_not_null; - ^ - -DROP DOMAIN jsb_int_not_null; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN jsb_int_not_null; - ^ - -DROP DOMAIN jsb_int_array_1d; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN jsb_int_array_1d; - ^ - -DROP DOMAIN jsb_int_array_2d; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN jsb_int_array_2d; - ^ - -DROP DOMAIN jb_ordered_pair; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP DOMAIN jb_ordered_pair; - ^ - -DROP TYPE jb_unordered_pair; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 373 - DROP TYPE jb_unordered_pair; - ^ - --- indexing -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; - - -SELECT count(*) FROM testjsonb WHERE j ? 'public'; - - -SELECT count(*) FROM testjsonb WHERE j ? 'bar'; - - -SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled']; - - -SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled']; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; - - -CREATE INDEX jidx ON testjsonb USING gin (j); - - -SET enable_seqscan = off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_seqscan - SET enable_seqscan = off; - ^ - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}'; - - --- exercise GIN_SEARCH_MODE_ALL -SELECT count(*) FROM testjsonb WHERE j @> '{}'; - - -SELECT count(*) FROM testjsonb WHERE j ? 'public'; - - -SELECT count(*) FROM testjsonb WHERE j ? 'bar'; - - -SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled']; - - -SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled']; - - -EXPLAIN (COSTS OFF) -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - EXPLAIN (COSTS OFF) - ^ - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)'; - - -EXPLAIN (COSTS OFF) -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - EXPLAIN (COSTS OFF) - ^ - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; - - --- array exists - array elements should behave as keys (for GIN index scans too) -CREATE INDEX jidx_array ON testjsonb USING gin((j->'array')); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: index expression is not supported yet - -- array exists - array elements should behave as keys (for GIN index scans too) - ^ - -SELECT count(*) from testjsonb WHERE j->'array' ? 'bar'; - - --- type sensitive array exists - should return no rows (since "exists" only --- matches strings that are either object keys or array elements) -SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text; - - --- However, a raw scalar is *contained* within the array -SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb; - - -RESET enable_seqscan; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_seqscan; - ^ - -SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow; - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow; - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - SELECT count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow; - ^ - -SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key; - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key; - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - SELECT key, count(*) FROM (SELECT (jsonb_each(j)).key FROM testjsonb) AS wow GROUP BY key ORDER BY count DESC, key; - ^ - --- sort/hash -SELECT count(distinct j) FROM testjsonb; - - -SET enable_hashagg = off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_hashagg - SET enable_hashagg = off; - ^ - -SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2; - - -SET enable_hashagg = on; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_hashagg - SET enable_hashagg = on; - ^ - -SET enable_sort = off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_sort - SET enable_sort = off; - ^ - -SELECT count(*) FROM (SELECT j FROM (SELECT * FROM testjsonb UNION ALL SELECT * FROM testjsonb) js GROUP BY j) js2; - - -SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgSelect, At function: PgSetItem, At function: PgValuesList - SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j); - ^ - -stdin-:
:1:44: Error: At function: PgOp - SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j); - ^ - -stdin-:
:1:44: Error: Unable to find an overload for operator || with given argument type(s): (jsonb,text) - SELECT distinct * FROM (values (jsonb '{}' || ''::text),('{}')) v(j); - ^ - -SET enable_sort = on; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_sort - SET enable_sort = on; - ^ - -RESET enable_hashagg; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_hashagg; - ^ - -RESET enable_sort; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_sort; - ^ - -DROP INDEX jidx; - --stdin-:
: Error: Pre type annotation - - -stdin-:
:1:1: Error: Unexpected tag: pgObject - DROP INDEX jidx; - ^ - -DROP INDEX jidx_array; - --stdin-:
: Error: Pre type annotation - - -stdin-:
:1:1: Error: Unexpected tag: pgObject - DROP INDEX jidx_array; - ^ - --- btree -CREATE INDEX jidx ON testjsonb USING btree (j); - - -SET enable_seqscan = off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_seqscan - SET enable_seqscan = off; - ^ - -SELECT count(*) FROM testjsonb WHERE j > '{"p":1}'; - - -SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}'; - - ---gin path opclass -DROP INDEX jidx; - --stdin-:
: Error: Pre type annotation - - -stdin-:
:1:1: Error: Unexpected tag: pgObject - --gin path opclass - ^ - -CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops); - - -SET enable_seqscan = off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_seqscan - SET enable_seqscan = off; - ^ - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; - - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; - - --- exercise GIN_SEARCH_MODE_ALL -SELECT count(*) FROM testjsonb WHERE j @> '{}'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"'; - - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))'; - - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; - - -EXPLAIN (COSTS OFF) -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - EXPLAIN (COSTS OFF) - ^ - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; - - -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; - - -RESET enable_seqscan; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_seqscan; - ^ - -DROP INDEX jidx; - --stdin-:
: Error: Pre type annotation - - -stdin-:
:1:1: Error: Unexpected tag: pgObject - DROP INDEX jidx; - ^ - --- nested tests -SELECT '{"ff":{"a":12,"b":16}}'::jsonb; - - -SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb; - - -SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb; - - -SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2"],"d":{"d1":"d1","d2":"d2"}}}'::jsonb; - - -SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2",["c3"],{"c4":4}],"d":{"d1":"d1","d2":"d2"}}}'::jsonb; - - -SELECT '{"ff":["a","aaa"]}'::jsonb; - - -SELECT - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff', - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq', - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f, - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t, - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x'; - - --- nested containment -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}'; - - -SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}'; - - -SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}'; - - -SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}'; - - -SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}'; - - -SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}'; - - -SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]'; - - -SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]'; - - -SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]'; - - -SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]'; - - -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}'; - - -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}'; - - -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}'; - - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}'; - - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}'; - - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}'; - - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}'; - - --- check some corner cases for indexed nested containment (bug #13756) -create temp table nestjsonb (j jsonb); - - -insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}'); - - -insert into nestjsonb (j) values ('[[14,2,3]]'); - - -insert into nestjsonb (j) values ('[1,[14,2,3]]'); - - -create index on nestjsonb using gin(j jsonb_path_ops); - - -set enable_seqscan = on; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_seqscan - set enable_seqscan = on; - ^ - -set enable_bitmapscan = off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan - set enable_bitmapscan = off; - ^ - -select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb; - - -select * from nestjsonb where j @> '{"c":3}'; - - -select * from nestjsonb where j @> '[[14]]'; - - -set enable_seqscan = off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_seqscan - set enable_seqscan = off; - ^ - -set enable_bitmapscan = on; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan - set enable_bitmapscan = on; - ^ - -select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb; - - -select * from nestjsonb where j @> '{"c":3}'; - - -select * from nestjsonb where j @> '[[14]]'; - - -reset enable_seqscan; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - reset enable_seqscan; - ^ - -reset enable_bitmapscan; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - reset enable_bitmapscan; - ^ - --- nested object field / array index lookup -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 0; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 1; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 2; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 3; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 4; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 5; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> -1; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> -5; - - -SELECT '["a","b","c",[1,2],null]'::jsonb -> -6; - - ---nested path extraction -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - --nested path extraction - ^ - -stdin-:
:2:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}'; - ^ - -stdin-:
:2:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{0}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{a}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,0}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,1}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,2}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,3}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-1}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-3}'; - ^ - -SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}'; - ^ - -stdin-:
:1:39: Error: At function: PgOp - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}'; - ^ - -stdin-:
:1:39: Error: No such operator: #> - SELECT '{"a":"b","c":[1,2,3]}'::jsonb #> '{c,-4}'; - ^ - -SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}'; - ^ - -stdin-:
:1:44: Error: At function: PgOp - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}'; - ^ - -stdin-:
:1:44: Error: No such operator: #> - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{0}'; - ^ - -SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}'; - ^ - -stdin-:
:1:44: Error: At function: PgOp - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}'; - ^ - -stdin-:
:1:44: Error: No such operator: #> - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{3}'; - ^ - -SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}'; - ^ - -stdin-:
:1:44: Error: At function: PgOp - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}'; - ^ - -stdin-:
:1:44: Error: No such operator: #> - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4}'; - ^ - -SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}'; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}'; - ^ - -stdin-:
:1:44: Error: At function: PgOp - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}'; - ^ - -stdin-:
:1:44: Error: No such operator: #> - SELECT '[0,1,2,[3,4],{"5":"five"}]'::jsonb #> '{4,5}'; - ^ - ---nested exists -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd'; - - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e'; - - --- jsonb_strip_nulls -select jsonb_strip_nulls(null); - - -select jsonb_strip_nulls('1'); - - -select jsonb_strip_nulls('"a string"'); - - -select jsonb_strip_nulls('null'); - - -select jsonb_strip_nulls('[1,2,null,3,4]'); - - -select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}'); - - -select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]'); - - --- an empty object is not null and should not be stripped -select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }'); - - -select jsonb_pretty('{"a": "test", "b": [1, 2, 3], "c": "test3", "d":{"dd": "test4", "dd2":{"ddd": "test5"}}}'); - - -select jsonb_pretty('[{"f1":1,"f2":null},2,null,[[{"x":true},6,7],8],3]'); - - -select jsonb_pretty('{"a":["b", "c"], "d": {"e":"f"}}'); - - -select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}'); - - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}'; - - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}'; - - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}'; - - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}'; - - -select '["a", "b"]'::jsonb || '["c"]'; - - -select '["a", "b"]'::jsonb || '["c", "d"]'; - - -select '["c"]' || '["a", "b"]'::jsonb; - - -select '["a", "b"]'::jsonb || '"c"'; - - -select '"c"' || '["a", "b"]'::jsonb; - - -select '[]'::jsonb || '["a"]'::jsonb; - - -select '[]'::jsonb || '"a"'::jsonb; - - -select '"b"'::jsonb || '"a"'::jsonb; - - -select '{}'::jsonb || '{"a":"b"}'::jsonb; - - -select '[]'::jsonb || '{"a":"b"}'::jsonb; - - -select '{"a":"b"}'::jsonb || '[]'::jsonb; - - -select '"a"'::jsonb || '{"a":1}'; - - -select '{"a":1}' || '"a"'::jsonb; - - -select '[3]'::jsonb || '{}'::jsonb; - - -select '3'::jsonb || '[]'::jsonb; - - -select '3'::jsonb || '4'::jsonb; - - -select '3'::jsonb || '{}'::jsonb; - - -select '["a", "b"]'::jsonb || '{"c":1}'; - - -select '{"c": 1}'::jsonb || '["a", "b"]'; - - -select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}'; - - -select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb); - - -select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); - - -select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); - - -select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); - - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a'); - - -select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a'); - - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b'); - - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c'); - - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd'); - - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'a'; - - -select '{"a":null , "b":2, "c":3}'::jsonb - 'a'; - - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'b'; - - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'c'; - - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'd'; - - -select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb); - - -select '["a","b","c"]'::jsonb - 3; - - -select '["a","b","c"]'::jsonb - 2; - - -select '["a","b","c"]'::jsonb - 1; - - -select '["a","b","c"]'::jsonb - 0; - - -select '["a","b","c"]'::jsonb - -1; - - -select '["a","b","c"]'::jsonb - -2; - - -select '["a","b","c"]'::jsonb - -3; - - -select '["a","b","c"]'::jsonb - -4; - - -select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[]; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[]; - ^ - -stdin-:
:1:40: Error: At function: PgOp - select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[]; - ^ - -stdin-:
:1:40: Error: Unable to find an overload for operator - with given argument type(s): (jsonb,_text) - select '{"a":1 , "b":2, "c":3}'::jsonb - '{b}'::text[]; - ^ - -select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[]; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[]; - ^ - -stdin-:
:1:40: Error: At function: PgOp - select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[]; - ^ - -stdin-:
:1:40: Error: Unable to find an overload for operator - with given argument type(s): (jsonb,_text) - select '{"a":1 , "b":2, "c":3}'::jsonb - '{c,b}'::text[]; - ^ - -select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[]; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[]; - ^ - -stdin-:
:1:40: Error: At function: PgOp - select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[]; - ^ - -stdin-:
:1:40: Error: Unable to find an overload for operator - with given argument type(s): (jsonb,_text) - select '{"a":1 , "b":2, "c":3}'::jsonb - '{}'::text[]; - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '[1,2,3]'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '{"1": 2}'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"1": 2}'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '{"1": 2}'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,NULL,0}', '{"1": 2}'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '"test"'); - ^ - -select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (jsonb,unknown,unknown) - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '{"f": "test"}'); - ^ - -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}'); - - -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}'); - - -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}'); - - -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}'; - - -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}'; - - -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript - ^ - -stdin-:
:1:1: Fatal: ERROR: path element at position 2 is not an integer: "-1e" - - select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript - ^ - -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}'; - - --- empty structure and error conditions for delete and replace -select '"a"'::jsonb - 'a'; -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- empty structure and error conditions for delete and replace - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot delete from scalar - - -- empty structure and error conditions for delete and replace - ^ - -select '{}'::jsonb - 'a'; - - -select '[]'::jsonb - 'a'; - - -select '"a"'::jsonb - 1; -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '"a"'::jsonb - 1; -- error - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot delete from scalar - - select '"a"'::jsonb - 1; -- error - ^ - -select '{}'::jsonb - 1; -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '{}'::jsonb - 1; -- error - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot delete from object using integer index - - select '{}'::jsonb - 1; -- error - ^ - -select '[]'::jsonb - 1; - - -select '"a"'::jsonb #- '{a}'; -- error - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '"a"'::jsonb #- '{a}'; -- error - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot delete path in scalar - - select '"a"'::jsonb #- '{a}'; -- error - ^ - -select '{}'::jsonb #- '{a}'; - - -select '[]'::jsonb #- '{a}'; - - -select jsonb_set('"a"','{a}','"b"'); --error - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('"a"','{a}','"b"'); --error - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('"a"','{a}','"b"'); --error - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('"a"','{a}','"b"'); --error - ^ - -select jsonb_set('{}','{a}','"b"', false); - - -select jsonb_set('[]','{1}','"b"', false); - - -select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false); - - --- jsonb_set adding instead of replacing --- prepend to array -select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- jsonb_set adding instead of replacing - ^ - -stdin-:
:3:8: Error: At function: PgCall - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}'); - ^ - -stdin-:
:3:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,-33}','{"foo":123}'); - ^ - --- append to array -select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- append to array - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{b,33}','{"foo":123}'); - ^ - --- check nesting levels addition -select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- check nesting levels addition - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a":1,"b":[4,5,[0,1,2],6,7],"c":{"d":4}}','{b,2,33}','{"foo":123}'); - ^ - --- add new key -select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- add new key - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{c,e}','{"foo":123}'); - ^ - --- adding doesn't do anything if elements before last aren't present -select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- adding doesn't do anything if elements before last aren't present - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,-33}','{"foo":123}'); - ^ - -select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a":1,"b":[0,1,2],"c":{"d":4}}','{x,y}','{"foo":123}'); - ^ - --- add to empty object -select jsonb_set('{}','{x}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- add to empty object - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set('{}','{x}','{"foo":123}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{}','{x}','{"foo":123}'); - ^ - ---add to empty array -select jsonb_set('[]','{0}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - --add to empty array - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set('[]','{0}','{"foo":123}'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('[]','{0}','{"foo":123}'); - ^ - -select jsonb_set('[]','{99}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('[]','{99}','{"foo":123}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('[]','{99}','{"foo":123}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('[]','{99}','{"foo":123}'); - ^ - -select jsonb_set('[]','{-99}','{"foo":123}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('[]','{-99}','{"foo":123}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('[]','{-99}','{"foo":123}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('[]','{-99}','{"foo":123}'); - ^ - -select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a": [1, 2, 3]}', '{a, non_integer}', '"new_value"'); - ^ - -select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, non_integer}', '"new_value"'); - ^ - -select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set with given argument types: (unknown,unknown,unknown) - select jsonb_set('{"a": {"b": [1, 2, 3]}}', '{a, b, NULL}', '"new_value"'); - ^ - --- jsonb_set_lax -\pset null NULL - - --- pass though non nulls to jsonb_set -select jsonb_set_lax('{"a":1,"b":2}','{b}','5') ; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- pass though non nulls to jsonb_set - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set_lax('{"a":1,"b":2}','{b}','5') ; - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown) - select jsonb_set_lax('{"a":1,"b":2}','{b}','5') ; - ^ - -select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ; - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ; - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown,bool) - select jsonb_set_lax('{"a":1,"b":2}','{d}','6', true) ; - ^ - --- using the default treatment -select jsonb_set_lax('{"a":1,"b":2}','{b}',null); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- using the default treatment - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_set_lax('{"a":1,"b":2}','{b}',null); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown) - select jsonb_set_lax('{"a":1,"b":2}','{b}',null); - ^ - -select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_set_lax with given argument types: (unknown,unknown,unknown,bool) - select jsonb_set_lax('{"a":1,"b":2}','{d}',null,true); - ^ - --- errors -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- errors - ^ - -stdin-:
:1:1: Fatal: ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception" - - -- errors - ^ - -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment'); - ^ - -stdin-:
:1:1: Fatal: ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception" - - select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment'); - ^ - --- explicit treatments -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'raise_exception') as raise_exception; - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:8: Error: alternative is not implemented yet : 118 - select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'raise_exception') as raise_exception; - ^ - -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'return_target') as return_target; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: alternative is not implemented yet : 118 - select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'return_target') as return_target; - ^ - -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'delete_key') as delete_key; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: alternative is not implemented yet : 118 - select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'delete_key') as delete_key; - ^ - -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'use_json_null') as use_json_null; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:8: Error: alternative is not implemented yet : 118 - select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, null_value_treatment => 'use_json_null') as use_json_null; - ^ - -\pset null '' - - --- jsonb_insert -select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- jsonb_insert - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"'); - ^ - -select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true); - - -select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"'); - ^ - -select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true); - - -select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '{"b": "value"}'); - ^ - -select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '["value1", "value2"]'); - ^ - --- edge cases -select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- edge cases - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"'); - ^ - -select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true); - - -select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"'); - ^ - -select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true); - - -select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"'); - ^ - -select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true); - - -select jsonb_insert('[]', '{1}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('[]', '{1}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('[]', '{1}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('[]', '{1}', '"new_value"'); - ^ - -select jsonb_insert('[]', '{1}', '"new_value"', true); - - -select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"'); - ^ - -select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true); - - -select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, 10}', '"new_value"'); - ^ - -select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": [0,1,2]}', '{a, -10}', '"new_value"'); - ^ - --- jsonb_insert should be able to insert new value for objects, but not to replace -select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- jsonb_insert should be able to insert new value for objects, but not to replace - ^ - -stdin-:
:2:8: Error: At function: PgCall - select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"'); - ^ - -stdin-:
:2:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"'); - ^ - -select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true); - - -select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"'); - ^ - -stdin-:
:1:8: Error: Unable to find an overload for proc jsonb_insert with given argument types: (unknown,unknown,unknown) - select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"'); - ^ - -select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true); - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot replace existing key -HINT: Try using the function jsonb_set to replace key value. - - select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true); - ^ - --- jsonb subscript -select ('123'::jsonb)['a']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - -- jsonb subscript - ^ - -select ('123'::jsonb)[0]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('123'::jsonb)[0]; - ^ - -select ('123'::jsonb)[NULL]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('123'::jsonb)[NULL]; - ^ - -select ('{"a": 1}'::jsonb)['a']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1}'::jsonb)['a']; - ^ - -select ('{"a": 1}'::jsonb)[0]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1}'::jsonb)[0]; - ^ - -select ('{"a": 1}'::jsonb)['not_exist']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1}'::jsonb)['not_exist']; - ^ - -select ('{"a": 1}'::jsonb)[NULL]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1}'::jsonb)[NULL]; - ^ - -select ('[1, "2", null]'::jsonb)['a']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)['a']; - ^ - -select ('[1, "2", null]'::jsonb)[0]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[0]; - ^ - -select ('[1, "2", null]'::jsonb)['1']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)['1']; - ^ - -select ('[1, "2", null]'::jsonb)[1.0]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[1.0]; - ^ - -select ('[1, "2", null]'::jsonb)[2]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[2]; - ^ - -select ('[1, "2", null]'::jsonb)[3]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[3]; - ^ - -select ('[1, "2", null]'::jsonb)[-2]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[-2]; - ^ - -select ('[1, "2", null]'::jsonb)[1]['a']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[1]['a']; - ^ - -select ('[1, "2", null]'::jsonb)[1][0]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[1][0]; - ^ - -select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['b']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['b']; - ^ - -select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']; - ^ - -select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'][1]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d'][1]; - ^ - -select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']['a']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": 1, "b": "c", "d": [1, 2, 3]}'::jsonb)['d']['a']; - ^ - -select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']; - ^ - -select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']; - ^ - -select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']['a3']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": {"a1": {"a2": "aaa"}}, "b": "bbb", "c": "ccc"}'::jsonb)['a']['a1']['a2']['a3']; - ^ - -select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1']; - ^ - -select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'][2]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('{"a": ["a1", {"b1": ["aaa", "bbb", "ccc"]}], "b": "bb"}'::jsonb)['a'][1]['b1'][2]; - ^ - --- slices are not supported -select ('{"a": 1}'::jsonb)['a':'b']; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - -- slices are not supported - ^ - -select ('[1, "2", null]'::jsonb)[1:2]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[1:2]; - ^ - -select ('[1, "2", null]'::jsonb)[:2]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[:2]; - ^ - -select ('[1, "2", null]'::jsonb)[1:]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[1:]; - ^ - -select ('[1, "2", null]'::jsonb)[:]; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: alternative is not implemented yet : 360 - select ('[1, "2", null]'::jsonb)[:]; - ^ - -create TEMP TABLE test_jsonb_subscript ( - id int, - test_json jsonb -); - - -insert into test_jsonb_subscript values -(1, '{}'), -- empty jsonb -(2, '{"key": "value"}'); -- jsonb with data - - --- update empty jsonb -update test_jsonb_subscript set test_json['a'] = '1' where id = 1; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- update jsonb with some data -update test_jsonb_subscript set test_json['a'] = '1' where id = 2; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- replace jsonb -update test_jsonb_subscript set test_json['a'] = '"test"'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- replace by object -update test_jsonb_subscript set test_json['a'] = '{"b": 1}'::jsonb; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- replace by array -update test_jsonb_subscript set test_json['a'] = '[1, 2, 3]'::jsonb; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- use jsonb subscription in where clause -select * from test_jsonb_subscript where test_json['key'] = '"value"'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:2:59: Error: alternative is not implemented yet : 360 - select * from test_jsonb_subscript where test_json['key'] = '"value"'; - ^ - -select * from test_jsonb_subscript where test_json['key_doesnt_exists'] = '"value"'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:73: Error: alternative is not implemented yet : 360 - select * from test_jsonb_subscript where test_json['key_doesnt_exists'] = '"value"'; - ^ - -select * from test_jsonb_subscript where test_json['key'] = '"wrong_value"'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:59: Error: alternative is not implemented yet : 360 - select * from test_jsonb_subscript where test_json['key'] = '"wrong_value"'; - ^ - --- NULL -update test_jsonb_subscript set test_json[NULL] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json['another_key'] = NULL; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- NULL as jsonb source -insert into test_jsonb_subscript values (3, NULL); - - -update test_jsonb_subscript set test_json['a'] = '1' where id = 3; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - -update test_jsonb_subscript set test_json = NULL where id = 3; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json[0] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- Fill the gaps logic -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '[0]'); - - -update test_jsonb_subscript set test_json[5] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - -update test_jsonb_subscript set test_json[-4] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - -update test_jsonb_subscript set test_json[-8] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- keep consistent values position -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '[]'); - - -update test_jsonb_subscript set test_json[5] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- create the whole path -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{}'); - - -update test_jsonb_subscript set test_json['a'][0]['b'][0]['c'] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{}'); - - -update test_jsonb_subscript set test_json['a'][2]['b'][2]['c'][2] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- create the whole path with already existing keys -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{"b": 1}'); - - -update test_jsonb_subscript set test_json['a'][0] = '2'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- the start jsonb is an object, first subscript is treated as a key -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{}'); - - -update test_jsonb_subscript set test_json[0]['a'] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- the start jsonb is an array -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '[]'); - - -update test_jsonb_subscript set test_json[0]['a'] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json[2]['b'] = '2'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- overwriting an existing path -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{}'); - - -update test_jsonb_subscript set test_json['a']['b'][1] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json['a']['b'][10] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '[]'); - - -update test_jsonb_subscript set test_json[0][0][0] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json[0][0][1] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{}'); - - -update test_jsonb_subscript set test_json['a']['b'][10] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json['a'][10][10] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- an empty sub element -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{"a": {}}'); - - -update test_jsonb_subscript set test_json['a']['b']['c'][2] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{"a": []}'); - - -update test_jsonb_subscript set test_json['a'][1]['c'][2] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -select * from test_jsonb_subscript; - - --- trying replace assuming a composite object, but it's an element or a value -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, '{"a": 1}'); - - -update test_jsonb_subscript set test_json['a']['b'] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json['a']['b']['c'] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json['a'][0] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json['a'][0]['c'] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json['a'][0][0] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - --- trying replace assuming a composite object, but it's a raw scalar -delete from test_jsonb_subscript; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -insert into test_jsonb_subscript values (1, 'null'); - - -update test_jsonb_subscript set test_json[0] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -update test_jsonb_subscript set test_json[0][0] = '1'; - --stdin-:
: Fatal: Pre type annotation - - -stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - --- jsonb to tsvector -select to_tsvector('{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- jsonb to tsvector - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - -- jsonb to tsvector - ^ - --- jsonb to tsvector with config -select to_tsvector('simple', '{"a": "aaa bbb ddd ccc", "b": ["eee fff ggg"], "c": {"d": "hhh iii"}}'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- jsonb to tsvector with config - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "simple" does not exist - - -- jsonb to tsvector with config - ^ - --- jsonb to tsvector with stop words -select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- jsonb to tsvector with stop words - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - -- jsonb to tsvector with stop words - ^ - --- jsonb to tsvector with numeric values -select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- jsonb to tsvector with numeric values - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - -- jsonb to tsvector with numeric values - ^ - --- jsonb_to_tsvector -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- jsonb_to_tsvector - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - -- jsonb_to_tsvector - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"all"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"key"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"string"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"numeric"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '"boolean"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["string", "numeric"]'); - ^ - --- to_tsvector corner cases -select to_tsvector('""'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- to_tsvector corner cases - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - -- to_tsvector corner cases - ^ - -select to_tsvector('{}'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select to_tsvector('{}'::jsonb); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select to_tsvector('{}'::jsonb); - ^ - -select to_tsvector('[]'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select to_tsvector('[]'::jsonb); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select to_tsvector('[]'::jsonb); - ^ - -select to_tsvector('null'::jsonb); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select to_tsvector('null'::jsonb); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select to_tsvector('null'::jsonb); - ^ - --- jsonb_to_tsvector corner cases -select jsonb_to_tsvector('""'::jsonb, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - -- jsonb_to_tsvector corner cases - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - -- jsonb_to_tsvector corner cases - ^ - -select jsonb_to_tsvector('{}'::jsonb, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('{}'::jsonb, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select jsonb_to_tsvector('{}'::jsonb, '"all"'); - ^ - -select jsonb_to_tsvector('[]'::jsonb, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('[]'::jsonb, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select jsonb_to_tsvector('[]'::jsonb, '"all"'); - ^ - -select jsonb_to_tsvector('null'::jsonb, '"all"'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('null'::jsonb, '"all"'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration isn't set - - select jsonb_to_tsvector('null'::jsonb, '"all"'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '""'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '{}'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '[]'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, 'null'); - ^ - -select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]'); - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]'); - ^ - -stdin-:
:1:1: Fatal: ERROR: text search configuration "english" does not exist - - select jsonb_to_tsvector('english', '{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]'); - ^ - --- ts_headline for jsonb -select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- ts_headline for jsonb - ^ - -stdin-:
:2:8: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:2:122: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:2:122: Error: No such proc: tsquery - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - ^ - -select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:1:114: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - ^ - -stdin-:
:1:114: Error: No such proc: tsquery - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh')); - ^ - -select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:122: Error: At function: PgCall - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:122: Error: No such proc: tsquery - select ts_headline('{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:133: Error: At function: PgCall - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - -stdin-:
:1:133: Error: No such proc: tsquery - select ts_headline('english', '{"a": "aaa bbb", "b": {"c": "ccc ddd fff", "c1": "ccc1 ddd1"}, "d": ["ggg hhh", "iii jjj"]}'::jsonb, tsquery('bbb & ddd & hhh'), 'StartSel = <, StopSel = >'); - ^ - --- corner cases for ts_headline with jsonb -select ts_headline('null'::jsonb, tsquery('aaa & bbb')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - -- corner cases for ts_headline with jsonb - ^ - -stdin-:
:2:8: Error: At function: PgCall - select ts_headline('null'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:2:35: Error: At function: PgCall - select ts_headline('null'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:2:35: Error: No such proc: tsquery - select ts_headline('null'::jsonb, tsquery('aaa & bbb')); - ^ - -select ts_headline('{}'::jsonb, tsquery('aaa & bbb')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('{}'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('{}'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:33: Error: At function: PgCall - select ts_headline('{}'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:33: Error: No such proc: tsquery - select ts_headline('{}'::jsonb, tsquery('aaa & bbb')); - ^ - -select ts_headline('[]'::jsonb, tsquery('aaa & bbb')); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select ts_headline('[]'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select ts_headline('[]'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:33: Error: At function: PgCall - select ts_headline('[]'::jsonb, tsquery('aaa & bbb')); - ^ - -stdin-:
:1:33: Error: No such proc: tsquery - select ts_headline('[]'::jsonb, tsquery('aaa & bbb')); - ^ - --- casts -select 'true'::jsonb::bool; - - -select '[]'::jsonb::bool; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '[]'::jsonb::bool; - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot cast jsonb array to type boolean - - select '[]'::jsonb::bool; - ^ - -select '1.0'::jsonb::float; - - -select '[1.0]'::jsonb::float; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '[1.0]'::jsonb::float; - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot cast jsonb array to type double precision - - select '[1.0]'::jsonb::float; - ^ - -select '12345'::jsonb::int4; - - -select '"hello"'::jsonb::int4; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '"hello"'::jsonb::int4; - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot cast jsonb string to type integer - - select '"hello"'::jsonb::int4; - ^ - -select '12345'::jsonb::numeric; - - -select '{}'::jsonb::numeric; - --stdin-:
: Fatal: Execution - - -stdin-:
:1:1: Fatal: Execution of node: Result - select '{}'::jsonb::numeric; - ^ - -stdin-:
:1:1: Fatal: ERROR: cannot cast jsonb object to type numeric - - select '{}'::jsonb::numeric; - ^ - -select '12345.05'::jsonb::numeric; - - -select '12345.05'::jsonb::float4; - - -select '12345.05'::jsonb::float8; - - -select '12345.05'::jsonb::int2; - - -select '12345.05'::jsonb::int4; - - -select '12345.05'::jsonb::int8; - - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric; - - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4; - - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8; - - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2; - - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4; - - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8; - diff --git a/ydb/library/yql/tests/postgresql/cases/jsonb.out b/ydb/library/yql/tests/postgresql/cases/jsonb.out deleted file mode 100644 index e5f574905570..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/jsonb.out +++ /dev/null @@ -1,2987 +0,0 @@ --- Strings. -SELECT '""'::jsonb; -- OK. - jsonb -------- - "" -(1 row) - -SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed -ERROR: invalid input syntax for type json -LINE 1: SELECT $$''$$::jsonb; - ^ -DETAIL: Token "'" is invalid. -CONTEXT: JSON data, line 1: '... -SELECT '"abc"'::jsonb; -- OK - jsonb -------- - "abc" -(1 row) - -SELECT '"abc'::jsonb; -- ERROR, quotes not closed -ERROR: invalid input syntax for type json -LINE 1: SELECT '"abc'::jsonb; - ^ -DETAIL: Token ""abc" is invalid. -CONTEXT: JSON data, line 1: "abc -SELECT '"abc -def"'::jsonb; -- ERROR, unescaped newline in string constant -ERROR: invalid input syntax for type json -LINE 1: SELECT '"abc - ^ -DETAIL: Character with value 0x0a must be escaped. -CONTEXT: JSON data, line 1: "abc -SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes - jsonb ----------- - "\n\"\\" -(1 row) - -SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape -ERROR: invalid input syntax for type json -LINE 1: SELECT '"\v"'::jsonb; - ^ -DETAIL: Escape sequence "\v" is invalid. -CONTEXT: JSON data, line 1: "\v... --- see json_encoding test for input with unicode escapes --- Numbers. -SELECT '1'::jsonb; -- OK - jsonb -------- - 1 -(1 row) - -SELECT '0'::jsonb; -- OK - jsonb -------- - 0 -(1 row) - -SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec -ERROR: invalid input syntax for type json -LINE 1: SELECT '01'::jsonb; - ^ -DETAIL: Token "01" is invalid. -CONTEXT: JSON data, line 1: 01 -SELECT '0.1'::jsonb; -- OK - jsonb -------- - 0.1 -(1 row) - -SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8 - jsonb ---------------------- - 9223372036854775808 -(1 row) - -SELECT '1f2'::jsonb; -- ERROR -ERROR: invalid input syntax for type json -LINE 1: SELECT '1f2'::jsonb; - ^ -DETAIL: Token "1f2" is invalid. -CONTEXT: JSON data, line 1: 1f2 -SELECT '0.x1'::jsonb; -- ERROR -ERROR: invalid input syntax for type json -LINE 1: SELECT '0.x1'::jsonb; - ^ -DETAIL: Token "0.x1" is invalid. -CONTEXT: JSON data, line 1: 0.x1 -SELECT '1.3ex100'::jsonb; -- ERROR -ERROR: invalid input syntax for type json -LINE 1: SELECT '1.3ex100'::jsonb; - ^ -DETAIL: Token "1.3ex100" is invalid. -CONTEXT: JSON data, line 1: 1.3ex100 --- Arrays. -SELECT '[]'::jsonb; -- OK - jsonb -------- - [] -(1 row) - -SELECT '[1,2]'::jsonb; -- OK - jsonb --------- - [1, 2] -(1 row) - -SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma -ERROR: invalid input syntax for type json -LINE 1: SELECT '[1,2,]'::jsonb; - ^ -DETAIL: Expected JSON value, but found "]". -CONTEXT: JSON data, line 1: [1,2,] -SELECT '[1,2'::jsonb; -- ERROR, no closing bracket -ERROR: invalid input syntax for type json -LINE 1: SELECT '[1,2'::jsonb; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,2 -SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket -ERROR: invalid input syntax for type json -LINE 1: SELECT '[1,[2]'::jsonb; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: [1,[2] --- Objects. -SELECT '{}'::jsonb; -- OK - jsonb -------- - {} -(1 row) - -SELECT '{"abc"}'::jsonb; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc"}'::jsonb; - ^ -DETAIL: Expected ":", but found "}". -CONTEXT: JSON data, line 1: {"abc"} -SELECT '{"abc":1}'::jsonb; -- OK - jsonb ------------- - {"abc": 1} -(1 row) - -SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings -ERROR: invalid input syntax for type json -LINE 1: SELECT '{1:"abc"}'::jsonb; - ^ -DETAIL: Expected string or "}", but found "1". -CONTEXT: JSON data, line 1: {1... -SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc",1}'::jsonb; - ^ -DETAIL: Expected ":", but found ",". -CONTEXT: JSON data, line 1: {"abc",... -SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc"=1}'::jsonb; - ^ -DETAIL: Token "=" is invalid. -CONTEXT: JSON data, line 1: {"abc"=... -SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc"::1}'::jsonb; - ^ -DETAIL: Expected JSON value, but found ":". -CONTEXT: JSON data, line 1: {"abc"::... -SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK - jsonb --------------------------------------------------------------------- - {"abc": 1, "def": 2, "ghi": [3, 4], "hij": {"klm": 5, "nop": [6]}} -(1 row) - -SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc":1:2}'::jsonb; - ^ -DETAIL: Expected "," or "}", but found ":". -CONTEXT: JSON data, line 1: {"abc":1:... -SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT '{"abc":1,3}'::jsonb; - ^ -DETAIL: Expected string, but found "3". -CONTEXT: JSON data, line 1: {"abc":1,3... --- Miscellaneous stuff. -SELECT 'true'::jsonb; -- OK - jsonb -------- - true -(1 row) - -SELECT 'false'::jsonb; -- OK - jsonb -------- - false -(1 row) - -SELECT 'null'::jsonb; -- OK - jsonb -------- - null -(1 row) - -SELECT ' true '::jsonb; -- OK, even with extra whitespace - jsonb -------- - true -(1 row) - -SELECT 'true false'::jsonb; -- ERROR, too many values -ERROR: invalid input syntax for type json -LINE 1: SELECT 'true false'::jsonb; - ^ -DETAIL: Expected end of input, but found "false". -CONTEXT: JSON data, line 1: true false -SELECT 'true, false'::jsonb; -- ERROR, too many values -ERROR: invalid input syntax for type json -LINE 1: SELECT 'true, false'::jsonb; - ^ -DETAIL: Expected end of input, but found ",". -CONTEXT: JSON data, line 1: true,... -SELECT 'truf'::jsonb; -- ERROR, not a keyword -ERROR: invalid input syntax for type json -LINE 1: SELECT 'truf'::jsonb; - ^ -DETAIL: Token "truf" is invalid. -CONTEXT: JSON data, line 1: truf -SELECT 'trues'::jsonb; -- ERROR, not a keyword -ERROR: invalid input syntax for type json -LINE 1: SELECT 'trues'::jsonb; - ^ -DETAIL: Token "trues" is invalid. -CONTEXT: JSON data, line 1: trues -SELECT ''::jsonb; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT ''::jsonb; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: -SELECT ' '::jsonb; -- ERROR, no value -ERROR: invalid input syntax for type json -LINE 1: SELECT ' '::jsonb; - ^ -DETAIL: The input string ended unexpectedly. -CONTEXT: JSON data, line 1: --- Multi-line JSON input to check ERROR reporting -SELECT '{ - "one": 1, - "two":"two", - "three": - true}'::jsonb; -- OK - jsonb ------------------------------------------ - {"one": 1, "two": "two", "three": true} -(1 row) - -SELECT '{ - "one": 1, - "two":,"two", -- ERROR extraneous comma before field "two" - "three": - true}'::jsonb; -ERROR: invalid input syntax for type json -LINE 1: SELECT '{ - ^ -DETAIL: Expected JSON value, but found ",". -CONTEXT: JSON data, line 3: "two":,... -SELECT '{ - "one": 1, - "two":"two", - "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb; -ERROR: invalid input syntax for type json -LINE 1: SELECT '{ - ^ -DETAIL: Expected JSON value, but found "}". -CONTEXT: JSON data, line 4: ...yveryveryveryveryveryveryveryverylongfieldname":} --- ERROR missing value for last field --- make sure jsonb is passed through json generators without being escaped -SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']); - array_to_json --------------------------- - [{"a": 1},{"b": [2, 3]}] -(1 row) - -BEGIN; -SET LOCAL TIME ZONE 10.5; -SET LOCAL TIME ZONE -8; -COMMIT; --- jsonb extraction functions -CREATE TEMP TABLE test_jsonb ( - json_type text, - test_json jsonb -); -INSERT INTO test_jsonb VALUES -('scalar','"a scalar"'), -('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'), -('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}'); -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object'; - ?column? ----------- - "val2" -(1 row) - -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar'; - ?column? ----------- - -(1 row) - -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array'; - ?column? ----------- - -(1 row) - -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object'; - ?column? ----------- - val2 -(1 row) - -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array'; - ?column? ----------- - "two" -(1 row) - -SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array'; - ?column? ----------- - -(1 row) - -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object'; - ?column? ----------- - -(1 row) - -SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array'; - ?column? ------------ - [1, 2, 3] -(1 row) - -SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array'; - ?column? ------------ - {"f1": 9} -(1 row) - -SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object'; - ?column? ----------- - 4 -(1 row) - -SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object'; - ?column? ------------ - [1, 2, 3] -(1 row) - -SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object'; - ?column? ------------ - {"f1": 9} -(1 row) - -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar'; - ?column? ----------- - -(1 row) - -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array'; - ?column? ----------- - two -(1 row) - -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object'; - ?column? ----------- - -(1 row) - --- nulls -SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object'; - expect_false --------------- - f -(1 row) - -SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object'; - expect_true -------------- - t -(1 row) - -SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array'; - expect_false --------------- - f -(1 row) - -SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array'; - expect_true -------------- - t -(1 row) - --- corner cases -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> ''; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1; - ?column? -------------- - {"b": "cc"} -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": "c", "b": null}'::jsonb -> 'b'; - ?column? ----------- - null -(1 row) - -select '"foo"'::jsonb -> 1; - ?column? ----------- - -(1 row) - -select '"foo"'::jsonb -> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> ''; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1; - ?column? -------------- - {"b": "cc"} -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3; - ?column? ----------- - -(1 row) - -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z'; - ?column? ----------- - -(1 row) - -select '{"a": "c", "b": null}'::jsonb ->> 'b'; - ?column? ----------- - -(1 row) - -select '"foo"'::jsonb ->> 1; - ?column? ----------- - -(1 row) - -select '"foo"'::jsonb ->> 'z'; - ?column? ----------- - -(1 row) - --- equality and inequality -SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb; - ?column? ----------- - f -(1 row) - -SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb; - ?column? ----------- - f -(1 row) - -SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb; - ?column? ----------- - t -(1 row) - --- containment -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}'); - jsonb_contains ----------------- - t -(1 row) - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}'); - jsonb_contains ----------------- - t -(1 row) - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}'); - jsonb_contains ----------------- - f -(1 row) - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}'); - jsonb_contains ----------------- - f -(1 row) - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}'); - jsonb_contains ----------------- - f -(1 row) - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}'); - jsonb_contains ----------------- - t -(1 row) - -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}'); - jsonb_contains ----------------- - f -(1 row) - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}'; - ?column? ----------- - f -(1 row) - -SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}'); - jsonb_contained ------------------ - t -(1 row) - -SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}'); - jsonb_contained ------------------ - t -(1 row) - -SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}'); - jsonb_contained ------------------ - f -(1 row) - -SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}'); - jsonb_contained ------------------ - f -(1 row) - -SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}'); - jsonb_contained ------------------ - f -(1 row) - -SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}'); - jsonb_contained ------------------ - t -(1 row) - -SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}'); - jsonb_contained ------------------ - f -(1 row) - -SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - ?column? ----------- - f -(1 row) - -SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; - ?column? ----------- - f -(1 row) - --- Raw scalar may contain another raw scalar, array may contain a raw scalar -SELECT '[5]'::jsonb @> '[5]'; - ?column? ----------- - t -(1 row) - -SELECT '5'::jsonb @> '5'; - ?column? ----------- - t -(1 row) - -SELECT '[5]'::jsonb @> '5'; - ?column? ----------- - t -(1 row) - --- But a raw scalar cannot contain an array -SELECT '5'::jsonb @> '[5]'; - ?column? ----------- - f -(1 row) - --- In general, one thing should always contain itself. Test array containment: -SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb; - ?column? ----------- - t -(1 row) - -SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb; - ?column? ----------- - t -(1 row) - --- array containment string matching confusion bug -SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}'; - ?column? ----------- - f -(1 row) - --- array length -SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); - jsonb_array_length --------------------- - 5 -(1 row) - -SELECT jsonb_array_length('[]'); - jsonb_array_length --------------------- - 0 -(1 row) - -SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}'); -ERROR: cannot get array length of a non-array -SELECT jsonb_array_length('4'); -ERROR: cannot get array length of a scalar -SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - key | value ------+----------- - f1 | [1, 2, 3] - f2 | {"f3": 1} - f4 | null - f5 | 99 - f6 | "stringy" -(5 rows) - -SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - key | value ------+------------------------------------ - 1 | "first" - a | {"1": "first", "b": "c", "c": "b"} - b | [1, 2] - c | "cc" - n | null -(5 rows) - -SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; - key | value ------+----------- - f1 | [1, 2, 3] - f2 | {"f3": 1} - f4 | - f5 | 99 - f6 | stringy -(5 rows) - -SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; - key | value ------+------------------------------------ - 1 | first - a | {"1": "first", "b": "c", "c": "b"} - b | [1, 2] - c | cc - n | -(5 rows) - --- exists -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a'); - jsonb_exists --------------- - t -(1 row) - -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b'); - jsonb_exists --------------- - t -(1 row) - -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c'); - jsonb_exists --------------- - f -(1 row) - -SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a'); - jsonb_exists --------------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ? 'a'; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ? 'b'; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ? 'c'; - ?column? ----------- - f -(1 row) - -SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a'; - ?column? ----------- - t -(1 row) - --- array exists - array elements should behave as keys -SELECT count(*) from testjsonb WHERE j->'array' ? 'bar'; - count -------- - 3 -(1 row) - --- type sensitive array exists - should return no rows (since "exists" only --- matches strings that are either object keys or array elements) -SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text; - count -------- - 0 -(1 row) - --- However, a raw scalar is *contained* within the array -SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb; - count -------- - 1 -(1 row) - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']); - jsonb_exists_any ------------------- - t -(1 row) - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']); - jsonb_exists_any ------------------- - t -(1 row) - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']); - jsonb_exists_any ------------------- - t -(1 row) - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']); - jsonb_exists_any ------------------- - f -(1 row) - -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]); - jsonb_exists_any ------------------- - f -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b']; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a']; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a']; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d']; - ?column? ----------- - f -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[]; - ?column? ----------- - f -(1 row) - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']); - jsonb_exists_all ------------------- - t -(1 row) - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']); - jsonb_exists_all ------------------- - t -(1 row) - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']); - jsonb_exists_all ------------------- - f -(1 row) - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']); - jsonb_exists_all ------------------- - f -(1 row) - -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]); - jsonb_exists_all ------------------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b']; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a']; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a']; - ?column? ----------- - f -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d']; - ?column? ----------- - f -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b']; - ?column? ----------- - t -(1 row) - -SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[]; - ?column? ----------- - t -(1 row) - --- typeof -SELECT jsonb_typeof('{}') AS object; - object --------- - object -(1 row) - -SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object; - object --------- - object -(1 row) - -SELECT jsonb_typeof('[]') AS array; - array -------- - array -(1 row) - -SELECT jsonb_typeof('["a", 1]') AS array; - array -------- - array -(1 row) - -SELECT jsonb_typeof('null') AS "null"; - null ------- - null -(1 row) - -SELECT jsonb_typeof('1') AS number; - number --------- - number -(1 row) - -SELECT jsonb_typeof('-1') AS number; - number --------- - number -(1 row) - -SELECT jsonb_typeof('1.0') AS number; - number --------- - number -(1 row) - -SELECT jsonb_typeof('1e2') AS number; - number --------- - number -(1 row) - -SELECT jsonb_typeof('-1.0') AS number; - number --------- - number -(1 row) - -SELECT jsonb_typeof('true') AS boolean; - boolean ---------- - boolean -(1 row) - -SELECT jsonb_typeof('false') AS boolean; - boolean ---------- - boolean -(1 row) - -SELECT jsonb_typeof('"hello"') AS string; - string --------- - string -(1 row) - -SELECT jsonb_typeof('"true"') AS string; - string --------- - string -(1 row) - -SELECT jsonb_typeof('"1.0"') AS string; - string --------- - string -(1 row) - -SELECT jsonb_build_object('{a,b,c}'::text[]); -- error -ERROR: argument list must have even number of elements -HINT: The arguments of jsonb_build_object() must consist of alternating keys and values. -SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array -ERROR: key value must be scalar, not array, composite, or json --- empty objects/arrays -SELECT jsonb_build_array(); - jsonb_build_array -------------------- - [] -(1 row) - -SELECT jsonb_build_object(); - jsonb_build_object --------------------- - {} -(1 row) - --- make sure keys are quoted -SELECT jsonb_build_object(1,2); - jsonb_build_object --------------------- - {"1": 2} -(1 row) - -SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; -ERROR: key value must be scalar, not array, composite, or json -SELECT jsonb_build_object(json '{"a":1,"b":2}', 3); -ERROR: key value must be scalar, not array, composite, or json -SELECT jsonb_build_object('{1,2,3}'::int[], 3); -ERROR: key value must be scalar, not array, composite, or json --- handling of NULL values -SELECT jsonb_object_agg(1, NULL::jsonb); - jsonb_object_agg ------------------- - {"1": null} -(1 row) - -SELECT jsonb_object_agg(NULL, '{"a":1}'); -ERROR: field name must not be null -CREATE TEMP TABLE foo (serial_num int, name text, type text); -INSERT INTO foo VALUES (847001,'t15','GE1043'); -INSERT INTO foo VALUES (847002,'t16','GE1043'); -INSERT INTO foo VALUES (847003,'sub-alpha','GESS90'); -SELECT jsonb_object_agg(name, type) FROM foo; - jsonb_object_agg ------------------------------------------------------------ - {"t15": "GE1043", "t16": "GE1043", "sub-alpha": "GESS90"} -(1 row) - -INSERT INTO foo VALUES (999999, NULL, 'bar'); -SELECT jsonb_object_agg(name, type) FROM foo; -ERROR: field name must not be null --- jsonb_object --- empty object, one dimension -SELECT jsonb_object('{}'); - jsonb_object --------------- - {} -(1 row) - --- empty object, two dimensions -SELECT jsonb_object('{}', '{}'); - jsonb_object --------------- - {} -(1 row) - --- one dimension -SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}'); - jsonb_object ---------------------------------------------------- - {"3": null, "a": "1", "b": "2", "d e f": "a b c"} -(1 row) - --- same but with two dimensions -SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); - jsonb_object ---------------------------------------------------- - {"3": null, "a": "1", "b": "2", "d e f": "a b c"} -(1 row) - --- odd number error -SELECT jsonb_object('{a,b,c}'); -ERROR: array must have even number of elements --- one column error -SELECT jsonb_object('{{a},{b}}'); -ERROR: array must have two columns --- too many columns error -SELECT jsonb_object('{{a,b,c},{b,c,d}}'); -ERROR: array must have two columns --- too many dimensions error -SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}'); -ERROR: wrong number of array subscripts ---two argument form of jsonb_object -select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}'); - jsonb_object --------------------------------------------------- - {"a": "1", "b": "2", "c": "3", "d e f": "a b c"} -(1 row) - --- too many dimensions -SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); -ERROR: wrong number of array subscripts --- mismatched dimensions -select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}'); -ERROR: mismatched array dimensions -select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); -ERROR: mismatched array dimensions --- null key error -select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}'); -ERROR: null value not allowed for object key --- empty key is allowed -select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}'); - jsonb_object -------------------------------------------------- - {"": "3", "a": "1", "b": "2", "d e f": "a b c"} -(1 row) - --- extract_path, extract_path_as_text -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - jsonb_extract_path --------------------- - "stringy" -(1 row) - -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - jsonb_extract_path --------------------- - {"f3": 1} -(1 row) - -SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - jsonb_extract_path --------------------- - "f3" -(1 row) - -SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - jsonb_extract_path --------------------- - 1 -(1 row) - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); - jsonb_extract_path_text -------------------------- - stringy -(1 row) - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); - jsonb_extract_path_text -------------------------- - {"f3": 1} -(1 row) - -SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); - jsonb_extract_path_text -------------------------- - f3 -(1 row) - -SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); - jsonb_extract_path_text -------------------------- - 1 -(1 row) - --- extract_path nulls -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false; - expect_false --------------- - f -(1 row) - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true; - expect_true -------------- - t -(1 row) - -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false; - expect_false --------------- - f -(1 row) - -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true; - expect_true -------------- - t -(1 row) - -SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q; - value ----------------------------- - 1 - true - [1, [2, 3]] - null - {"f1": 1, "f2": [7, 8, 9]} - false -(6 rows) - -SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; - value ----------------------------- - 1 - true - [1, [2, 3]] - - {"f1": 1, "f2": [7, 8, 9]} - false - stringy -(7 rows) - --- test type info caching in jsonb_populate_record() -CREATE TEMP TABLE jsbpoptest (js jsonb); -INSERT INTO jsbpoptest -SELECT '{ - "jsa": [1, "2", null, 4], - "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}, - "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}] -}'::jsonb -FROM generate_series(1, 3); --- indexing -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ? 'public'; - count -------- - 194 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ? 'bar'; - count -------- - 0 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled']; - count -------- - 337 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled']; - count -------- - 42 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)'; - count -------- - 194 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)'; - count -------- - 0 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)'; - count -------- - 337 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)'; - count -------- - 42 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; - count -------- - 194 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; - count -------- - 0 -(1 row) - -CREATE INDEX jidx ON testjsonb USING gin (j); -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}'; - count -------- - 3 -(1 row) - --- exercise GIN_SEARCH_MODE_ALL -SELECT count(*) FROM testjsonb WHERE j @> '{}'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ? 'public'; - count -------- - 194 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ? 'bar'; - count -------- - 0 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled']; - count -------- - 337 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled']; - count -------- - 42 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)'; - count -------- - 194 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)'; - count -------- - 0 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)'; - count -------- - 337 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)'; - count -------- - 42 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; - count -------- - 194 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; - count -------- - 0 -(1 row) - -SELECT count(*) from testjsonb WHERE j->'array' ? 'bar'; - count -------- - 3 -(1 row) - --- type sensitive array exists - should return no rows (since "exists" only --- matches strings that are either object keys or array elements) -SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text; - count -------- - 0 -(1 row) - --- However, a raw scalar is *contained* within the array -SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb; - count -------- - 1 -(1 row) - --- btree -CREATE INDEX jidx ON testjsonb USING btree (j); -SELECT count(*) FROM testjsonb WHERE j > '{"p":1}'; - count -------- - 884 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}'; - count -------- - 1 -(1 row) - -CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops); -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; - count -------- - 2 -(1 row) - --- exercise GIN_SEARCH_MODE_ALL -SELECT count(*) FROM testjsonb WHERE j @> '{}'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; - count -------- - 1 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; - count -------- - 15 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; - count -------- - 2 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")'; - count -------- - 3 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$'; - count -------- - 1012 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; - count -------- - 194 -(1 row) - -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; - count -------- - 0 -(1 row) - --- nested tests -SELECT '{"ff":{"a":12,"b":16}}'::jsonb; - jsonb ----------------------------- - {"ff": {"a": 12, "b": 16}} -(1 row) - -SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb; - jsonb ---------------------------------------- - {"ff": {"a": 12, "b": 16}, "qq": 123} -(1 row) - -SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb; - jsonb --------------------------------------------------------------------------------------------------- - {"aa": ["a", "aaa"], "qq": {"a": 12, "b": 16, "c": ["c1", "c2"], "d": {"d1": "d3", "d2": "d2"}}} -(1 row) - -SELECT '{"ff":["a","aaa"]}'::jsonb; - jsonb ----------------------- - {"ff": ["a", "aaa"]} -(1 row) - -SELECT - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff', - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq', - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f, - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t, - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x'; - ?column? | ?column? | f | t | ?column? ---------------------+----------+---+---+---------- - {"a": 12, "b": 16} | 123 | f | t | [1, 2] -(1 row) - --- nested containment -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}'; - ?column? ----------- - f -(1 row) - -SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]'; - ?column? ----------- - f -(1 row) - -SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]'; - ?column? ----------- - t -(1 row) - -SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]'; - ?column? ----------- - t -(1 row) - -SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}'; - ?column? ----------- - t -(1 row) - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}'; - ?column? ----------- - f -(1 row) - -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}'; - ?column? ----------- - t -(1 row) - --- check some corner cases for indexed nested containment (bug #13756) -create temp table nestjsonb (j jsonb); -insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}'); -insert into nestjsonb (j) values ('[[14,2,3]]'); -insert into nestjsonb (j) values ('[1,[14,2,3]]'); -create index on nestjsonb using gin(j jsonb_path_ops); -select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb; - j ---------------------------------------------------- - {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3} -(1 row) - -select * from nestjsonb where j @> '{"c":3}'; - j ---------------------------------------------------- - {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3} -(1 row) - -select * from nestjsonb where j @> '[[14]]'; - j ------------------ - [[14, 2, 3]] - [1, [14, 2, 3]] -(2 rows) - -select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb; - j ---------------------------------------------------- - {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3} -(1 row) - -select * from nestjsonb where j @> '{"c":3}'; - j ---------------------------------------------------- - {"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3} -(1 row) - -select * from nestjsonb where j @> '[[14]]'; - j ------------------ - [[14, 2, 3]] - [1, [14, 2, 3]] -(2 rows) - --- nested object field / array index lookup -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n'; - ?column? ----------- - null -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a'; - ?column? ----------- - 1 -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b'; - ?column? ----------- - [1, 2] -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c'; - ?column? ----------- - {"1": 2} -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd'; - ?column? ---------------- - {"1": [2, 3]} -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1'; - ?column? ----------- - [2, 3] -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e'; - ?column? ----------- - -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error - ?column? ----------- - -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 0; - ?column? ----------- - "a" -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 1; - ?column? ----------- - "b" -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 2; - ?column? ----------- - "c" -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 3; - ?column? ----------- - [1, 2] -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1; - ?column? ----------- - 2 -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 4; - ?column? ----------- - null -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> 5; - ?column? ----------- - -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> -1; - ?column? ----------- - null -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> -5; - ?column? ----------- - "a" -(1 row) - -SELECT '["a","b","c",[1,2],null]'::jsonb -> -6; - ?column? ----------- - -(1 row) - ---nested exists -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n'; - ?column? ----------- - t -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a'; - ?column? ----------- - t -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b'; - ?column? ----------- - t -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c'; - ?column? ----------- - t -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd'; - ?column? ----------- - t -(1 row) - -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e'; - ?column? ----------- - f -(1 row) - --- jsonb_strip_nulls -select jsonb_strip_nulls(null); - jsonb_strip_nulls -------------------- - -(1 row) - -select jsonb_strip_nulls('1'); - jsonb_strip_nulls -------------------- - 1 -(1 row) - -select jsonb_strip_nulls('"a string"'); - jsonb_strip_nulls -------------------- - "a string" -(1 row) - -select jsonb_strip_nulls('null'); - jsonb_strip_nulls -------------------- - null -(1 row) - -select jsonb_strip_nulls('[1,2,null,3,4]'); - jsonb_strip_nulls --------------------- - [1, 2, null, 3, 4] -(1 row) - -select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}'); - jsonb_strip_nulls --------------------------------------------- - {"a": 1, "c": [2, null, 3], "d": {"e": 4}} -(1 row) - -select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]'); - jsonb_strip_nulls --------------------------- - [1, {"a": 1, "c": 2}, 3] -(1 row) - --- an empty object is not null and should not be stripped -select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }'); - jsonb_strip_nulls --------------------- - {"a": {}, "d": {}} -(1 row) - -select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}'); - jsonb_concat -------------------------------------------------------------------- - {"a": [1, 2], "c": {"c1": 1, "c2": 2}, "d": "test", "g": "test2"} -(1 row) - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}'; - ?column? ---------------------------------------------- - {"b": "g", "aa": 1, "cq": "l", "fg": false} -(1 row) - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}'; - ?column? ---------------------------------------- - {"b": 2, "aa": 1, "aq": "l", "cq": 3} -(1 row) - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}'; - ?column? ------------------------------- - {"b": 2, "aa": "l", "cq": 3} -(1 row) - -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}'; - ?column? ----------------------------- - {"b": 2, "aa": 1, "cq": 3} -(1 row) - -select '["a", "b"]'::jsonb || '["c"]'; - ?column? ------------------ - ["a", "b", "c"] -(1 row) - -select '["a", "b"]'::jsonb || '["c", "d"]'; - ?column? ----------------------- - ["a", "b", "c", "d"] -(1 row) - -select '["c"]' || '["a", "b"]'::jsonb; - ?column? ------------------ - ["c", "a", "b"] -(1 row) - -select '["a", "b"]'::jsonb || '"c"'; - ?column? ------------------ - ["a", "b", "c"] -(1 row) - -select '"c"' || '["a", "b"]'::jsonb; - ?column? ------------------ - ["c", "a", "b"] -(1 row) - -select '[]'::jsonb || '["a"]'::jsonb; - ?column? ----------- - ["a"] -(1 row) - -select '[]'::jsonb || '"a"'::jsonb; - ?column? ----------- - ["a"] -(1 row) - -select '"b"'::jsonb || '"a"'::jsonb; - ?column? ------------- - ["b", "a"] -(1 row) - -select '{}'::jsonb || '{"a":"b"}'::jsonb; - ?column? ------------- - {"a": "b"} -(1 row) - -select '[]'::jsonb || '{"a":"b"}'::jsonb; - ?column? --------------- - [{"a": "b"}] -(1 row) - -select '{"a":"b"}'::jsonb || '[]'::jsonb; - ?column? --------------- - [{"a": "b"}] -(1 row) - -select '"a"'::jsonb || '{"a":1}'; - ?column? ------------------ - ["a", {"a": 1}] -(1 row) - -select '{"a":1}' || '"a"'::jsonb; - ?column? ------------------ - [{"a": 1}, "a"] -(1 row) - -select '[3]'::jsonb || '{}'::jsonb; - ?column? ----------- - [3, {}] -(1 row) - -select '3'::jsonb || '[]'::jsonb; - ?column? ----------- - [3] -(1 row) - -select '3'::jsonb || '4'::jsonb; - ?column? ----------- - [3, 4] -(1 row) - -select '3'::jsonb || '{}'::jsonb; - ?column? ----------- - [3, {}] -(1 row) - -select '["a", "b"]'::jsonb || '{"c":1}'; - ?column? ----------------------- - ["a", "b", {"c": 1}] -(1 row) - -select '{"c": 1}'::jsonb || '["a", "b"]'; - ?column? ----------------------- - [{"c": 1}, "a", "b"] -(1 row) - -select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}'; - ?column? ------------------------------------- - {"b": "g", "cq": "l", "fg": false} -(1 row) - -select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb); - ?column? ----------- - t -(1 row) - -select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); - ?column? ----------- - t -(1 row) - -select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); - ?column? ----------- - t -(1 row) - -select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); - ?column? ----------- - t -(1 row) - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a'); - jsonb_delete ------------------- - {"b": 2, "c": 3} -(1 row) - -select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a'); - jsonb_delete ------------------- - {"b": 2, "c": 3} -(1 row) - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b'); - jsonb_delete ------------------- - {"a": 1, "c": 3} -(1 row) - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c'); - jsonb_delete ------------------- - {"a": 1, "b": 2} -(1 row) - -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd'); - jsonb_delete --------------------------- - {"a": 1, "b": 2, "c": 3} -(1 row) - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'a'; - ?column? ------------------- - {"b": 2, "c": 3} -(1 row) - -select '{"a":null , "b":2, "c":3}'::jsonb - 'a'; - ?column? ------------------- - {"b": 2, "c": 3} -(1 row) - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'b'; - ?column? ------------------- - {"a": 1, "c": 3} -(1 row) - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'c'; - ?column? ------------------- - {"a": 1, "b": 2} -(1 row) - -select '{"a":1 , "b":2, "c":3}'::jsonb - 'd'; - ?column? --------------------------- - {"a": 1, "b": 2, "c": 3} -(1 row) - -select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb); - ?column? ----------- - t -(1 row) - -select '["a","b","c"]'::jsonb - 3; - ?column? ------------------ - ["a", "b", "c"] -(1 row) - -select '["a","b","c"]'::jsonb - 2; - ?column? ------------- - ["a", "b"] -(1 row) - -select '["a","b","c"]'::jsonb - 1; - ?column? ------------- - ["a", "c"] -(1 row) - -select '["a","b","c"]'::jsonb - 0; - ?column? ------------- - ["b", "c"] -(1 row) - -select '["a","b","c"]'::jsonb - -1; - ?column? ------------- - ["a", "b"] -(1 row) - -select '["a","b","c"]'::jsonb - -2; - ?column? ------------- - ["a", "c"] -(1 row) - -select '["a","b","c"]'::jsonb - -3; - ?column? ------------- - ["b", "c"] -(1 row) - -select '["a","b","c"]'::jsonb - -4; - ?column? ------------------ - ["a", "b", "c"] -(1 row) - -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}'); - jsonb_delete_path ----------------------------------------------------------- - {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}} -(1 row) - -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}'); - jsonb_delete_path ------------------------------------------------------------------- - {"a": 1, "b": [1], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null} -(1 row) - -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}'); - jsonb_delete_path ------------------------------------------------------------------- - {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [3]}, "n": null} -(1 row) - -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}'; - ?column? ----------------------------------------------------------- - {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [2, 3]}} -(1 row) - -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}'; - ?column? ------------------------------------------------------------------- - {"a": 1, "b": [1], "c": {"1": 2}, "d": {"1": [2, 3]}, "n": null} -(1 row) - -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript -ERROR: path element at position 2 is not an integer: "-1e" -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}'; - ?column? ------------------------------------------------------------------- - {"a": 1, "b": [1, 2], "c": {"1": 2}, "d": {"1": [3]}, "n": null} -(1 row) - --- empty structure and error conditions for delete and replace -select '"a"'::jsonb - 'a'; -- error -ERROR: cannot delete from scalar -select '{}'::jsonb - 'a'; - ?column? ----------- - {} -(1 row) - -select '[]'::jsonb - 'a'; - ?column? ----------- - [] -(1 row) - -select '"a"'::jsonb - 1; -- error -ERROR: cannot delete from scalar -select '{}'::jsonb - 1; -- error -ERROR: cannot delete from object using integer index -select '[]'::jsonb - 1; - ?column? ----------- - [] -(1 row) - -select '"a"'::jsonb #- '{a}'; -- error -ERROR: cannot delete path in scalar -select '{}'::jsonb #- '{a}'; - ?column? ----------- - {} -(1 row) - -select '[]'::jsonb #- '{a}'; - ?column? ----------- - [] -(1 row) - -select jsonb_set('{}','{a}','"b"', false); - jsonb_set ------------ - {} -(1 row) - -select jsonb_set('[]','{1}','"b"', false); - jsonb_set ------------ - [] -(1 row) - -select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false); - jsonb_set -------------------------- - [[2, 3, 4], 2, null, 3] -(1 row) - --- jsonb_set_lax -\pset null NULL --- errors -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null); -ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception" -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment'); -ERROR: null_value_treatment must be "delete_key", "return_target", "use_json_null", or "raise_exception" -\pset null '' -select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true); - jsonb_insert -------------------------------- - {"a": [0, 1, "new_value", 2]} -(1 row) - -select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true); - jsonb_insert ------------------------------------------------------------- - {"a": {"b": {"c": [0, 1, "test1", "new_value", "test2"]}}} -(1 row) - -select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true); - jsonb_insert -------------------------------- - {"a": [0, "new_value", 1, 2]} -(1 row) - -select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true); - jsonb_insert -------------------------------- - {"a": [0, 1, 2, "new_value"]} -(1 row) - -select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true); - jsonb_insert -------------------------------- - {"a": [0, 1, 2, "new_value"]} -(1 row) - -select jsonb_insert('[]', '{1}', '"new_value"', true); - jsonb_insert ---------------- - ["new_value"] -(1 row) - -select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true); - jsonb_insert ----------------------- - {"a": ["new_value"]} -(1 row) - -select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true); - jsonb_insert ------------------------------------------ - {"a": {"b": "value", "c": "new_value"}} -(1 row) - -select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true); -ERROR: cannot replace existing key -HINT: Try using the function jsonb_set to replace key value. -create TEMP TABLE test_jsonb_subscript ( - id int, - test_json jsonb -); -insert into test_jsonb_subscript values -(1, '{}'), -- empty jsonb -(2, '{"key": "value"}'); -- jsonb with data --- NULL as jsonb source -insert into test_jsonb_subscript values (3, NULL); -insert into test_jsonb_subscript values (1, '[0]'); -insert into test_jsonb_subscript values (1, '[]'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '{"b": 1}'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '[]'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '[]'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '{"a": {}}'); -insert into test_jsonb_subscript values (1, '{"a": []}'); -insert into test_jsonb_subscript values (1, '{"a": 1}'); -insert into test_jsonb_subscript values (1, 'null'); --- casts -select 'true'::jsonb::bool; - bool ------- - t -(1 row) - -select '[]'::jsonb::bool; -ERROR: cannot cast jsonb array to type boolean -select '1.0'::jsonb::float; - float8 --------- - 1 -(1 row) - -select '[1.0]'::jsonb::float; -ERROR: cannot cast jsonb array to type double precision -select '12345'::jsonb::int4; - int4 -------- - 12345 -(1 row) - -select '"hello"'::jsonb::int4; -ERROR: cannot cast jsonb string to type integer -select '12345'::jsonb::numeric; - numeric ---------- - 12345 -(1 row) - -select '{}'::jsonb::numeric; -ERROR: cannot cast jsonb object to type numeric -select '12345.05'::jsonb::numeric; - numeric ----------- - 12345.05 -(1 row) - -select '12345.05'::jsonb::float4; - float4 ----------- - 12345.05 -(1 row) - -select '12345.05'::jsonb::float8; - float8 ----------- - 12345.05 -(1 row) - -select '12345.05'::jsonb::int2; - int2 -------- - 12345 -(1 row) - -select '12345.05'::jsonb::int4; - int4 -------- - 12345 -(1 row) - -select '12345.05'::jsonb::int8; - int8 -------- - 12345 -(1 row) - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric; - numeric ------------------------------------------------------- - 12345.0000000000000000000000000000000000000000000005 -(1 row) - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4; - float4 --------- - 12345 -(1 row) - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8; - float8 --------- - 12345 -(1 row) - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2; - int2 -------- - 12345 -(1 row) - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4; - int4 -------- - 12345 -(1 row) - -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8; - int8 -------- - 12345 -(1 row) - diff --git a/ydb/library/yql/tests/postgresql/cases/jsonb.sql b/ydb/library/yql/tests/postgresql/cases/jsonb.sql deleted file mode 100644 index 8ffbfc37d015..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/jsonb.sql +++ /dev/null @@ -1,627 +0,0 @@ --- Strings. -SELECT '""'::jsonb; -- OK. -SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed -SELECT '"abc"'::jsonb; -- OK -SELECT '"abc'::jsonb; -- ERROR, quotes not closed -SELECT '"abc -def"'::jsonb; -- ERROR, unescaped newline in string constant -SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes -SELECT '"\v"'::jsonb; -- ERROR, not a valid JSON escape --- see json_encoding test for input with unicode escapes --- Numbers. -SELECT '1'::jsonb; -- OK -SELECT '0'::jsonb; -- OK -SELECT '01'::jsonb; -- ERROR, not valid according to JSON spec -SELECT '0.1'::jsonb; -- OK -SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8 -SELECT '1f2'::jsonb; -- ERROR -SELECT '0.x1'::jsonb; -- ERROR -SELECT '1.3ex100'::jsonb; -- ERROR --- Arrays. -SELECT '[]'::jsonb; -- OK -SELECT '[1,2]'::jsonb; -- OK -SELECT '[1,2,]'::jsonb; -- ERROR, trailing comma -SELECT '[1,2'::jsonb; -- ERROR, no closing bracket -SELECT '[1,[2]'::jsonb; -- ERROR, no closing bracket --- Objects. -SELECT '{}'::jsonb; -- OK -SELECT '{"abc"}'::jsonb; -- ERROR, no value -SELECT '{"abc":1}'::jsonb; -- OK -SELECT '{1:"abc"}'::jsonb; -- ERROR, keys must be strings -SELECT '{"abc",1}'::jsonb; -- ERROR, wrong separator -SELECT '{"abc"=1}'::jsonb; -- ERROR, totally wrong separator -SELECT '{"abc"::1}'::jsonb; -- ERROR, another wrong separator -SELECT '{"abc":1,"def":2,"ghi":[3,4],"hij":{"klm":5,"nop":[6]}}'::jsonb; -- OK -SELECT '{"abc":1:2}'::jsonb; -- ERROR, colon in wrong spot -SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value --- Miscellaneous stuff. -SELECT 'true'::jsonb; -- OK -SELECT 'false'::jsonb; -- OK -SELECT 'null'::jsonb; -- OK -SELECT ' true '::jsonb; -- OK, even with extra whitespace -SELECT 'true false'::jsonb; -- ERROR, too many values -SELECT 'true, false'::jsonb; -- ERROR, too many values -SELECT 'truf'::jsonb; -- ERROR, not a keyword -SELECT 'trues'::jsonb; -- ERROR, not a keyword -SELECT ''::jsonb; -- ERROR, no value -SELECT ' '::jsonb; -- ERROR, no value --- Multi-line JSON input to check ERROR reporting -SELECT '{ - "one": 1, - "two":"two", - "three": - true}'::jsonb; -- OK -SELECT '{ - "one": 1, - "two":,"two", -- ERROR extraneous comma before field "two" - "three": - true}'::jsonb; -SELECT '{ - "one": 1, - "two":"two", - "averyveryveryveryveryveryveryveryveryverylongfieldname":}'::jsonb; --- ERROR missing value for last field --- make sure jsonb is passed through json generators without being escaped -SELECT array_to_json(ARRAY [jsonb '{"a":1}', jsonb '{"b":[2,3]}']); -BEGIN; -SET LOCAL TIME ZONE 10.5; -SET LOCAL TIME ZONE -8; -COMMIT; --- jsonb extraction functions -CREATE TEMP TABLE test_jsonb ( - json_type text, - test_json jsonb -); -INSERT INTO test_jsonb VALUES -('scalar','"a scalar"'), -('array','["zero", "one","two",null,"four","five", [1,2,3],{"f1":9}]'), -('object','{"field1":"val1","field2":"val2","field3":null, "field4": 4, "field5": [1,2,3], "field6": {"f1":9}}'); -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'scalar'; -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'array'; -SELECT test_json -> 'x' FROM test_jsonb WHERE json_type = 'object'; -SELECT test_json -> 'field2' FROM test_jsonb WHERE json_type = 'object'; -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'scalar'; -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'array'; -SELECT test_json ->> 'field2' FROM test_jsonb WHERE json_type = 'object'; -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'scalar'; -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'array'; -SELECT test_json -> 9 FROM test_jsonb WHERE json_type = 'array'; -SELECT test_json -> 2 FROM test_jsonb WHERE json_type = 'object'; -SELECT test_json ->> 6 FROM test_jsonb WHERE json_type = 'array'; -SELECT test_json ->> 7 FROM test_jsonb WHERE json_type = 'array'; -SELECT test_json ->> 'field4' FROM test_jsonb WHERE json_type = 'object'; -SELECT test_json ->> 'field5' FROM test_jsonb WHERE json_type = 'object'; -SELECT test_json ->> 'field6' FROM test_jsonb WHERE json_type = 'object'; -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'scalar'; -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'array'; -SELECT test_json ->> 2 FROM test_jsonb WHERE json_type = 'object'; --- nulls -SELECT (test_json->'field3') IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'object'; -SELECT (test_json->>'field3') IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'object'; -SELECT (test_json->3) IS NULL AS expect_false FROM test_jsonb WHERE json_type = 'array'; -SELECT (test_json->>3) IS NULL AS expect_true FROM test_jsonb WHERE json_type = 'array'; --- corner cases -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::text; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> null::int; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 1; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> 'z'; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb -> ''; -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 1; -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 3; -select '[{"b": "c"}, {"b": "cc"}]'::jsonb -> 'z'; -select '{"a": "c", "b": null}'::jsonb -> 'b'; -select '"foo"'::jsonb -> 1; -select '"foo"'::jsonb -> 'z'; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::text; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> null::int; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 1; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> 'z'; -select '{"a": [{"b": "c"}, {"b": "cc"}]}'::jsonb ->> ''; -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 1; -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 3; -select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z'; -select '{"a": "c", "b": null}'::jsonb ->> 'b'; -select '"foo"'::jsonb ->> 1; -select '"foo"'::jsonb ->> 'z'; --- equality and inequality -SELECT '{"x":"y"}'::jsonb = '{"x":"y"}'::jsonb; -SELECT '{"x":"y"}'::jsonb = '{"x":"z"}'::jsonb; -SELECT '{"x":"y"}'::jsonb <> '{"x":"y"}'::jsonb; -SELECT '{"x":"y"}'::jsonb <> '{"x":"z"}'::jsonb; --- containment -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}'); -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":null}'); -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "g":null}'); -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"g":null}'); -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"c"}'); -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b"}'); -SELECT jsonb_contains('{"a":"b", "b":1, "c":null}', '{"a":"b", "c":"q"}'); -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}'; -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":null}'; -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "g":null}'; -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"g":null}'; -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"c"}'; -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b"}'; -SELECT '{"a":"b", "b":1, "c":null}'::jsonb @> '{"a":"b", "c":"q"}'; -SELECT '[1,2]'::jsonb @> '[1,2,2]'::jsonb; -SELECT '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb; -SELECT '[[1,2]]'::jsonb @> '[[1,2,2]]'::jsonb; -SELECT '[1,2,2]'::jsonb <@ '[1,2]'::jsonb; -SELECT '[1,2,2]'::jsonb <@ '[1,1,2]'::jsonb; -SELECT '[[1,2,2]]'::jsonb <@ '[[1,2]]'::jsonb; -SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}'); -SELECT jsonb_contained('{"a":"b", "c":null}', '{"a":"b", "b":1, "c":null}'); -SELECT jsonb_contained('{"a":"b", "g":null}', '{"a":"b", "b":1, "c":null}'); -SELECT jsonb_contained('{"g":null}', '{"a":"b", "b":1, "c":null}'); -SELECT jsonb_contained('{"a":"c"}', '{"a":"b", "b":1, "c":null}'); -SELECT jsonb_contained('{"a":"b"}', '{"a":"b", "b":1, "c":null}'); -SELECT jsonb_contained('{"a":"b", "c":"q"}', '{"a":"b", "b":1, "c":null}'); -SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; -SELECT '{"a":"b", "c":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; -SELECT '{"a":"b", "g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; -SELECT '{"g":null}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; -SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; -SELECT '{"a":"b"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; -SELECT '{"a":"b", "c":"q"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'; --- Raw scalar may contain another raw scalar, array may contain a raw scalar -SELECT '[5]'::jsonb @> '[5]'; -SELECT '5'::jsonb @> '5'; -SELECT '[5]'::jsonb @> '5'; --- But a raw scalar cannot contain an array -SELECT '5'::jsonb @> '[5]'; --- In general, one thing should always contain itself. Test array containment: -SELECT '["9", ["7", "3"], 1]'::jsonb @> '["9", ["7", "3"], 1]'::jsonb; -SELECT '["9", ["7", "3"], ["1"]]'::jsonb @> '["9", ["7", "3"], ["1"]]'::jsonb; --- array containment string matching confusion bug -SELECT '{ "name": "Bob", "tags": [ "enim", "qui"]}'::jsonb @> '{"tags":["qu"]}'; --- array length -SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); -SELECT jsonb_array_length('[]'); -SELECT jsonb_array_length('{"f1":1,"f2":[5,6]}'); -SELECT jsonb_array_length('4'); -SELECT * FROM jsonb_each('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; -SELECT * FROM jsonb_each('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; -SELECT * FROM jsonb_each_text('{"f1":[1,2,3],"f2":{"f3":1},"f4":null,"f5":99,"f6":"stringy"}') q; -SELECT * FROM jsonb_each_text('{"a":{"b":"c","c":"b","1":"first"},"b":[1,2],"c":"cc","1":"first","n":null}'::jsonb) AS q; --- exists -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'a'); -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'b'); -SELECT jsonb_exists('{"a":null, "b":"qq"}', 'c'); -SELECT jsonb_exists('{"a":"null", "b":"qq"}', 'a'); -SELECT jsonb '{"a":null, "b":"qq"}' ? 'a'; -SELECT jsonb '{"a":null, "b":"qq"}' ? 'b'; -SELECT jsonb '{"a":null, "b":"qq"}' ? 'c'; -SELECT jsonb '{"a":"null", "b":"qq"}' ? 'a'; --- array exists - array elements should behave as keys -SELECT count(*) from testjsonb WHERE j->'array' ? 'bar'; --- type sensitive array exists - should return no rows (since "exists" only --- matches strings that are either object keys or array elements) -SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text; --- However, a raw scalar is *contained* within the array -SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb; -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['a','b']); -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['b','a']); -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','a']); -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', ARRAY['c','d']); -SELECT jsonb_exists_any('{"a":null, "b":"qq"}', '{}'::text[]); -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['a','b']; -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['b','a']; -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','a']; -SELECT jsonb '{"a":null, "b":"qq"}' ?| ARRAY['c','d']; -SELECT jsonb '{"a":null, "b":"qq"}' ?| '{}'::text[]; -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['a','b']); -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['b','a']); -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','a']); -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', ARRAY['c','d']); -SELECT jsonb_exists_all('{"a":null, "b":"qq"}', '{}'::text[]); -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','b']; -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['b','a']; -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','a']; -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['c','d']; -SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b']; -SELECT jsonb '{"a":null, "b":"qq"}' ?& '{}'::text[]; --- typeof -SELECT jsonb_typeof('{}') AS object; -SELECT jsonb_typeof('{"c":3,"p":"o"}') AS object; -SELECT jsonb_typeof('[]') AS array; -SELECT jsonb_typeof('["a", 1]') AS array; -SELECT jsonb_typeof('null') AS "null"; -SELECT jsonb_typeof('1') AS number; -SELECT jsonb_typeof('-1') AS number; -SELECT jsonb_typeof('1.0') AS number; -SELECT jsonb_typeof('1e2') AS number; -SELECT jsonb_typeof('-1.0') AS number; -SELECT jsonb_typeof('true') AS boolean; -SELECT jsonb_typeof('false') AS boolean; -SELECT jsonb_typeof('"hello"') AS string; -SELECT jsonb_typeof('"true"') AS string; -SELECT jsonb_typeof('"1.0"') AS string; -SELECT jsonb_build_object('{a,b,c}'::text[]); -- error -SELECT jsonb_build_object('{a,b,c}'::text[], '{d,e,f}'::text[]); -- error, key cannot be array --- empty objects/arrays -SELECT jsonb_build_array(); -SELECT jsonb_build_object(); --- make sure keys are quoted -SELECT jsonb_build_object(1,2); -SELECT jsonb_build_object(r,2) FROM (SELECT 1 AS a, 2 AS b) r; -SELECT jsonb_build_object(json '{"a":1,"b":2}', 3); -SELECT jsonb_build_object('{1,2,3}'::int[], 3); --- handling of NULL values -SELECT jsonb_object_agg(1, NULL::jsonb); -SELECT jsonb_object_agg(NULL, '{"a":1}'); -CREATE TEMP TABLE foo (serial_num int, name text, type text); -INSERT INTO foo VALUES (847001,'t15','GE1043'); -INSERT INTO foo VALUES (847002,'t16','GE1043'); -INSERT INTO foo VALUES (847003,'sub-alpha','GESS90'); -SELECT jsonb_object_agg(name, type) FROM foo; -INSERT INTO foo VALUES (999999, NULL, 'bar'); -SELECT jsonb_object_agg(name, type) FROM foo; --- jsonb_object --- empty object, one dimension -SELECT jsonb_object('{}'); --- empty object, two dimensions -SELECT jsonb_object('{}', '{}'); --- one dimension -SELECT jsonb_object('{a,1,b,2,3,NULL,"d e f","a b c"}'); --- same but with two dimensions -SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); --- odd number error -SELECT jsonb_object('{a,b,c}'); --- one column error -SELECT jsonb_object('{{a},{b}}'); --- too many columns error -SELECT jsonb_object('{{a,b,c},{b,c,d}}'); --- too many dimensions error -SELECT jsonb_object('{{{a,b},{c,d}},{{b,c},{d,e}}}'); ---two argument form of jsonb_object -select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c"}'); --- too many dimensions -SELECT jsonb_object('{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}', '{{a,1},{b,2},{3,NULL},{"d e f","a b c"}}'); --- mismatched dimensions -select jsonb_object('{a,b,c,"d e f",g}','{1,2,3,"a b c"}'); -select jsonb_object('{a,b,c,"d e f"}','{1,2,3,"a b c",g}'); --- null key error -select jsonb_object('{a,b,NULL,"d e f"}','{1,2,3,"a b c"}'); --- empty key is allowed -select jsonb_object('{a,b,"","d e f"}','{1,2,3,"a b c"}'); --- extract_path, extract_path_as_text -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); -SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); -SELECT jsonb_extract_path('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f4','f6'); -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}','f2'); -SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',0::text); -SELECT jsonb_extract_path_text('{"f2":["f3",1],"f4":{"f5":99,"f6":"stringy"}}','f2',1::text); --- extract_path nulls -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_false; -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":{"f5":null,"f6":"stringy"}}','f4','f5') IS NULL AS expect_true; -SELECT jsonb_extract_path('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_false; -SELECT jsonb_extract_path_text('{"f2":{"f3":1},"f4":[0,1,2,null]}','f4','3') IS NULL AS expect_true; -SELECT * FROM jsonb_array_elements('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false]') q; -SELECT * FROM jsonb_array_elements_text('[1,true,[1,[2,3]],null,{"f1":1,"f2":[7,8,9]},false,"stringy"]') q; --- test type info caching in jsonb_populate_record() -CREATE TEMP TABLE jsbpoptest (js jsonb); -INSERT INTO jsbpoptest -SELECT '{ - "jsa": [1, "2", null, 4], - "rec": {"a": "abc", "c": "01.02.2003", "x": 43.2}, - "reca": [{"a": "abc", "b": 456}, null, {"c": "01.02.2003", "x": 43.2}] -}'::jsonb -FROM generate_series(1, 3); --- indexing -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; -SELECT count(*) FROM testjsonb WHERE j ? 'public'; -SELECT count(*) FROM testjsonb WHERE j ? 'bar'; -SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled']; -SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled']; -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; -SELECT count(*) FROM testjsonb WHERE j @? '$'; -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; -CREATE INDEX jidx ON testjsonb USING gin (j); -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"array":["foo"]}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"array":["bar"]}'; --- exercise GIN_SEARCH_MODE_ALL -SELECT count(*) FROM testjsonb WHERE j @> '{}'; -SELECT count(*) FROM testjsonb WHERE j ? 'public'; -SELECT count(*) FROM testjsonb WHERE j ? 'bar'; -SELECT count(*) FROM testjsonb WHERE j ?| ARRAY['public','disabled']; -SELECT count(*) FROM testjsonb WHERE j ?& ARRAY['public','disabled']; -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))'; -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.bar)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) || exists($.disabled)'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.public) && exists($.disabled)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")'; -SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")'; -SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")'; -SELECT count(*) FROM testjsonb WHERE j @? '$'; -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; -SELECT count(*) from testjsonb WHERE j->'array' ? 'bar'; --- type sensitive array exists - should return no rows (since "exists" only --- matches strings that are either object keys or array elements) -SELECT count(*) from testjsonb WHERE j->'array' ? '5'::text; --- However, a raw scalar is *contained* within the array -SELECT count(*) from testjsonb WHERE j->'array' @> '5'::jsonb; --- btree -CREATE INDEX jidx ON testjsonb USING btree (j); -SELECT count(*) FROM testjsonb WHERE j > '{"p":1}'; -SELECT count(*) FROM testjsonb WHERE j = '{"pos":98, "line":371, "node":"CBA", "indexed":true}'; -CREATE INDEX jidx ON testjsonb USING gin (j jsonb_path_ops); -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":null}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC"}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"wait":"CC", "public":true}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25}'; -SELECT count(*) FROM testjsonb WHERE j @> '{"age":25.0}'; --- exercise GIN_SEARCH_MODE_ALL -SELECT count(*) FROM testjsonb WHERE j @> '{}'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == null'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.wait == null))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.wait ? (@ == null))'; -SELECT count(*) FROM testjsonb WHERE j @@ '"CC" == $.wait'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.wait == "CC" && true == $.public'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.age == 25.0'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "foo"'; -SELECT count(*) FROM testjsonb WHERE j @@ '$.array[*] == "bar"'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($ ? (@.array[*] == "bar"))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array ? (@[*] == "bar"))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($.array[*] ? (@ == "bar"))'; -SELECT count(*) FROM testjsonb WHERE j @@ 'exists($)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? (@ == null)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.wait ? ("CC" == @)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.wait == "CC" && true == @.public)'; -SELECT count(*) FROM testjsonb WHERE j @? '$.age ? (@ == 25)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.age == 25.0)'; -SELECT count(*) FROM testjsonb WHERE j @? '$ ? (@.array[*] == "bar")'; -SELECT count(*) FROM testjsonb WHERE j @? '$.array ? (@[*] == "bar")'; -SELECT count(*) FROM testjsonb WHERE j @? '$.array[*] ? (@ == "bar")'; -SELECT count(*) FROM testjsonb WHERE j @? '$'; -SELECT count(*) FROM testjsonb WHERE j @? '$.public'; -SELECT count(*) FROM testjsonb WHERE j @? '$.bar'; --- nested tests -SELECT '{"ff":{"a":12,"b":16}}'::jsonb; -SELECT '{"ff":{"a":12,"b":16},"qq":123}'::jsonb; -SELECT '{"aa":["a","aaa"],"qq":{"a":12,"b":16,"c":["c1","c2"],"d":{"d1":"d1","d2":"d2","d1":"d3"}}}'::jsonb; -SELECT '{"ff":["a","aaa"]}'::jsonb; -SELECT - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff', - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq', - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f, - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t, - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x'; --- nested containment -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}'; -SELECT '{"a":[2,1],"c":"b"}'::jsonb @> '{"a":[1,2]}'; -SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":[1,2]}'; -SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":[1,2]}'; -SELECT '{"a":{"1":2},"c":"b"}'::jsonb @> '{"a":{"1":2}}'; -SELECT '{"a":{"2":1},"c":"b"}'::jsonb @> '{"a":{"1":2}}'; -SELECT '["a","b"]'::jsonb @> '["a","b","c","b"]'; -SELECT '["a","b","c","b"]'::jsonb @> '["a","b"]'; -SELECT '["a","b","c",[1,2]]'::jsonb @> '["a",[1,2]]'; -SELECT '["a","b","c",[1,2]]'::jsonb @> '["b",[1,2]]'; -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1]}'; -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[2]}'; -SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[3]}'; -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"c":3}]}'; -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4}]}'; -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},3]}'; -SELECT '{"a":[1,2,{"c":3,"x":4}],"c":"b"}'::jsonb @> '{"a":[{"x":4},1]}'; --- check some corner cases for indexed nested containment (bug #13756) -create temp table nestjsonb (j jsonb); -insert into nestjsonb (j) values ('{"a":[["b",{"x":1}],["b",{"x":2}]],"c":3}'); -insert into nestjsonb (j) values ('[[14,2,3]]'); -insert into nestjsonb (j) values ('[1,[14,2,3]]'); -create index on nestjsonb using gin(j jsonb_path_ops); -select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb; -select * from nestjsonb where j @> '{"c":3}'; -select * from nestjsonb where j @> '[[14]]'; -select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb; -select * from nestjsonb where j @> '{"c":3}'; -select * from nestjsonb where j @> '[[14]]'; --- nested object field / array index lookup -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'n'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'a'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'b'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'c'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'd' -> '1'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 'e'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb -> 0; --expecting error -SELECT '["a","b","c",[1,2],null]'::jsonb -> 0; -SELECT '["a","b","c",[1,2],null]'::jsonb -> 1; -SELECT '["a","b","c",[1,2],null]'::jsonb -> 2; -SELECT '["a","b","c",[1,2],null]'::jsonb -> 3; -SELECT '["a","b","c",[1,2],null]'::jsonb -> 3 -> 1; -SELECT '["a","b","c",[1,2],null]'::jsonb -> 4; -SELECT '["a","b","c",[1,2],null]'::jsonb -> 5; -SELECT '["a","b","c",[1,2],null]'::jsonb -> -1; -SELECT '["a","b","c",[1,2],null]'::jsonb -> -5; -SELECT '["a","b","c",[1,2],null]'::jsonb -> -6; ---nested exists -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'n'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'a'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'b'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'c'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'd'; -SELECT '{"n":null,"a":1,"b":[1,2],"c":{"1":2},"d":{"1":[2,3]}}'::jsonb ? 'e'; --- jsonb_strip_nulls -select jsonb_strip_nulls(null); -select jsonb_strip_nulls('1'); -select jsonb_strip_nulls('"a string"'); -select jsonb_strip_nulls('null'); -select jsonb_strip_nulls('[1,2,null,3,4]'); -select jsonb_strip_nulls('{"a":1,"b":null,"c":[2,null,3],"d":{"e":4,"f":null}}'); -select jsonb_strip_nulls('[1,{"a":1,"b":null,"c":2},3]'); --- an empty object is not null and should not be stripped -select jsonb_strip_nulls('{"a": {"b": null, "c": null}, "d": {} }'); -select jsonb_concat('{"d": "test", "a": [1, 2]}', '{"g": "test2", "c": {"c1":1, "c2":2}}'); -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"cq":"l", "b":"g", "fg":false}'; -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aq":"l"}'; -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{"aa":"l"}'; -select '{"aa":1 , "b":2, "cq":3}'::jsonb || '{}'; -select '["a", "b"]'::jsonb || '["c"]'; -select '["a", "b"]'::jsonb || '["c", "d"]'; -select '["c"]' || '["a", "b"]'::jsonb; -select '["a", "b"]'::jsonb || '"c"'; -select '"c"' || '["a", "b"]'::jsonb; -select '[]'::jsonb || '["a"]'::jsonb; -select '[]'::jsonb || '"a"'::jsonb; -select '"b"'::jsonb || '"a"'::jsonb; -select '{}'::jsonb || '{"a":"b"}'::jsonb; -select '[]'::jsonb || '{"a":"b"}'::jsonb; -select '{"a":"b"}'::jsonb || '[]'::jsonb; -select '"a"'::jsonb || '{"a":1}'; -select '{"a":1}' || '"a"'::jsonb; -select '[3]'::jsonb || '{}'::jsonb; -select '3'::jsonb || '[]'::jsonb; -select '3'::jsonb || '4'::jsonb; -select '3'::jsonb || '{}'::jsonb; -select '["a", "b"]'::jsonb || '{"c":1}'; -select '{"c": 1}'::jsonb || '["a", "b"]'; -select '{}'::jsonb || '{"cq":"l", "b":"g", "fg":false}'; -select pg_column_size('{}'::jsonb || '{}'::jsonb) = pg_column_size('{}'::jsonb); -select pg_column_size('{"aa":1}'::jsonb || '{"b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); -select pg_column_size('{"aa":1, "b":2}'::jsonb || '{}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); -select pg_column_size('{}'::jsonb || '{"aa":1, "b":2}'::jsonb) = pg_column_size('{"aa":1, "b":2}'::jsonb); -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'a'); -select jsonb_delete('{"a":null , "b":2, "c":3}'::jsonb, 'a'); -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'b'); -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'c'); -select jsonb_delete('{"a":1 , "b":2, "c":3}'::jsonb, 'd'); -select '{"a":1 , "b":2, "c":3}'::jsonb - 'a'; -select '{"a":null , "b":2, "c":3}'::jsonb - 'a'; -select '{"a":1 , "b":2, "c":3}'::jsonb - 'b'; -select '{"a":1 , "b":2, "c":3}'::jsonb - 'c'; -select '{"a":1 , "b":2, "c":3}'::jsonb - 'd'; -select pg_column_size('{"a":1 , "b":2, "c":3}'::jsonb - 'b') = pg_column_size('{"a":1, "b":2}'::jsonb); -select '["a","b","c"]'::jsonb - 3; -select '["a","b","c"]'::jsonb - 2; -select '["a","b","c"]'::jsonb - 1; -select '["a","b","c"]'::jsonb - 0; -select '["a","b","c"]'::jsonb - -1; -select '["a","b","c"]'::jsonb - -2; -select '["a","b","c"]'::jsonb - -3; -select '["a","b","c"]'::jsonb - -4; -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{n}'); -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{b,-1}'); -select jsonb_delete_path('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}', '{d,1,0}'); -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{n}'; -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1}'; -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{b,-1e}'; -- invalid array subscript -select '{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb #- '{d,1,0}'; --- empty structure and error conditions for delete and replace -select '"a"'::jsonb - 'a'; -- error -select '{}'::jsonb - 'a'; -select '[]'::jsonb - 'a'; -select '"a"'::jsonb - 1; -- error -select '{}'::jsonb - 1; -- error -select '[]'::jsonb - 1; -select '"a"'::jsonb #- '{a}'; -- error -select '{}'::jsonb #- '{a}'; -select '[]'::jsonb #- '{a}'; -select jsonb_set('{}','{a}','"b"', false); -select jsonb_set('[]','{1}','"b"', false); -select jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0}','[2,3,4]', false); --- jsonb_set_lax -\pset null NULL --- errors -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, null); -select jsonb_set_lax('{"a":1,"b":2}', '{b}', null, true, 'no_such_treatment'); -\pset null '' -select jsonb_insert('{"a": [0,1,2]}', '{a, 1}', '"new_value"', true); -select jsonb_insert('{"a": {"b": {"c": [0, 1, "test1", "test2"]}}}', '{a, b, c, 2}', '"new_value"', true); -select jsonb_insert('{"a": [0,1,2]}', '{a, 0}', '"new_value"', true); -select jsonb_insert('{"a": [0,1,2]}', '{a, 2}', '"new_value"', true); -select jsonb_insert('{"a": [0,1,2]}', '{a, -1}', '"new_value"', true); -select jsonb_insert('[]', '{1}', '"new_value"', true); -select jsonb_insert('{"a": []}', '{a, 1}', '"new_value"', true); -select jsonb_insert('{"a": {"b": "value"}}', '{a, c}', '"new_value"', true); -select jsonb_insert('{"a": {"b": "value"}}', '{a, b}', '"new_value"', true); -create TEMP TABLE test_jsonb_subscript ( - id int, - test_json jsonb -); -insert into test_jsonb_subscript values -(1, '{}'), -- empty jsonb -(2, '{"key": "value"}'); -- jsonb with data --- NULL as jsonb source -insert into test_jsonb_subscript values (3, NULL); -insert into test_jsonb_subscript values (1, '[0]'); -insert into test_jsonb_subscript values (1, '[]'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '{"b": 1}'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '[]'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '[]'); -insert into test_jsonb_subscript values (1, '{}'); -insert into test_jsonb_subscript values (1, '{"a": {}}'); -insert into test_jsonb_subscript values (1, '{"a": []}'); -insert into test_jsonb_subscript values (1, '{"a": 1}'); -insert into test_jsonb_subscript values (1, 'null'); --- casts -select 'true'::jsonb::bool; -select '[]'::jsonb::bool; -select '1.0'::jsonb::float; -select '[1.0]'::jsonb::float; -select '12345'::jsonb::int4; -select '"hello"'::jsonb::int4; -select '12345'::jsonb::numeric; -select '{}'::jsonb::numeric; -select '12345.05'::jsonb::numeric; -select '12345.05'::jsonb::float4; -select '12345.05'::jsonb::float8; -select '12345.05'::jsonb::int2; -select '12345.05'::jsonb::int4; -select '12345.05'::jsonb::int8; -select '12345.0000000000000000000000000000000000000000000005'::jsonb::numeric; -select '12345.0000000000000000000000000000000000000000000005'::jsonb::float4; -select '12345.0000000000000000000000000000000000000000000005'::jsonb::float8; -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int2; -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int4; -select '12345.0000000000000000000000000000000000000000000005'::jsonb::int8; diff --git a/ydb/library/yql/tests/postgresql/cases/select.err b/ydb/library/yql/tests/postgresql/cases/select.err deleted file mode 100644 index 8d37f1208ee4..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/select.err +++ /dev/null @@ -1,656 +0,0 @@ -Registering pre-existing tables - onek - onek2 - emp - student - stud_emp - int8_tbl - --- --- SELECT --- --- btree index --- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1 --- -SELECT * FROM onek - WHERE onek.unique1 < 10 - ORDER BY onek.unique1; - - --- --- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1 --- -SELECT onek.unique1, onek.stringu1 FROM onek - WHERE onek.unique1 < 20 - ORDER BY unique1 using >; - --stdin-:
: Error: Parse Sql - - -stdin-:
:6:27: Error: sortby_dir unsupported value: 3 - ORDER BY unique1 using >; - ^ - --- --- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2 --- -SELECT onek.unique1, onek.stringu1 FROM onek - WHERE onek.unique1 > 980 - ORDER BY stringu1 using <; - --stdin-:
: Error: Parse Sql - - -stdin-:
:6:28: Error: sortby_dir unsupported value: 3 - ORDER BY stringu1 using <; - ^ - --- --- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data | --- sort +1d -2 +0nr -1 --- -SELECT onek.unique1, onek.string4 FROM onek - WHERE onek.unique1 > 980 - ORDER BY string4 using <, unique1 using >; - --stdin-:
: Error: Parse Sql - - -stdin-:
:7:27: Error: sortby_dir unsupported value: 3 - ORDER BY string4 using <, unique1 using >; - ^ - --- --- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data | --- sort +1dr -2 +0n -1 --- -SELECT onek.unique1, onek.string4 FROM onek - WHERE onek.unique1 > 980 - ORDER BY string4 using >, unique1 using <; - --stdin-:
: Error: Parse Sql - - -stdin-:
:7:27: Error: sortby_dir unsupported value: 3 - ORDER BY string4 using >, unique1 using <; - ^ - --- --- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data | --- sort +0nr -1 +1d -2 --- -SELECT onek.unique1, onek.string4 FROM onek - WHERE onek.unique1 < 20 - ORDER BY unique1 using >, string4 using <; - --stdin-:
: Error: Parse Sql - - -stdin-:
:7:27: Error: sortby_dir unsupported value: 3 - ORDER BY unique1 using >, string4 using <; - ^ - --- --- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data | --- sort +0n -1 +1dr -2 --- -SELECT onek.unique1, onek.string4 FROM onek - WHERE onek.unique1 < 20 - ORDER BY unique1 using <, string4 using >; - --stdin-:
: Error: Parse Sql - - -stdin-:
:7:27: Error: sortby_dir unsupported value: 3 - ORDER BY unique1 using <, string4 using >; - ^ - --- --- test partial btree indexes --- --- As of 7.2, planner probably won't pick an indexscan without stats, --- so ANALYZE first. Also, we want to prevent it from picking a bitmapscan --- followed by sort, because that could hide index ordering problems. --- -ANALYZE onek2; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 275 - -- - ^ - -SET enable_seqscan TO off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_seqscan - SET enable_seqscan TO off; - ^ - -SET enable_bitmapscan TO off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan - SET enable_bitmapscan TO off; - ^ - -SET enable_sort TO off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_sort - SET enable_sort TO off; - ^ - --- --- awk '{if($1<10){print $0;}else{next;}}' onek.data | sort +0n -1 --- -SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10; - - --- --- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1 --- -SELECT onek2.unique1, onek2.stringu1 FROM onek2 - WHERE onek2.unique1 < 20 - ORDER BY unique1 using >; - --stdin-:
: Error: Parse Sql - - -stdin-:
:6:28: Error: sortby_dir unsupported value: 3 - ORDER BY unique1 using >; - ^ - --- --- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2 --- -SELECT onek2.unique1, onek2.stringu1 FROM onek2 - WHERE onek2.unique1 > 980; - - -RESET enable_seqscan; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_seqscan; - ^ - -RESET enable_bitmapscan; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_bitmapscan; - ^ - -RESET enable_sort; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_sort; - ^ - -SELECT two, stringu1, ten, string4 - INTO TABLE tmp - FROM onek; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: SelectStmt: not supported intoClause - SELECT two, stringu1, ten, string4 - ^ - --- --- awk '{print $1,$2;}' person.data | --- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data | --- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data | --- awk 'BEGIN{FS=" ";}{if(NF!=2){print $4,$5;}else{print;}}' - stud_emp.data --- --- SELECT name, age FROM person*; ??? check if different -SELECT p.name, p.age FROM person* p; - --stdin-:
: Fatal: Table metadata loading - - -stdin-:
: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.person - - --- --- awk '{print $1,$2;}' person.data | --- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data | --- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data | --- awk 'BEGIN{FS=" ";}{if(NF!=1){print $4,$5;}else{print;}}' - stud_emp.data | --- sort +1nr -2 --- -SELECT p.name, p.age FROM person* p ORDER BY age using >, name; - --stdin-:
: Error: Parse Sql - - -stdin-:
:8:56: Error: sortby_dir unsupported value: 3 - SELECT p.name, p.age FROM person* p ORDER BY age using >, name; - ^ - --- --- Test some cases involving whole-row Var referencing a subquery --- -select foo from (select 1 offset 0) as foo; - - -select foo from (select null offset 0) as foo; - - -select foo from (select 'xyzzy',1,null offset 0) as foo; - - --- --- Test VALUES lists --- -select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j) - WHERE onek.unique1 = v.i and onek.stringu1 = v.j; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: OrderedMap, At function: EquiJoin - -- - ^ - -stdin-:
:1:1: Error: Cannot compare key columns (0.stringu1 has type: pgname, 1._alias_v.j has type: pgtext) - -- - ^ - --- a more complex case --- looks like we're coding lisp :-) -select * from onek, - (values ((select i from - (values(10000), (2), (389), (1000), (2000), ((select 10029))) as foo(i) - order by i asc limit 1))) bar (i) - where onek.unique1 = bar.i; - --stdin-:
: Error: Parse Sql - - -stdin-:
:4:12: Error: SubLinks are not allowed in: VALUES - (values ((select i from - ^ --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect - -- a more complex case - ^ - -stdin-:
:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term - -- a more complex case - ^ - --- try VALUES in a subquery -select * from onek - where (unique1,ten) in (values (1,1), (20,0), (99,9), (17,99)) - order by unique1; - --stdin-:
: Error: Parse Sql - - -stdin-:
:3:25: Error: alternative is not implemented yet : 138 - where (unique1,ten) in (values (1,1), (20,0), (99,9), (17,99)) - ^ - --- VALUES is also legal as a standalone query or a set-operation member -VALUES (1,2), (3,4+4), (7,77.7); - - -VALUES (1,2), (3,4+4), (7,77.7) -UNION ALL -SELECT 2+2, 57 -UNION ALL -TABLE int8_tbl; - - --- corner case: VALUES with no columns -CREATE TEMP TABLE nocols(); - - -INSERT INTO nocols DEFAULT VALUES; - --stdin-:
: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'default_values' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. - - -SELECT * FROM nocols n, LATERAL (VALUES(n.*)) v; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RangeSubselect: unsupported lateral - SELECT * FROM nocols n, LATERAL (VALUES(n.*)) v; - ^ - --- --- Test ORDER BY options --- -CREATE TEMP TABLE foo (f1 int); - - -INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1); - - -SELECT * FROM foo ORDER BY f1; - - -SELECT * FROM foo ORDER BY f1 ASC; -- same thing - - -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - - -SELECT * FROM foo ORDER BY f1 DESC; - - -SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; - - --- check if indexscans do the right things -CREATE INDEX fooi ON foo (f1); - - -SET enable_sort = false; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_sort - SET enable_sort = false; - ^ - -SELECT * FROM foo ORDER BY f1; - - -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - - -SELECT * FROM foo ORDER BY f1 DESC; - - -SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; - - -DROP INDEX fooi; - --stdin-:
: Error: Pre type annotation - - -stdin-:
:1:1: Error: Unexpected tag: pgObject - DROP INDEX fooi; - ^ - -CREATE INDEX fooi ON foo (f1 DESC); - - -SELECT * FROM foo ORDER BY f1; - - -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - - -SELECT * FROM foo ORDER BY f1 DESC; - - -SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; - - -DROP INDEX fooi; - --stdin-:
: Error: Pre type annotation - - -stdin-:
:1:1: Error: Unexpected tag: pgObject - DROP INDEX fooi; - ^ - -CREATE INDEX fooi ON foo (f1 DESC NULLS LAST); - - -SELECT * FROM foo ORDER BY f1; - - -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - - -SELECT * FROM foo ORDER BY f1 DESC; - - -SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; - - --- --- Test planning of some cases with partial indexes --- --- partial index is usable -explain (costs off) -select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - -- - ^ - -select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - - --- actually run the query with an analyze to use the partial index -explain (costs off, analyze on, timing off, summary off) -select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - -- actually run the query with an analyze to use the partial index - ^ - -explain (costs off) -select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - explain (costs off) - ^ - -select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - - --- partial index predicate implies clause, so no need for retest -explain (costs off) -select * from onek2 where unique2 = 11 and stringu1 < 'B'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - -- partial index predicate implies clause, so no need for retest - ^ - -select * from onek2 where unique2 = 11 and stringu1 < 'B'; - - -explain (costs off) -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - explain (costs off) - ^ - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - - --- but if it's an update target, must retest anyway -explain (costs off) -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - -- but if it's an update target, must retest anyway - ^ - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; - - --- partial index is not applicable -explain (costs off) -select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - -- partial index is not applicable - ^ - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; - - --- partial index implies clause, but bitmap scan must recheck predicate anyway -SET enable_indexscan TO off; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported name: enable_indexscan - -- partial index implies clause, but bitmap scan must recheck predicate anyway - ^ - -explain (costs off) -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - explain (costs off) - ^ - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - - -RESET enable_indexscan; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: VariableSetStmt, not supported kind: 4 - RESET enable_indexscan; - ^ - --- check multi-index cases too -explain (costs off) -select unique1, unique2 from onek2 - where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - -- check multi-index cases too - ^ - -select unique1, unique2 from onek2 - where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; - - -explain (costs off) -select unique1, unique2 from onek2 - where (unique2 = 11 and stringu1 < 'B') or unique1 = 0; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - explain (costs off) - ^ - -select unique1, unique2 from onek2 - where (unique2 = 11 and stringu1 < 'B') or unique1 = 0; - - --- --- Test some corner cases that have been known to confuse the planner --- --- ORDER BY on a constant doesn't really need any sorting -SELECT 1 AS x ORDER BY x; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem - -- - ^ - -stdin-:
:5:24: Error: Column reference can't be used without FROM - SELECT 1 AS x ORDER BY x; - ^ - --- But ORDER BY on a set-valued expression does -create function sillysrf(int) returns setof int as - 'values (1),(10),(2),($1)' language sql immutable; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 261 - -- But ORDER BY on a set-valued expression does - ^ - -select sillysrf(42); - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select sillysrf(42); - ^ - -stdin-:
:1:8: Error: At function: PgCall - select sillysrf(42); - ^ - -stdin-:
:1:8: Error: No such proc: sillysrf - select sillysrf(42); - ^ - -select sillysrf(-1) order by 1; - --stdin-:
: Error: Type annotation - - -stdin-:
:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem - select sillysrf(-1) order by 1; - ^ - -stdin-:
:1:8: Error: At function: PgCall - select sillysrf(-1) order by 1; - ^ - -stdin-:
:1:8: Error: No such proc: sillysrf - select sillysrf(-1) order by 1; - ^ - -drop function sillysrf(int); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: DropStmt: alternative is not implemented yet : 386 - drop function sillysrf(int); - ^ - --- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict --- (see bug #5084) -select * from (values (2),(null),(1)) v(k) where k = k order by k; - - -select * from (values (2),(null),(1)) v(k) where k = k; - - --- Test partitioned tables with no partitions, which should be handled the --- same as the non-inheritance case when expanding its RTE. -create table list_parted_tbl (a int,b int) partition by list (a); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: PARTITION BY clause not supported - -- Test partitioned tables with no partitions, which should be handled the - ^ - -create table list_parted_tbl1 partition of list_parted_tbl - for values in (1) partition by list(b); - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: table inheritance not supported - create table list_parted_tbl1 partition of list_parted_tbl - ^ - -explain (costs off) select * from list_parted_tbl; - --stdin-:
: Error: Parse Sql - - -stdin-:
:1:1: Error: RawStmt: alternative is not implemented yet : 276 - explain (costs off) select * from list_parted_tbl; - ^ - -drop table list_parted_tbl; - diff --git a/ydb/library/yql/tests/postgresql/cases/select.out b/ydb/library/yql/tests/postgresql/cases/select.out deleted file mode 100644 index ddc7742c4d9f..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/select.out +++ /dev/null @@ -1,204 +0,0 @@ --- --- SELECT --- --- btree index --- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1 --- -SELECT * FROM onek - WHERE onek.unique1 < 10 - ORDER BY onek.unique1; - unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 ----------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- - 0 | 998 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | AAAAAA | KMBAAA | OOOOxx - 1 | 214 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | GIAAAA | OOOOxx - 2 | 326 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | OMAAAA | OOOOxx - 3 | 431 | 1 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 7 | DAAAAA | PQAAAA | VVVVxx - 4 | 833 | 0 | 0 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 8 | 9 | EAAAAA | BGBAAA | HHHHxx - 5 | 541 | 1 | 1 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 10 | 11 | FAAAAA | VUAAAA | HHHHxx - 6 | 978 | 0 | 2 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 12 | 13 | GAAAAA | QLBAAA | OOOOxx - 7 | 647 | 1 | 3 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 14 | 15 | HAAAAA | XYAAAA | VVVVxx - 8 | 653 | 0 | 0 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 16 | 17 | IAAAAA | DZAAAA | HHHHxx - 9 | 49 | 1 | 1 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 18 | 19 | JAAAAA | XBAAAA | HHHHxx -(10 rows) - --- --- Test some cases involving whole-row Var referencing a subquery --- -select foo from (select 1 offset 0) as foo; - foo ------ - (1) -(1 row) - -select foo from (select null offset 0) as foo; - foo ------ - () -(1 row) - -select foo from (select 'xyzzy',1,null offset 0) as foo; - foo ------------- - (xyzzy,1,) -(1 row) - --- VALUES is also legal as a standalone query or a set-operation member -VALUES (1,2), (3,4+4), (7,77.7); - column1 | column2 ----------+--------- - 1 | 2 - 3 | 8 - 7 | 77.7 -(3 rows) - -VALUES (1,2), (3,4+4), (7,77.7) -UNION ALL -SELECT 2+2, 57 -UNION ALL -TABLE int8_tbl; - column1 | column2 -------------------+------------------- - 1 | 2 - 3 | 8 - 7 | 77.7 - 4 | 57 - 123 | 456 - 123 | 4567890123456789 - 4567890123456789 | 123 - 4567890123456789 | 4567890123456789 - 4567890123456789 | -4567890123456789 -(9 rows) - --- corner case: VALUES with no columns -CREATE TEMP TABLE nocols(); --- --- Test ORDER BY options --- -CREATE TEMP TABLE foo (f1 int); -INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - f1 ----- - - - 1 - 3 - 7 - 10 - 42 -(7 rows) - --- check if indexscans do the right things -CREATE INDEX fooi ON foo (f1); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - f1 ----- - - - 1 - 3 - 7 - 10 - 42 -(7 rows) - -CREATE INDEX fooi ON foo (f1 DESC); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - f1 ----- - - - 1 - 3 - 7 - 10 - 42 -(7 rows) - -CREATE INDEX fooi ON foo (f1 DESC NULLS LAST); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; - f1 ----- - - - 1 - 3 - 7 - 10 - 42 -(7 rows) - -select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 ----------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- - 494 | 11 | 0 | 2 | 4 | 14 | 4 | 94 | 94 | 494 | 494 | 8 | 9 | ATAAAA | LAAAAA | VVVVxx -(1 row) - -select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - unique2 ---------- - 11 -(1 row) - -select * from onek2 where unique2 = 11 and stringu1 < 'B'; - unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 ----------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- - 494 | 11 | 0 | 2 | 4 | 14 | 4 | 94 | 94 | 494 | 494 | 8 | 9 | ATAAAA | LAAAAA | VVVVxx -(1 row) - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - unique2 ---------- - 11 -(1 row) - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; - unique2 ---------- - 11 -(1 row) - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; - unique2 ---------- - 11 -(1 row) - -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - unique2 ---------- - 11 -(1 row) - -select unique1, unique2 from onek2 - where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; - unique1 | unique2 ----------+--------- - 494 | 11 - 0 | 998 -(2 rows) - -select unique1, unique2 from onek2 - where (unique2 = 11 and stringu1 < 'B') or unique1 = 0; - unique1 | unique2 ----------+--------- - 494 | 11 - 0 | 998 -(2 rows) - --- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict --- (see bug #5084) -select * from (values (2),(null),(1)) v(k) where k = k order by k; - k ---- - 1 - 2 -(2 rows) - -select * from (values (2),(null),(1)) v(k) where k = k; - k ---- - 2 - 1 -(2 rows) - diff --git a/ydb/library/yql/tests/postgresql/cases/select.sql b/ydb/library/yql/tests/postgresql/cases/select.sql deleted file mode 100644 index 80e9c57bafe0..000000000000 --- a/ydb/library/yql/tests/postgresql/cases/select.sql +++ /dev/null @@ -1,52 +0,0 @@ --- --- SELECT --- --- btree index --- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1 --- -SELECT * FROM onek - WHERE onek.unique1 < 10 - ORDER BY onek.unique1; --- --- Test some cases involving whole-row Var referencing a subquery --- -select foo from (select 1 offset 0) as foo; -select foo from (select null offset 0) as foo; -select foo from (select 'xyzzy',1,null offset 0) as foo; --- VALUES is also legal as a standalone query or a set-operation member -VALUES (1,2), (3,4+4), (7,77.7); -VALUES (1,2), (3,4+4), (7,77.7) -UNION ALL -SELECT 2+2, 57 -UNION ALL -TABLE int8_tbl; --- corner case: VALUES with no columns -CREATE TEMP TABLE nocols(); --- --- Test ORDER BY options --- -CREATE TEMP TABLE foo (f1 int); -INSERT INTO foo VALUES (42),(3),(10),(7),(null),(null),(1); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; --- check if indexscans do the right things -CREATE INDEX fooi ON foo (f1); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; -CREATE INDEX fooi ON foo (f1 DESC); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; -CREATE INDEX fooi ON foo (f1 DESC NULLS LAST); -SELECT * FROM foo ORDER BY f1 NULLS FIRST; -select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; -select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; -select * from onek2 where unique2 = 11 and stringu1 < 'B'; -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; -select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; -select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; -select unique1, unique2 from onek2 - where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; -select unique1, unique2 from onek2 - where (unique2 = 11 and stringu1 < 'B') or unique1 = 0; --- X = X isn't a no-op, it's effectively X IS NOT NULL assuming = is strict --- (see bug #5084) -select * from (values (2),(null),(1)) v(k) where k = k order by k; -select * from (values (2),(null),(1)) v(k) where k = k; diff --git a/ydb/library/yql/tests/sql/suites/pg/record_from_table_row.sql b/ydb/library/yql/tests/sql/suites/pg/record_from_table_row.sql deleted file mode 100644 index 5133380ec604..000000000000 --- a/ydb/library/yql/tests/sql/suites/pg/record_from_table_row.sql +++ /dev/null @@ -1,4 +0,0 @@ ---!syntax_pg -SELECT row_to_json(TR) -FROM (select 'foo' as y, 1 as x) tr - diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan index ab27c6a2d401..af346148b069 100644 --- a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan +++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_join_join_range_right.sql-plan_/join_join_range_right.sql.plan @@ -29,7 +29,13 @@ "Key2", "Value" ], - "type": "Lookup" + "lookup_by": [ + "Key1 (103)" + ], + "scan_by": [ + "Key2 (-\u221e, +\u221e)" + ], + "type": "Scan" } ] }