sql-formatter
sql-formatter copied to clipboard
[FORMATTING] postgresql timestamp datatype on create table adds unnecessary newline
Input data Which SQL and options did you provide as input?
create table test (
a int,
b int,
c TIMESTAMP with time zone,
d int
);
Expected Output
CREATE TABLE test (
a INT,
b INT,
c TIMESTAMP WITH TIME ZONE,
d INT
);
Actual Output
CREATE TABLE test (
a INT,
b INT,
c TIMESTAMP
WITH TIME ZONE,
d INT
);
Usage
- How are you calling / using the library? By coc-sql
- What SQL language(s) does this apply to? postgresql
- Which SQL Formatter version are you using? latest with coc-sql
The with keyword causes the issue. Trying with timestamp without time zone looks fine.
This is similar to #340
- The formatter shouldn't attempt to detect a
WITH-clause inside aCREATE TABLEstatement. - Like in #340 the formatter shouldn't detect
UPDATEstatement inside aSELECT.
No quick fix available for it, but we're moving towards a better architecture to solve this.
Found a simpler way of fixing this. Released in 10.2.0.