sql parser improved pg support, fix #4128

This commit is contained in:
高铁
2021-01-12 22:32:04 +08:00
parent 0d5f54baaa
commit 3197ae8db9
11 changed files with 78 additions and 0 deletions
@@ -52,6 +52,18 @@ public class PostgresqlResourceTest extends PGTest {
exec_test("bvt/parser/postgresql-3.txt");
}
public void test_4() throws Exception {
exec_test("bvt/parser/postgresql-4.txt");
}
public void test_5() throws Exception {
exec_test("bvt/parser/postgresql-5.txt");
}
public void test_6() throws Exception {
exec_test("bvt/parser/postgresql-6.txt");
}
public void exec_test(String resource) throws Exception {
System.out.println(resource);
InputStream is = null;
+4
View File
@@ -0,0 +1,4 @@
ALTER TABLE tb_a ADD COLUMNS ( a bigint );
---------------------------
ALTER TABLE tb_a
ADD COLUMNS (a bigint);
+4
View File
@@ -0,0 +1,4 @@
INSERT INTO tb_a VALUES ( 1 );
---------------------------
INSERT INTO TABLE tb_a
VALUES (1);
@@ -0,0 +1,20 @@
SET data = jsonb_set(
data,
ARRAY[(
SELECT idx - 1 AS idx
FROM cgm_data c1,
jsonb_array_elements(data)
WHERE
info ->> 'index' = ?
and c1.id = ?
)]::TEXT[],
?::jsonb
)
WHERE t1.id = ?;
---------------------------
SET data TO jsonb_set(data, ARRAY[(
SELECT idx - 1 AS idx
FROM cgm_data c1, jsonb_array_elements(data)
WHERE info ->> 'index' = ?
AND c1.id = ?
)]::TEXT[], ?::jsonb), t1, id, id
@@ -0,0 +1,5 @@
select * from com_demo order by sex asc nulls first
---------------------------
SELECT *
FROM com_demo
ORDER BY sex ASC NULLS FIRST
@@ -0,0 +1,5 @@
alter table if exists tcweatherdata
add column predictiontime timestamp
---------------------------
ALTER TABLE IF EXISTS tcweatherdata
ADD COLUMN predictiontime timestamp