Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
01bb8516
Commit
01bb8516
authored
Apr 07, 2018
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test of json(b)_to_tsvector language-independ
Missed in
1c1791e0
commit
parent
1c1791e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
44 deletions
+44
-44
src/test/regress/expected/json.out
src/test/regress/expected/json.out
+11
-11
src/test/regress/expected/jsonb.out
src/test/regress/expected/jsonb.out
+11
-11
src/test/regress/sql/json.sql
src/test/regress/sql/json.sql
+11
-11
src/test/regress/sql/jsonb.sql
src/test/regress/sql/jsonb.sql
+11
-11
No files found.
src/test/regress/expected/json.out
View file @
01bb8516
...
...
@@ -2332,37 +2332,37 @@ select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}':
(1 row)
-- json_to_tsvector
select json_to_tsvector('{"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, '"all"');
json_to_tsvector
----------------------------------------------------------------------------------------
'123':8 '456':12 'aaa':2 'b':6 'bbb':4 'c':10 'd':14 'f':18 'fals':20 'g':22 'true':16
(1 row)
select json_to_tsvector('{"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, '"key"');
json_to_tsvector
--------------------------------
'b':2 'c':4 'd':6 'f':8 'g':10
(1 row)
select json_to_tsvector('{"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, '"string"');
json_to_tsvector
------------------
'aaa':1 'bbb':3
(1 row)
select json_to_tsvector('{"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, '"numeric"');
json_to_tsvector
------------------
'123':1 '456':3
(1 row)
select json_to_tsvector('{"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, '"boolean"');
json_to_tsvector
-------------------
'fals':3 'true':1
(1 row)
select json_to_tsvector('{"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, '["string", "numeric"]');
json_to_tsvector
---------------------------------
'123':5 '456':7 'aaa':1 'bbb':3
...
...
@@ -2454,21 +2454,21 @@ select json_to_tsvector('null'::json, '"all"');
(1 row)
select json_to_tsvector('{"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, '""');
ERROR: wrong flag in flag array: ""
HINT: Possible values are: "string", "numeric", "boolean", "key" and "all"
select json_to_tsvector('{"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, '{}');
ERROR: wrong flag type, only arrays and scalars are allowed
select json_to_tsvector('{"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, '[]');
json_to_tsvector
------------------
(1 row)
select json_to_tsvector('{"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, 'null');
ERROR: flag array element is not a string
HINT: Possible values are: "string", "numeric", "boolean", "key" and "all"
select json_to_tsvector('{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]');
select json_to_tsvector('
english', '
{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::json, '["all", null]');
ERROR: flag array element is not a string
HINT: Possible values are: "string", "numeric", "boolean", "key" and "all"
-- ts_headline for json
...
...
src/test/regress/expected/jsonb.out
View file @
01bb8516
...
...
@@ -4130,37 +4130,37 @@ select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}':
(1 row)
-- jsonb_to_tsvector
select jsonb_to_tsvector('{"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, '"all"');
jsonb_to_tsvector
----------------------------------------------------------------------------------------
'123':8 '456':12 'aaa':2 'b':6 'bbb':4 'c':10 'd':14 'f':18 'fals':20 'g':22 'true':16
(1 row)
select jsonb_to_tsvector('{"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, '"key"');
jsonb_to_tsvector
--------------------------------
'b':2 'c':4 'd':6 'f':8 'g':10
(1 row)
select jsonb_to_tsvector('{"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, '"string"');
jsonb_to_tsvector
-------------------
'aaa':1 'bbb':3
(1 row)
select jsonb_to_tsvector('{"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, '"numeric"');
jsonb_to_tsvector
-------------------
'123':1 '456':3
(1 row)
select jsonb_to_tsvector('{"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, '"boolean"');
jsonb_to_tsvector
-------------------
'fals':3 'true':1
(1 row)
select jsonb_to_tsvector('{"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, '["string", "numeric"]');
jsonb_to_tsvector
---------------------------------
'123':5 '456':7 'aaa':1 'bbb':3
...
...
@@ -4252,21 +4252,21 @@ select jsonb_to_tsvector('null'::jsonb, '"all"');
(1 row)
select jsonb_to_tsvector('{"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, '""');
ERROR: wrong flag in flag array: ""
HINT: Possible values are: "string", "numeric", "boolean", "key" and "all"
select jsonb_to_tsvector('{"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, '{}');
ERROR: wrong flag type, only arrays and scalars are allowed
select jsonb_to_tsvector('{"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, '[]');
jsonb_to_tsvector
-------------------
(1 row)
select jsonb_to_tsvector('{"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, 'null');
ERROR: flag array element is not a string
HINT: Possible values are: "string", "numeric", "boolean", "key" and "all"
select jsonb_to_tsvector('{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]');
select jsonb_to_tsvector('
english', '
{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'::jsonb, '["all", null]');
ERROR: flag array element is not a string
HINT: Possible values are: "string", "numeric", "boolean", "key" and "all"
-- ts_headline for jsonb
...
...
src/test/regress/sql/json.sql
View file @
01bb8516
...
...
@@ -767,12 +767,12 @@ select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff gg
select
to_tsvector
(
'english'
,
'{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'
::
json
);
-- json_to_tsvector
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'"all"'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'"key"'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'"string"'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'"numeric"'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'"boolean"'
);
select
json_to_tsvector
(
'{"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"'
);
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"'
);
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"'
);
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"'
);
select
json_to_tsvector
(
'english'
,
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'"key"'
);
...
...
@@ -793,11 +793,11 @@ select json_to_tsvector('{}'::json, '"all"');
select
json_to_tsvector
(
'[]'
::
json
,
'"all"'
);
select
json_to_tsvector
(
'null'
::
json
,
'"all"'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'""'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'{}'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'[]'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'null'
);
select
json_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
json
,
'["all", null]'
);
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
,
'{}'
);
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'
);
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'
));
...
...
src/test/regress/sql/jsonb.sql
View file @
01bb8516
...
...
@@ -1093,12 +1093,12 @@ select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff gg
select
to_tsvector
(
'english'
,
'{"a": "aaa in bbb ddd ccc", "b": 123, "c": 456}'
::
jsonb
);
-- jsonb_to_tsvector
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'"all"'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'"key"'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'"string"'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'"numeric"'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'"boolean"'
);
select
jsonb_to_tsvector
(
'{"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"'
);
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"'
);
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"'
);
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"'
);
select
jsonb_to_tsvector
(
'english'
,
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'"key"'
);
...
...
@@ -1119,11 +1119,11 @@ select jsonb_to_tsvector('{}'::jsonb, '"all"');
select
jsonb_to_tsvector
(
'[]'
::
jsonb
,
'"all"'
);
select
jsonb_to_tsvector
(
'null'
::
jsonb
,
'"all"'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'""'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'{}'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'[]'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'null'
);
select
jsonb_to_tsvector
(
'{"a": "aaa in bbb", "b": 123, "c": 456, "d": true, "f": false, "g": null}'
::
jsonb
,
'["all", null]'
);
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
,
'{}'
);
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'
);
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'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment