Noticed that there's a space missing between a create table statement and its partition by clause. This was not an issue before because postgres considers the word after a closing paren to be a new token, even if there's no space. This fix is purely stylistic
CREATE TABLE(...)PARTITION BY ... -> CREATE TABLE(...) PARTITION BY ...
^
|
Motivation
Saw this while generating a plan
Testing
Added a plan unit test covering a raw table create with partition.
Before:
alexaub in ~/stripe/pg-schema-diff on alexaub/partition-whitespace ● λ pg-schema-diff plan --dsn "postgres://alexaub@localhost:5432/postgres" --schema-dir schema
################################ Generated plan ################################
1. CREATE TABLE "foobar" (
"id" integer,
"foo" character varying(255) COLLATE "pg_catalog"."default"
)PARTITION BY LIST (foo);
-- Timeout: 3s
After:
alexaub in ~/stripe/pg-schema-diff on alexaub/partition-whitespace ● λ go run ./cmd/pg-schema-diff plan --dsn "postgres://alexaub@localhost:5432/postgres" --schema-dir schema
################################ Generated plan ################################
1. CREATE TABLE "foobar" (
"id" integer,
"foo" character varying(255) COLLATE "pg_catalog"."default"
) PARTITION BY LIST (foo);
-- Timeout: 3s
Description
Noticed that there's a space missing between a create table statement and its partition by clause. This was not an issue before because postgres considers the word after a closing paren to be a new token, even if there's no space. This fix is purely stylistic
Motivation
Saw this while generating a plan
Testing
Added a plan unit test covering a raw table create with partition.
Before:
After: