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
e2a277bd
Commit
e2a277bd
authored
Nov 05, 2008
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few additional test cases for array functionality
parent
e0dc7d02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
2 deletions
+75
-2
src/test/regress/expected/arrays.out
src/test/regress/expected/arrays.out
+62
-1
src/test/regress/sql/arrays.sql
src/test/regress/sql/arrays.sql
+13
-1
No files found.
src/test/regress/expected/arrays.out
View file @
e2a277bd
...
...
@@ -725,7 +725,14 @@ select * from arr_tbl where f1 > '{1,2,3}' and f1 <= '{1,5,3}';
{1,5,3}
(2 rows)
-- note: if above select doesn't produce the expected tuple order,
select * from arr_tbl where f1 >= '{1,2,3}' and f1 < '{1,5,3}';
f1
----------
{1,2,3}
{1,2,10}
(2 rows)
-- note: if above selects don't produce the expected tuple order,
-- then you didn't get an indexscan plan, and something is busted.
reset enable_seqscan;
reset enable_bitmapscan;
...
...
@@ -858,6 +865,12 @@ select array[]::text[];
{}
(1 row)
select '[0:1]={1.1,2.2}'::float8[];
float8
-----------------
[0:1]={1.1,2.2}
(1 row)
-- all of the above should be accepted
-- tests for array aggregates
CREATE TEMP TABLE arraggtest ( f1 INT[], f2 TEXT[][], f3 FLOAT[]);
...
...
@@ -1014,3 +1027,51 @@ ERROR: wrong number of array_subscripts
DETAIL: Low bound array has different size than dimensions array.
select array_fill(1, array[1,2,null]);
ERROR: dimension values cannot be null
select string_to_array('1|2|3', '|');
string_to_array
-----------------
{1,2,3}
(1 row)
select string_to_array('1|2|3|', '|');
string_to_array
-----------------
{1,2,3,""}
(1 row)
select string_to_array('1||2|3||', '||');
string_to_array
-----------------
{1,2|3,""}
(1 row)
select string_to_array('1|2|3', '');
string_to_array
-----------------
{1|2|3}
(1 row)
select string_to_array('', '|');
string_to_array
-----------------
(1 row)
select string_to_array('1|2|3', NULL);
string_to_array
-----------------
(1 row)
select string_to_array(NULL, '|');
string_to_array
-----------------
(1 row)
select array_to_string(string_to_array('1|2|3', '|'), '|');
array_to_string
-----------------
1|2|3
(1 row)
src/test/regress/sql/arrays.sql
View file @
e2a277bd
...
...
@@ -257,7 +257,8 @@ insert into arr_tbl values ('{1,2,10}');
set
enable_seqscan
to
off
;
set
enable_bitmapscan
to
off
;
select
*
from
arr_tbl
where
f1
>
'{1,2,3}'
and
f1
<=
'{1,5,3}'
;
-- note: if above select doesn't produce the expected tuple order,
select
*
from
arr_tbl
where
f1
>=
'{1,2,3}'
and
f1
<
'{1,5,3}'
;
-- note: if above selects don't produce the expected tuple order,
-- then you didn't get an indexscan plan, and something is busted.
reset
enable_seqscan
;
reset
enable_bitmapscan
;
...
...
@@ -297,6 +298,7 @@ select '{
@ 1 hour @ 42 minutes @ 20 seconds
}'
::
interval
[];
select
array
[]::
text
[];
select
'[0:1]={1.1,2.2}'
::
float8
[];
-- all of the above should be accepted
-- tests for array aggregates
...
...
@@ -374,3 +376,13 @@ select array_fill(1, null, array[2,2]);
select
array_fill
(
1
,
array
[
2
,
2
],
null
);
select
array_fill
(
1
,
array
[
3
,
3
],
array
[
1
,
1
,
1
]);
select
array_fill
(
1
,
array
[
1
,
2
,
null
]);
select
string_to_array
(
'1|2|3'
,
'|'
);
select
string_to_array
(
'1|2|3|'
,
'|'
);
select
string_to_array
(
'1||2|3||'
,
'||'
);
select
string_to_array
(
'1|2|3'
,
''
);
select
string_to_array
(
''
,
'|'
);
select
string_to_array
(
'1|2|3'
,
NULL
);
select
string_to_array
(
NULL
,
'|'
);
select
array_to_string
(
string_to_array
(
'1|2|3'
,
'|'
),
'|'
);
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