pgschema
pgschema copied to clipboard
Issue with camelcase column names
Hello,
I have a problem with column names in camelcase. As recommended in issue https://github.com/pgplex/pgschema/issues/14, I have created a JSON-plan.
The plan escapes correctly in nearby every case, except one step that doesn't escape the column name (last one in the code snippet). Therefore an apply will fail because of an invalid name.
{
"sql": "ALTER TABLE \"hpd_eventPlanning\".\"Planning\" ADD CONSTRAINT \"offersValidUntil_not_null\" CHECK (offersValidUntil IS NOT NULL) NOT VALID;",
"type": "table.column",
"operation": "alter",
"path": "hpd_eventPlanning.Planning.offersValidUntil"
},
{
"sql": "ALTER TABLE \"hpd_eventPlanning\".\"Planning\" VALIDATE CONSTRAINT \"offersValidUntil_not_null\";",
"type": "table.column",
"operation": "alter",
"path": "hpd_eventPlanning.Planning.offersValidUntil"
},
{
"sql": "ALTER TABLE \"hpd_eventPlanning\".\"Planning\" ALTER COLUMN offersValidUntil SET NOT NULL;",
"type": "table.column",
"operation": "alter",
"path": "hpd_eventPlanning.Planning.offersValidUntil"
},
I'm using the latest release of pgschema.
Thanks in advance
Found another occurence of an unescaped colum name (with the CHECK):
{
"sql": "ALTER TABLE \"hpd_eventPlanning\".\"Planning\" ADD CONSTRAINT \"offersValidUntil_not_null\" CHECK (offersValidUntil IS NOT NULL) NOT VALID;",
"type": "table.column",
"operation": "alter",
"path": "hpd_eventPlanning.Planning.offersValidUntil"
},
Thanks a lot 👍