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
6ce5e0ab
Commit
6ce5e0ab
authored
Jan 15, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update arrays regress test to reflect fact that several things
work now that did not work in 6.5.
parent
2a1bfbce
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
64 deletions
+80
-64
src/test/regress/expected/arrays.out
src/test/regress/expected/arrays.out
+60
-42
src/test/regress/sql/arrays.sql
src/test/regress/sql/arrays.sql
+20
-22
No files found.
src/test/regress/expected/arrays.out
View file @
6ce5e0ab
QUERY: SELECT * FROM arrtest;
--
a |b |c |d |e |f |g
-- ARRAYS
-----------+---------------+-------------+-----------------+-------------+-----------------+---------------
--
{1,2,3,4,5}|{{{0,0},{1,2}}}|{} |{} | |{} |{}
SELECT * FROM arrtest;
{11,12,23} |{{3,4},{4,5}} |{"foobar"} |{{"elt1","elt2"}}|{"3.4","6.7"}|{"abc ","abcde"}|{"abc","abcde"}
a | b | c | d | e | f | g
{} |{3,4} |{"foo","bar"}|{"bar","foo"} | | |
-------------+-----------------+---------------+-------------------+---------------+-------------------+-----------------
{1,2,3,4,5} | {{{0,0},{1,2}}} | {} | {} | | {} | {}
{11,12,23} | {{3,4},{4,5}} | {"foobar"} | {{"elt1","elt2"}} | {"3.4","6.7"} | {"abc ","abcde"} | {"abc","abcde"}
{} | {3,4} | {"foo","bar"} | {"bar","foo"} | | |
(3 rows)
(3 rows)
QUERY:
SELECT arrtest.a[1],
SELECT arrtest.a[1],
arrtest.b[1][1][1],
arrtest.b[1][1][1],
arrtest.c[1],
arrtest.c[1],
arrtest.d[1][1],
arrtest.d[1][1],
arrtest.e[0]
arrtest.e[0]
FROM arrtest;
FROM arrtest;
a
|b|c |d |e
a
| b | c | d | e
--
+-+------+----+
-
--
--+---+--------+------+--
-
1|0| | |
1 | 0 | | |
11| |foobar|elt1|
11 | | foobar | elt1 |
| |foo | |
| | foo | |
(3 rows)
(3 rows)
QUERY: SELECT arrtest.a[1:3],
SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
arrtest.b[1:1][1:2][1:2],
arrtest.c[1:2],
arrtest.d[1:1][1:2]
FROM arrtest;
FROM arrtest;
a |b |c |d
a | b | c | d | e
----
------+---------------+-------------+--------------
---
----
+---+--------+------+
---
{1,2,3} |{{{0,0},{1,2}}}| |
1 | 0 | | |
{11,12,23}| | |{{"elt1","elt2"}}
11 | | foobar | elt1 |
| |{"foo","bar"}|
| | foo | |
(3 rows)
(3 rows)
QUERY: SELECT array_dims(arrtest.b) AS x;
SELECT a[1:3],
x
b[1:1][1:2][1:2],
---------------
c[1:2],
[1:1][1:2][1:2]
d[1:1][1:2]
[1:2][1:2]
FROM arrtest;
[1:2]
a | b | c | d
------------+-----------------+---------------+-------------------
{1,2,3} | {{{0,0},{1,2}}} | |
{11,12,23} | | | {{"elt1","elt2"}}
| | {"foo","bar"} |
(3 rows)
-- returns three different results--
SELECT array_dims(arrtest.b) AS x;
x
-----------------
[1:1][1:2][1:2]
[1:2][1:2]
[1:2]
(3 rows)
(3 rows)
QUERY: SELECT *
-- returns nothing
SELECT *
FROM arrtest
FROM arrtest
WHERE a
rrtest.a[1] < 5 and
WHERE a
[1] < 5 and
arrtest.
c = '{"foobar"}'::_name;
c = '{"foobar"}'::_name;
a|b|c|d|e|f|g
a | b | c | d | e | f | g
-
+-+-+-+-+-+
-
-
--+---+---+---+---+---+--
-
(0 rows)
(0 rows)
QUERY: SELECT arrtest.a[1:3],
UPDATE arrtest
arrtest.b[1:1][1:2][1:2],
SET a[1:2] = '{16,25}',
arrtest.c[1:2],
b[1:1][1:1][1:2] = '{113, 117}',
arrtest.d[1:1][1:2]
c[1:1] = '{"new_word"}';
SELECT a[1:3],
b[1:1][1:2][1:2],
c[1:2],
d[1:1][2:2]
FROM arrtest;
FROM arrtest;
a |b |c |d
a | b | c | d
----------
+---------------+-------------+-----
------------
----------
--+---------------------+--------------------+
------------
{1,2,3} |{{{0,0},{1,2}}}| |
{16,25,3} | {{{113,117},{1,2}}} | |
{11,12,23}| | |{{"elt1",
"elt2"}}
{16,25,23} | | | {{
"elt2"}}
| |{"foo","bar"}|
| | {"new_word","bar"} |
(3 rows)
(3 rows)
src/test/regress/sql/arrays.sql
View file @
6ce5e0ab
...
@@ -10,14 +10,14 @@ SELECT arrtest.a[1],
...
@@ -10,14 +10,14 @@ SELECT arrtest.a[1],
arrtest
.
d
[
1
][
1
],
arrtest
.
d
[
1
][
1
],
arrtest
.
e
[
0
]
arrtest
.
e
[
0
]
FROM
arrtest
;
FROM
arrtest
;
-- ??? what about
--
SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
SELECT
a
[
1
],
b
[
1
][
1
][
1
],
c
[
1
],
d
[
1
][
1
],
e
[
0
]
--
FROM arrtest;
FROM
arrtest
;
SELECT
a
rrtest
.
a
[
1
:
3
],
SELECT
a
[
1
:
3
],
arrtest
.
b
[
1
:
1
][
1
:
2
][
1
:
2
],
b
[
1
:
1
][
1
:
2
][
1
:
2
],
arrtest
.
c
[
1
:
2
],
c
[
1
:
2
],
arrtest
.
d
[
1
:
1
][
1
:
2
]
d
[
1
:
1
][
1
:
2
]
FROM
arrtest
;
FROM
arrtest
;
-- returns three different results--
-- returns three different results--
...
@@ -26,18 +26,16 @@ SELECT array_dims(arrtest.b) AS x;
...
@@ -26,18 +26,16 @@ SELECT array_dims(arrtest.b) AS x;
-- returns nothing
-- returns nothing
SELECT
*
SELECT
*
FROM
arrtest
FROM
arrtest
WHERE
a
rrtest
.
a
[
1
]
<
5
and
WHERE
a
[
1
]
<
5
and
arrtest
.
c
=
'{"foobar"}'
::
_name
;
c
=
'{"foobar"}'
::
_name
;
-- updating array subranges seems to be broken
UPDATE
arrtest
--
SET
a
[
1
:
2
]
=
'{16,25}'
,
-- UPDATE arrtest
b
[
1
:
1
][
1
:
1
][
1
:
2
]
=
'{113, 117}'
,
-- SET a[1:2] = '{16,25}',
c
[
1
:
1
]
=
'{"new_word"}'
;
-- b[1:1][1:1][1:2] = '{113, 117}',
-- c[1:1] = '{"new_word"}';
SELECT
a
[
1
:
3
],
b
[
1
:
1
][
1
:
2
][
1
:
2
],
SELECT
arrtest
.
a
[
1
:
3
],
c
[
1
:
2
],
arrtest
.
b
[
1
:
1
][
1
:
2
][
1
:
2
],
d
[
1
:
1
][
2
:
2
]
arrtest
.
c
[
1
:
2
],
arrtest
.
d
[
1
:
1
][
1
:
2
]
FROM
arrtest
;
FROM
arrtest
;
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