Skip to content

Commit 270503c

Browse files
authored
fix(endtoend): Ensure all SQL works against PostgreSQL (#2684)
* test(endtoend): Fix issues with PostgreSQL tests * Manually regenerate because the regen script is broken * Fix build issues
1 parent 8a7a02c commit 270503c

File tree

68 files changed

+229
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+229
-89
lines changed

internal/endtoend/testdata/citext/pgx/query.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CREATE EXTENSION IF NOT EXISTS citext;
2+
13
CREATE TABLE foo (
24
bar citext,
35
bat citext not null
@@ -6,4 +8,3 @@ CREATE TABLE foo (
68
-- name: GetCitexts :many
79
SELECT bar, bat
810
FROM foo;
9-

internal/endtoend/testdata/citext/stdlib/query.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CREATE EXTENSION IF NOT EXISTS citext;
2+
13
CREATE TABLE foo (
24
bar citext,
35
bat citext not null
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CREATE TABLE foo (bar TEXT);
2-
ALTER TABLE foo ALTER bar TYPE TEXT ARRAY;
2+
ALTER TABLE foo ALTER bar TYPE TEXT ARRAY USING bar::text[];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CREATE TABLE foo (bar TEXT);
2-
ALTER TABLE foo ALTER bar TYPE TEXT ARRAY;
2+
ALTER TABLE foo ALTER bar TYPE TEXT ARRAY USING bar::text[];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CREATE TABLE foo (bar TEXT);
2-
ALTER TABLE foo ALTER bar TYPE TEXT ARRAY;
2+
ALTER TABLE foo ALTER bar TYPE TEXT ARRAY USING bar::text[];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CREATE TABLE venues (id SERIAL PRIMARY KEY);
2-
ALTER TABLE venues DROP CONSTRAINT venues_id_pkey;
2+
ALTER TABLE venues DROP CONSTRAINT venues_pkey;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CREATE TABLE venues (id SERIAL PRIMARY KEY);
2-
ALTER TABLE venues DROP CONSTRAINT venues_id_pkey;
2+
ALTER TABLE venues DROP CONSTRAINT venues_pkey;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CREATE TABLE venues (id SERIAL PRIMARY KEY);
2-
ALTER TABLE venues DROP CONSTRAINT venues_id_pkey;
2+
ALTER TABLE venues DROP CONSTRAINT venues_pkey;

internal/endtoend/testdata/ddl_alter_table_index/postgresql/pgx/v4/go/models.go

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
CREATE TABLE temp(a TEXT);
1+
CREATE TABLE measurement (
2+
city_id int not null,
3+
logdate date not null,
4+
peaktemp int,
5+
unitsales int
6+
) PARTITION BY RANGE (logdate);
27

3-
CREATE INDEX temp_idx ON temp(a);
4-
ALTER INDEX temp_idx ATTACH PARTITION temp_partition_idx;
8+
CREATE TABLE measurement_y2006m02 PARTITION OF measurement
9+
FOR VALUES FROM ('2006-02-01') TO ('2006-03-01');
10+
11+
CREATE INDEX measurement_usls_idx ON ONLY measurement (unitsales);
12+
13+
CREATE INDEX measurement_usls_200602_idx
14+
ON measurement_y2006m02 (unitsales);
15+
16+
ALTER INDEX measurement_usls_idx
17+
ATTACH PARTITION measurement_usls_200602_idx;

0 commit comments

Comments
 (0)