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
9f478b4f
Commit
9f478b4f
authored
Sep 12, 2016
by
Andres Freund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address portability issues in
bfe16d1a
test output.
parent
bfe16d1a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
26 deletions
+19
-26
src/test/regress/expected/tsrf.out
src/test/regress/expected/tsrf.out
+15
-22
src/test/regress/sql/tsrf.sql
src/test/regress/sql/tsrf.sql
+4
-4
No files found.
src/test/regress/expected/tsrf.out
View file @
9f478b4f
...
...
@@ -130,39 +130,32 @@ SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few
(2 rows)
-- check HAVING works when GROUP BY does [not] reference SRF output
SELECT dataa, generate_series(1,
3
), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
SELECT dataa, generate_series(1,
1
), count(*) FROM few GROUP BY 1 HAVING count(*) > 1;
dataa | generate_series | count
-------+-----------------+-------
a | 1 | 2
a | 2 | 2
a | 3 | 2
(3 rows)
(1 row)
SELECT dataa, generate_series(1,
3
), count(*) FROM few GROUP BY 1, 2 HAVING count(*) > 1;
SELECT dataa, generate_series(1,
1
), count(*) FROM few GROUP BY 1, 2 HAVING count(*) > 1;
dataa | generate_series | count
-------+-----------------+-------
a | 1 | 2
a | 2 | 2
a | 3 | 2
(3 rows)
(1 row)
-- it's weird to have GROUP BYs that increase the number of results
SELECT few.dataa, count(*), min(id), max(id) FROM few GROUP BY few.dataa;
dataa | count | min | max
-------+-------+-----+-----
b | 1 | 3 | 3
a | 2 | 1 | 2
SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa ORDER BY 2;
dataa | count
-------+-------
a | 2
(1 row)
SELECT few.dataa, count(*) FROM few WHERE dataa = 'a' GROUP BY few.dataa, unnest('{1,1,3}'::int[]) ORDER BY 2;
dataa | count
-------+-------
a | 2
a | 4
(2 rows)
SELECT few.dataa, count(*), min(id), max(id) FROM few GROUP BY few.dataa, unnest('{1,1,3}'::int[]);
dataa | count | min | max
-------+-------+-----+-----
b | 2 | 3 | 3
a | 4 | 1 | 2
b | 1 | 3 | 3
a | 2 | 1 | 2
(4 rows)
-- SRFs are not allowed in aggregate arguments
SELECT min(generate_series(1, 3)) FROM few;
ERROR: set-valued function called in context that cannot accept a set
...
...
src/test/regress/sql/tsrf.sql
View file @
9f478b4f
...
...
@@ -37,12 +37,12 @@ SELECT few.dataa, count(*), min(id), max(id), unnest('{1,1,3}'::int[]) FROM few
SELECT
few
.
dataa
,
count
(
*
),
min
(
id
),
max
(
id
),
unnest
(
'{1,1,3}'
::
int
[])
FROM
few
WHERE
few
.
id
=
1
GROUP
BY
few
.
dataa
,
5
;
-- check HAVING works when GROUP BY does [not] reference SRF output
SELECT
dataa
,
generate_series
(
1
,
3
),
count
(
*
)
FROM
few
GROUP
BY
1
HAVING
count
(
*
)
>
1
;
SELECT
dataa
,
generate_series
(
1
,
3
),
count
(
*
)
FROM
few
GROUP
BY
1
,
2
HAVING
count
(
*
)
>
1
;
SELECT
dataa
,
generate_series
(
1
,
1
),
count
(
*
)
FROM
few
GROUP
BY
1
HAVING
count
(
*
)
>
1
;
SELECT
dataa
,
generate_series
(
1
,
1
),
count
(
*
)
FROM
few
GROUP
BY
1
,
2
HAVING
count
(
*
)
>
1
;
-- it's weird to have GROUP BYs that increase the number of results
SELECT
few
.
dataa
,
count
(
*
)
,
min
(
id
),
max
(
id
)
FROM
few
GROUP
BY
few
.
dataa
;
SELECT
few
.
dataa
,
count
(
*
)
,
min
(
id
),
max
(
id
)
FROM
few
GROUP
BY
few
.
dataa
,
unnest
(
'{1,1,3}'
::
int
[])
;
SELECT
few
.
dataa
,
count
(
*
)
FROM
few
WHERE
dataa
=
'a'
GROUP
BY
few
.
dataa
ORDER
BY
2
;
SELECT
few
.
dataa
,
count
(
*
)
FROM
few
WHERE
dataa
=
'a'
GROUP
BY
few
.
dataa
,
unnest
(
'{1,1,3}'
::
int
[])
ORDER
BY
2
;
-- SRFs are not allowed in aggregate arguments
SELECT
min
(
generate_series
(
1
,
3
))
FROM
few
;
...
...
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