Breaks query when CTE is present
Open
Nobody has claimed this yet.
- Dominant language
- PLpgSQL
- Stars
- 2k
- Forks
- 121
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 7
Description
Input query:
some_cte as (select a from test_table)
select
my_fn ((select * from some_cte1))
from
test_table;
Expected output query:
some_cte as (
select
a
from
test_table
)
select
my_fn ((
select
*
from some_cte1))
from
test_table;
Actual output query:
some_cte as (
select
a
from
test_table
)
select
my_fn (
select
*
from some_cte1)
from
test_table;
Removing one pair of round brackets breaks the query.
pgformatter version: 5.3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported input query with pgFormatter 5.3 and compare it with the expected and actual output shown here. Trace the formatting path for nested SELECT expressions when a CTE is present; done means the inner parentheses are preserved and the formatted query remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sql
- Domain
- databases, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100