Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect indentation in PostgreSQL DELETE FROM ... USING #683

Open
karlhorky opened this issue Dec 4, 2023 · 1 comment
Open

Incorrect indentation in PostgreSQL DELETE FROM ... USING #683

karlhorky opened this issue Dec 4, 2023 · 1 comment
Labels

Comments

@karlhorky
Copy link
Contributor

karlhorky commented Dec 4, 2023

Describe the Feature

More consistent formatting for multiple joined tables after the USING keyword in a DELETE FROM ... USING query (consistent compared to SELECT ... FROM ... JOIN:

Input data

Which SQL and options did you provide as input?

DELETE FROM films
USING
  producers,
  sessions
WHERE sessions.id = '123' AND producer_id = producers.id AND producers.name = 'foo';

Expected Output

DELETE FROM
  films
  USING
    producers,
    sessions
WHERE
  sessions.id = '123'
  AND producer_id = producers.id
  AND producers.name = 'foo';

Actual Output

DELETE FROM films USING producers,
sessions
WHERE
  sessions.id = '123'
  AND producer_id = producers.id
  AND producers.name = 'foo';

Why do you want this feature?

To be more consistent with the SELECT ... FROM ... JOIN formatting:

SELECT
  *
FROM
  candidates
  INNER JOIN sessions ON users.session_id = sessions.id
@nene
Copy link
Collaborator

nene commented Dec 6, 2023

I see this more as a bug report than a feature request.

Unfortunately I have no real ideas for fixing this. It's again one of those bugs that demonstrates the current technical limitations of the formatter.

At least this bug doesn't break the SQL.

@nene nene changed the title Feature Request: Improved formatting for PostgreSQL DELETE FROM ... USING Incorrect indentation in PostgreSQL DELETE FROM ... USING Dec 7, 2023
@nene nene added bug and removed feature labels Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants