You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT-- 1
FORMAT($$%s %I %L$$, 'hello', 'i''m', 'a string') AS formatted_string,
-- 2public.uuid_generate_v4() AS a_uuid,
-- 3
a_table.*FROM (VALUES ('hello'), ('there')) AS a_table (a_column)
and the output will be:
SELECT-- 1
FORMAT($$ % s % I % L$$, 'hello', 'i''m', 'a string') AS formatted_string,
-- 2
PUBLIC .uuid_generate_v4() AS a_uuid,
-- 3
a_table. *FROM (
VALUES ('hello'),
('there')
) AS a_table (a_column)
Expected behaviour
SELECT-- 1
FORMAT($$ %s %I %L$$, 'hello', 'i''m', 'a string') AS formatted_string,
-- 2public.uuid_generate_v4() AS a_uuid,
-- 3
a_table.*FROM (
VALUES ('hello'),
('there')
) AS a_table (a_column)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
SQLTools Version: v0.28.0
VS Code Version: 1.81.1
OS: Mac
Driver:
PostgreSQL/Redshift
MySQL/MariaDB
MSSQL/Azure
SQLite
Other? Which...
Database version: PostgreSQL v14
The text was updated successfully, but these errors were encountered:
bowdi
changed the title
Formatting issues with postgres: format(...) + public.*
Formatting issues with postgres: format(...), public.* + table_name.*
Aug 23, 2023
Am I correct in guessing that you have set the language property of the sqltools.format settings object to "pl/sql"? I can reproduce your example with that setting but not when that property isn't defined.
Describe the bug
When formatting sql files for postgres I've noticed some bugs that cause failures.
format(...)
function and dollar quoted strings, format specifiers are separated by a space.SELECT table_name.*
syntax for all columns from a specific table it get's seperated by a space.To Reproduce
Format the following:
and the output will be:
Expected behaviour
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: