Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
9f478b4f
Commit
9f478b4f
authored
8 years ago
by
Andres Freund
Browse files
Options
Downloads
Patches
Plain Diff
Address portability issues in
bfe16d1a
test output.
parent
bfe16d1a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/regress/expected/tsrf.out
+15
-22
15 additions, 22 deletions
src/test/regress/expected/tsrf.out
src/test/regress/sql/tsrf.sql
+4
-4
4 additions, 4 deletions
src/test/regress/sql/tsrf.sql
with
19 additions
and
26 deletions
src/test/regress/expected/tsrf.out
+
15
−
22
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
...
...
This diff is collapsed.
Click to expand it.
src/test/regress/sql/tsrf.sql
+
4
−
4
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment