Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: upgrade postgres parser to be compatible with PG 15 (#14367)

rebelicee14df0c09ffc
diff --git a/backend/plugin/parser/pg/test-data/filter.yaml b/backend/plugin/parser/pg/test-data/filter.yaml
index 222786dbe1..ffd3f801d4 100644
--- a/backend/plugin/parser/pg/test-data/filter.yaml
+++ b/backend/plugin/parser/pg/test-data/filter.yaml
@@ -88,6 +88,9 @@
ALTER TABLE ONLY public.my_table
ADD CONSTRAINT my_table_pkey PRIMARY KEY (id);
+
+ ALTER TABLE ONLY public.l_abc
+ ADD CONSTRAINT unique_lst_id UNIQUE NULLS NOT DISTINCT (lst_id);
output: |-
SET statement_timeout = 0;
SET lock_timeout = 0;
@@ -148,3 +151,6 @@
ALTER TABLE ONLY public.my_table
ADD CONSTRAINT my_table_pkey PRIMARY KEY (id);
+
+ ALTER TABLE ONLY public.l_abc
+ ADD CONSTRAINT unique_lst_id UNIQUE NULLS NOT DISTINCT (lst_id);
diff --git a/go.mod b/go.mod
index 29f41d6923..eb5c3b4b79 100644
--- a/go.mod
+++ b/go.mod
@@ -26,7 +26,7 @@ require (
github.com/bytebase/google-sql-parser v0.0.0-20241030063241-f3a4e61b6aed
github.com/bytebase/mysql-parser v0.0.0-20240810145851-ab2c11629c24
github.com/bytebase/plsql-parser v0.0.0-20240929073008-6b57c2e2525d
- github.com/bytebase/postgresql-parser v0.0.0-20241008085234-a95eacac994a
+ github.com/bytebase/postgresql-parser v0.0.0-20241108072816-e932f744004a
github.com/bytebase/snowsql-parser v0.0.0-20240304100801-bb357ccb5535
github.com/bytebase/tidb-parser v0.0.0-20240821091609-162fffe2a839
github.com/cenkalti/backoff/v4 v4.3.0
diff --git a/go.sum b/go.sum
index 2716afdee0..9294fe95f7 100644
--- a/go.sum
+++ b/go.sum
@@ -831,8 +831,8 @@ github.com/bytebase/pkcs8 v0.0.0-20240612095628-fcd0a7484c94 h1:6PNsuNmSqCuR8Z61
github.com/bytebase/pkcs8 v0.0.0-20240612095628-fcd0a7484c94/go.mod h1:SQliXeA7Dhkt//vS29v3zpbEwoa+zb2Cn5xj5uO4K5U=
github.com/bytebase/plsql-parser v0.0.0-20240929073008-6b57c2e2525d h1:bfJbndIoSgPxUhYqAx0Ggv8D3Ib+YeNEiteGs4+82AU=
github.com/bytebase/plsql-parser v0.0.0-20240929073008-6b57c2e2525d/go.mod h1:sEtLYOfHyi8zz5vo5gKT//A8c4P8FnDZLNVSLtVPxj0=
-github.com/bytebase/postgresql-parser v0.0.0-20241008085234-a95eacac994a h1:afCKpcKKi9PFB8SIFbFt5xEbNVbqYCkGZ/188eXqiGU=
-github.com/bytebase/postgresql-parser v0.0.0-20241008085234-a95eacac994a/go.mod h1:Jft7oabwuwD+t5BYiUfTjcNVaihZ8F5KT8TsROG0EaE=
+github.com/bytebase/postgresql-parser v0.0.0-20241108072816-e932f744004a h1:u7LD9Knqu6zR45XF23KfNA2FhI9YnBwqnPRvTKzxiE0=
+github.com/bytebase/postgresql-parser v0.0.0-20241108072816-e932f744004a/go.mod h1:Jft7oabwuwD+t5BYiUfTjcNVaihZ8F5KT8TsROG0EaE=
github.com/bytebase/snowsql-parser v0.0.0-20240304100801-bb357ccb5535 h1:sgEzM1Y8WUAR8n8fOjVtx62Cz7HuUILtONkPQ8IvFNk=
github.com/bytebase/snowsql-parser v0.0.0-20240304100801-bb357ccb5535/go.mod h1:gJ1aclz1e9xLArQTbCpDjL+A79Jt3Ro9+/QEw8A6vMM=
github.com/bytebase/tidb-parser v0.0.0-20240821091609-162fffe2a839 h1:OLOEfNV20wqC4nPHQllr4mrMhchAhPrgXlKn0URgum8=