aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMars Agliullin <marsaly@ydb.tech>2024-01-22 13:26:27 +0300
committerGitHub <noreply@github.com>2024-01-22 13:26:27 +0300
commite89c288bda990cd0b60477155cd8c622c1266f9a (patch)
tree0b104182b965c7eb670f11bc8596a7c525f9cbc4
parent840d99709317564fd8f49df4be69b6fac9af99fa (diff)
downloadydb-e89c288bda990cd0b60477155cd8c622c1266f9a.tar.gz
YQL-17567: Added patches to workaround unsupported INSERT without column list & updated passing regression tests (#1185)
-rw-r--r--ydb/library/yql/tests/postgresql/cases/boolean.err2
-rw-r--r--ydb/library/yql/tests/postgresql/cases/boolean.out38
-rw-r--r--ydb/library/yql/tests/postgresql/cases/boolean.sql8
-rw-r--r--ydb/library/yql/tests/postgresql/cases/int8.err30
-rw-r--r--ydb/library/yql/tests/postgresql/cases/int8.out591
-rw-r--r--ydb/library/yql/tests/postgresql/cases/int8.sql92
-rw-r--r--ydb/library/yql/tests/postgresql/cases/text.err4
-rw-r--r--ydb/library/yql/tests/postgresql/cases/text.out11
-rw-r--r--ydb/library/yql/tests/postgresql/cases/text.sql5
-rw-r--r--ydb/library/yql/tests/postgresql/patches/boolean.out.patch11
-rw-r--r--ydb/library/yql/tests/postgresql/patches/boolean.sql.patch11
-rw-r--r--ydb/library/yql/tests/postgresql/patches/int8.out.patch19
-rw-r--r--ydb/library/yql/tests/postgresql/patches/int8.sql.patch19
-rw-r--r--ydb/library/yql/tests/postgresql/patches/text.out.patch13
-rw-r--r--ydb/library/yql/tests/postgresql/patches/text.sql.patch13
-rw-r--r--ydb/library/yql/tests/postgresql/pg_tests.csv6
-rw-r--r--ydb/library/yql/tests/postgresql/status.md14
17 files changed, 852 insertions, 35 deletions
diff --git a/ydb/library/yql/tests/postgresql/cases/boolean.err b/ydb/library/yql/tests/postgresql/cases/boolean.err
index 08d82b2a78..f7581ce490 100644
--- a/ydb/library/yql/tests/postgresql/cases/boolean.err
+++ b/ydb/library/yql/tests/postgresql/cases/boolean.err
@@ -486,7 +486,7 @@ FROM booltbl3 ORDER BY o;
CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
</sql-statement>
<sql-statement>
-INSERT INTO booltbl4 VALUES (false, true, null);
+INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
</sql-statement>
<sql-statement>
\pset null '(null)'
diff --git a/ydb/library/yql/tests/postgresql/cases/boolean.out b/ydb/library/yql/tests/postgresql/cases/boolean.out
index 81a6fd9696..7968cce333 100644
--- a/ydb/library/yql/tests/postgresql/cases/boolean.out
+++ b/ydb/library/yql/tests/postgresql/cases/boolean.out
@@ -303,7 +303,7 @@ INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
-- correct. Use a table as source to prevent constant simplification
-- to interfer.
CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
-INSERT INTO booltbl4 VALUES (false, true, null);
+INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
\pset null '(null)'
-- AND expression need to return null if there's any nulls and not all
-- of the value are true
@@ -325,6 +325,24 @@ SELECT isnul AND istrue AND istrue FROM booltbl4;
(null)
(1 row)
+SELECT isfalse AND isnul AND istrue FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT istrue AND isfalse AND isnul FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
+SELECT isnul AND istrue AND isfalse FROM booltbl4;
+ ?column?
+----------
+ f
+(1 row)
+
-- OR expression need to return null if there's any nulls and none
-- of the value is true
SELECT isfalse OR isnul OR isfalse FROM booltbl4;
@@ -345,6 +363,24 @@ SELECT isnul OR isfalse OR isfalse FROM booltbl4;
(null)
(1 row)
+SELECT isfalse OR isnul OR istrue FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT istrue OR isfalse OR isnul FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
+SELECT isnul OR istrue OR isfalse FROM booltbl4;
+ ?column?
+----------
+ t
+(1 row)
+
--
-- Clean up
-- Many tables are retained by the regression test, but these do not seem
diff --git a/ydb/library/yql/tests/postgresql/cases/boolean.sql b/ydb/library/yql/tests/postgresql/cases/boolean.sql
index 705e5a5c31..1bf491488b 100644
--- a/ydb/library/yql/tests/postgresql/cases/boolean.sql
+++ b/ydb/library/yql/tests/postgresql/cases/boolean.sql
@@ -90,18 +90,24 @@ INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
-- correct. Use a table as source to prevent constant simplification
-- to interfer.
CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
-INSERT INTO booltbl4 VALUES (false, true, null);
+INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
\pset null '(null)'
-- AND expression need to return null if there's any nulls and not all
-- of the value are true
SELECT istrue AND isnul AND istrue FROM booltbl4;
SELECT istrue AND istrue AND isnul FROM booltbl4;
SELECT isnul AND istrue AND istrue FROM booltbl4;
+SELECT isfalse AND isnul AND istrue FROM booltbl4;
+SELECT istrue AND isfalse AND isnul FROM booltbl4;
+SELECT isnul AND istrue AND isfalse FROM booltbl4;
-- OR expression need to return null if there's any nulls and none
-- of the value is true
SELECT isfalse OR isnul OR isfalse FROM booltbl4;
SELECT isfalse OR isfalse OR isnul FROM booltbl4;
SELECT isnul OR isfalse OR isfalse FROM booltbl4;
+SELECT isfalse OR isnul OR istrue FROM booltbl4;
+SELECT istrue OR isfalse OR isnul FROM booltbl4;
+SELECT isnul OR istrue OR isfalse FROM booltbl4;
--
-- Clean up
-- Many tables are retained by the regression test, but these do not seem
diff --git a/ydb/library/yql/tests/postgresql/cases/int8.err b/ydb/library/yql/tests/postgresql/cases/int8.err
index 82decd997c..a05a97aeee 100644
--- a/ydb/library/yql/tests/postgresql/cases/int8.err
+++ b/ydb/library/yql/tests/postgresql/cases/int8.err
@@ -6,19 +6,19 @@
CREATE TABLE INT8_TBL(q1 int8, q2 int8);
</sql-statement>
<sql-statement>
-INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+INSERT INTO INT8_TBL (q1, q2) VALUES(' 123 ',' 456');
</sql-statement>
<sql-statement>
-INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES('123 ','4567890123456789');
</sql-statement>
<sql-statement>
-INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+INSERT INTO INT8_TBL (q1, q2) VALUES('4567890123456789','123');
</sql-statement>
<sql-statement>
-INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES(+4567890123456789,'4567890123456789');
</sql-statement>
<sql-statement>
-INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES('+4567890123456789','-4567890123456789');
</sql-statement>
<sql-statement>
-- bad inputs
@@ -215,6 +215,15 @@ SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
<sql-statement>
SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: bigint out of range
+
+ SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+ ^
<sql-statement>
SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
@@ -684,6 +693,15 @@ SELECT CAST('922337203685477580700.0'::float8 AS int8);
<sql-statement>
SELECT CAST(q1 AS oid) FROM INT8_TBL;
</sql-statement>
+-stdin-:<main>: Fatal: Execution
+
+ -stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
+ SELECT CAST(q1 AS oid) FROM INT8_TBL;
+ ^
+ -stdin-:<main>:1:1: Fatal: ERROR: OID out of range
+
+ SELECT CAST(q1 AS oid) FROM INT8_TBL;
+ ^
<sql-statement>
SELECT oid::int8 FROM pg_class WHERE relname = 'pg_class';
</sql-statement>
@@ -717,6 +735,6 @@ SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::in
<sql-statement>
SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 2);
</sql-statement>
-pgrun: /-S/ydbwork/ydb/contrib/libs/llvm12/lib/IR/LegacyPassManager.cpp:588: void llvm::PMTopLevelManager::setLastUser(ArrayRef<Pass *>, Pass *): Assertion `AnalysisPass && "Expected analysis pass to exist."' failed.
+pgrun: /-S/ydbwork/ydb/ydb/contrib/libs/llvm12/lib/IR/LegacyPassManager.cpp:588: void llvm::PMTopLevelManager::setLastUser(ArrayRef<Pass *>, Pass *): Assertion `AnalysisPass && "Expected analysis pass to exist."' failed.
pthread_kill at ./nptl/./nptl/pthread_kill.c:43:17
?? at ??:0:0
diff --git a/ydb/library/yql/tests/postgresql/cases/int8.out b/ydb/library/yql/tests/postgresql/cases/int8.out
index e956be1b06..ed3019fa2e 100644
--- a/ydb/library/yql/tests/postgresql/cases/int8.out
+++ b/ydb/library/yql/tests/postgresql/cases/int8.out
@@ -3,11 +3,11 @@
-- Test int8 64-bit integers.
--
CREATE TABLE INT8_TBL(q1 int8, q2 int8);
-INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
-INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
-INSERT INTO INT8_TBL VALUES('4567890123456789','123');
-INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
-INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES(' 123 ',' 456');
+INSERT INTO INT8_TBL (q1, q2) VALUES('123 ','4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES('4567890123456789','123');
+INSERT INTO INT8_TBL (q1, q2) VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES('+4567890123456789','-4567890123456789');
-- bad inputs
INSERT INTO INT8_TBL(q1) VALUES (' ');
ERROR: invalid input syntax for type bigint: " "
@@ -37,21 +37,579 @@ INSERT INTO INT8_TBL(q1) VALUES ('');
ERROR: invalid input syntax for type bigint: ""
LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('');
^
+SELECT * FROM INT8_TBL;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+-- int8/int8 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789;
q1 | q2
----+----
(0 rows)
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+-- int8/int4 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 456;
+ q1 | q2
+-----+-----
+ 123 | 456
+(1 row)
+
+SELECT * FROM INT8_TBL WHERE q2 <> 456;
+ q1 | q2
+------------------+-------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(4 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < 456;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > 456;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= 456;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= 456;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(3 rows)
+
+-- int4/int8 cmp
+SELECT * FROM INT8_TBL WHERE 123 = q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 <> q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 < q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
SELECT * FROM INT8_TBL WHERE 123 > q1;
q1 | q2
----+----
(0 rows)
+SELECT * FROM INT8_TBL WHERE 123 <= q1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE 123 >= q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+-- int8/int2 cmp
+SELECT * FROM INT8_TBL WHERE q2 = '456'::int2;
+ q1 | q2
+-----+-----
+ 123 | 456
+(1 row)
+
+SELECT * FROM INT8_TBL WHERE q2 <> '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(4 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 < '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 > '456'::int2;
+ q1 | q2
+------------------+------------------
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 <= '456'::int2;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 4567890123456789 | 123
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE q2 >= '456'::int2;
+ q1 | q2
+------------------+------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 4567890123456789
+(3 rows)
+
+-- int2/int8 cmp
+SELECT * FROM INT8_TBL WHERE '123'::int2 = q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 <> q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 < q1;
+ q1 | q2
+------------------+-------------------
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(3 rows)
+
SELECT * FROM INT8_TBL WHERE '123'::int2 > q1;
q1 | q2
----+----
(0 rows)
+SELECT * FROM INT8_TBL WHERE '123'::int2 <= q1;
+ q1 | q2
+------------------+-------------------
+ 123 | 456
+ 123 | 4567890123456789
+ 4567890123456789 | 123
+ 4567890123456789 | 4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT * FROM INT8_TBL WHERE '123'::int2 >= q1;
+ q1 | q2
+-----+------------------
+ 123 | 456
+ 123 | 4567890123456789
+(2 rows)
+
+SELECT q1 AS plus, -q1 AS minus FROM INT8_TBL;
+ plus | minus
+------------------+-------------------
+ 123 | -123
+ 123 | -123
+ 4567890123456789 | -4567890123456789
+ 4567890123456789 | -4567890123456789
+ 4567890123456789 | -4567890123456789
+(5 rows)
+
+SELECT q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+ q1 | q2 | plus
+------------------+-------------------+------------------
+ 123 | 456 | 579
+ 123 | 4567890123456789 | 4567890123456912
+ 4567890123456789 | 123 | 4567890123456912
+ 4567890123456789 | 4567890123456789 | 9135780246913578
+ 4567890123456789 | -4567890123456789 | 0
+(5 rows)
+
+SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+ q1 | q2 | minus
+------------------+-------------------+-------------------
+ 123 | 456 | -333
+ 123 | 4567890123456789 | -4567890123456666
+ 4567890123456789 | 123 | 4567890123456666
+ 4567890123456789 | 4567890123456789 | 0
+ 4567890123456789 | -4567890123456789 | 9135780246913578
+(5 rows)
+
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+ERROR: bigint out of range
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+ q1 | q2 | multiply
+------------------+------------------+--------------------
+ 123 | 456 | 56088
+ 123 | 4567890123456789 | 561850485185185047
+ 4567890123456789 | 123 | 561850485185185047
+(3 rows)
+
+SELECT q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL;
+ q1 | q2 | divide | mod
+------------------+-------------------+----------------+-----
+ 123 | 456 | 0 | 123
+ 123 | 4567890123456789 | 0 | 123
+ 4567890123456789 | 123 | 37137318076884 | 57
+ 4567890123456789 | 4567890123456789 | 1 | 0
+ 4567890123456789 | -4567890123456789 | -1 | 0
+(5 rows)
+
+SELECT 37 + q1 AS plus4 FROM INT8_TBL;
+ plus4
+------------------
+ 160
+ 160
+ 4567890123456826
+ 4567890123456826
+ 4567890123456826
+(5 rows)
+
+SELECT 37 - q1 AS minus4 FROM INT8_TBL;
+ minus4
+-------------------
+ -86
+ -86
+ -4567890123456752
+ -4567890123456752
+ -4567890123456752
+(5 rows)
+
+SELECT 2 * q1 AS "twice int4" FROM INT8_TBL;
+ twice int4
+------------------
+ 246
+ 246
+ 9135780246913578
+ 9135780246913578
+ 9135780246913578
+(5 rows)
+
+SELECT q1 * 2 AS "twice int4" FROM INT8_TBL;
+ twice int4
+------------------
+ 246
+ 246
+ 9135780246913578
+ 9135780246913578
+ 9135780246913578
+(5 rows)
+
+-- int8 op int4
+SELECT q1 + 42::int4 AS "8plus4", q1 - 42::int4 AS "8minus4", q1 * 42::int4 AS "8mul4", q1 / 42::int4 AS "8div4" FROM INT8_TBL;
+ 8plus4 | 8minus4 | 8mul4 | 8div4
+------------------+------------------+--------------------+-----------------
+ 165 | 81 | 5166 | 2
+ 165 | 81 | 5166 | 2
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+(5 rows)
+
+-- int4 op int8
+SELECT 246::int4 + q1 AS "4plus8", 246::int4 - q1 AS "4minus8", 246::int4 * q1 AS "4mul8", 246::int4 / q1 AS "4div8" FROM INT8_TBL;
+ 4plus8 | 4minus8 | 4mul8 | 4div8
+------------------+-------------------+---------------------+-------
+ 369 | 123 | 30258 | 2
+ 369 | 123 | 30258 | 2
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+(5 rows)
+
+-- int8 op int2
+SELECT q1 + 42::int2 AS "8plus2", q1 - 42::int2 AS "8minus2", q1 * 42::int2 AS "8mul2", q1 / 42::int2 AS "8div2" FROM INT8_TBL;
+ 8plus2 | 8minus2 | 8mul2 | 8div2
+------------------+------------------+--------------------+-----------------
+ 165 | 81 | 5166 | 2
+ 165 | 81 | 5166 | 2
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+ 4567890123456831 | 4567890123456747 | 191851385185185138 | 108759288653733
+(5 rows)
+
+-- int2 op int8
+SELECT 246::int2 + q1 AS "2plus8", 246::int2 - q1 AS "2minus8", 246::int2 * q1 AS "2mul8", 246::int2 / q1 AS "2div8" FROM INT8_TBL;
+ 2plus8 | 2minus8 | 2mul8 | 2div8
+------------------+-------------------+---------------------+-------
+ 369 | 123 | 30258 | 2
+ 369 | 123 | 30258 | 2
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+ 4567890123457035 | -4567890123456543 | 1123700970370370094 | 0
+(5 rows)
+
+SELECT q2, abs(q2) FROM INT8_TBL;
+ q2 | abs
+-------------------+------------------
+ 456 | 456
+ 4567890123456789 | 4567890123456789
+ 123 | 123
+ 4567890123456789 | 4567890123456789
+ -4567890123456789 | 4567890123456789
+(5 rows)
+
+SELECT min(q1), min(q2) FROM INT8_TBL;
+ min | min
+-----+-------------------
+ 123 | -4567890123456789
+(1 row)
+
+SELECT max(q1), max(q2) FROM INT8_TBL;
+ max | max
+------------------+------------------
+ 4567890123456789 | 4567890123456789
+(1 row)
+
+-- TO_CHAR()
+--
+SELECT to_char(q1, '9G999G999G999G999G999'), to_char(q2, '9,999,999,999,999,999')
+ FROM INT8_TBL;
+ to_char | to_char
+------------------------+------------------------
+ 123 | 456
+ 123 | 4,567,890,123,456,789
+ 4,567,890,123,456,789 | 123
+ 4,567,890,123,456,789 | 4,567,890,123,456,789
+ 4,567,890,123,456,789 | -4,567,890,123,456,789
+(5 rows)
+
+SELECT to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
+ FROM INT8_TBL;
+ to_char | to_char
+--------------------------------+--------------------------------
+ 123.000,000 | 456.000,000
+ 123.000,000 | 4,567,890,123,456,789.000,000
+ 4,567,890,123,456,789.000,000 | 123.000,000
+ 4,567,890,123,456,789.000,000 | 4,567,890,123,456,789.000,000
+ 4,567,890,123,456,789.000,000 | -4,567,890,123,456,789.000,000
+(5 rows)
+
+SELECT to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+ FROM INT8_TBL;
+ to_char | to_char
+--------------------+------------------------
+ <123> | <456.000>
+ <123> | <4567890123456789.000>
+ <4567890123456789> | <123.000>
+ <4567890123456789> | <4567890123456789.000>
+ <4567890123456789> | 4567890123456789.000
+(5 rows)
+
+SELECT to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+ FROM INT8_TBL;
+ to_char | to_char
+-------------------+-------------------
+ 123- | -456
+ 123- | -4567890123456789
+ 4567890123456789- | -123
+ 4567890123456789- | -4567890123456789
+ 4567890123456789- | +4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 456
+ 4567890123456789
+ 123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ +456
+ +4567890123456789
+ +123
+ +4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
+ to_char
+--------------------
+ 456TH
+ 4567890123456789TH
+ 123RD
+ 4567890123456789TH
+ <4567890123456789>
+(5 rows)
+
+SELECT to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
+ to_char
+---------------------
+ + 456th
+ +4567890123456789th
+ + 123rd
+ +4567890123456789th
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, '0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 0000000000000456
+ 4567890123456789
+ 0000000000000123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'S0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ +0000000000000456
+ +4567890123456789
+ +0000000000000123
+ +4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ 0000000000000456
+ 4567890123456789
+ 0000000000000123
+ 4567890123456789
+ -4567890123456789
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
+ to_char
+-----------------------
+ 456.000
+ 4567890123456789.000
+ 123.000
+ 4567890123456789.000
+ -4567890123456789.000
+(5 rows)
+
+SELECT to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
+ to_char
+------------------------
+ 456.000
+ 4567890123456789.000
+ 123.000
+ 4567890123456789.000
+ -4567890123456789.000
+(5 rows)
+
+SELECT to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
+ to_char
+--------------------
+ 456.
+ 4567890123456789.
+ 123.
+ 4567890123456789.
+ -4567890123456789.
+(5 rows)
+
+SELECT to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
+ to_char
+-------------------------------------------
+ +4 5 6 . 0 0 0
+ +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+ +1 2 3 . 0 0 0
+ +4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+ -4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 . 0 0 0
+(5 rows)
+
+SELECT to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
+ to_char
+-----------------------------------------------------------
+ text 9999 "text between quote marks" 456
+ 45678 text 9012 9999 345 "text between quote marks" 6789
+ text 9999 "text between quote marks" 123
+ 45678 text 9012 9999 345 "text between quote marks" 6789
+ -45678 text 9012 9999 345 "text between quote marks" 6789
+(5 rows)
+
+SELECT to_char(q2, '999999SG9999999999') FROM INT8_TBL;
+ to_char
+-------------------
+ + 456
+ 456789+0123456789
+ + 123
+ 456789+0123456789
+ 456789-0123456789
+(5 rows)
+
-- check min/max values and overflow behavior
select '-9223372036854775808'::int8;
int8
@@ -139,6 +697,29 @@ SELECT CAST('36854775807.0'::float4 AS int8);
SELECT CAST('922337203685477580700.0'::float8 AS int8);
ERROR: bigint out of range
+SELECT CAST(q1 AS oid) FROM INT8_TBL;
+ERROR: OID out of range
+-- bit operations
+SELECT q1, q2, q1 & q2 AS "and", q1 | q2 AS "or", q1 # q2 AS "xor", ~q1 AS "not" FROM INT8_TBL;
+ q1 | q2 | and | or | xor | not
+------------------+-------------------+------------------+------------------+------------------+-------------------
+ 123 | 456 | 72 | 507 | 435 | -124
+ 123 | 4567890123456789 | 17 | 4567890123456895 | 4567890123456878 | -124
+ 4567890123456789 | 123 | 17 | 4567890123456895 | 4567890123456878 | -4567890123456790
+ 4567890123456789 | 4567890123456789 | 4567890123456789 | 4567890123456789 | 0 | -4567890123456790
+ 4567890123456789 | -4567890123456789 | 1 | -1 | -2 | -4567890123456790
+(5 rows)
+
+SELECT q1, q1 << 2 AS "shl", q1 >> 3 AS "shr" FROM INT8_TBL;
+ q1 | shl | shr
+------------------+-------------------+-----------------
+ 123 | 492 | 15
+ 123 | 492 | 15
+ 4567890123456789 | 18271560493827156 | 570986265432098
+ 4567890123456789 | 18271560493827156 | 570986265432098
+ 4567890123456789 | 18271560493827156 | 570986265432098
+(5 rows)
+
-- generate_series
SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8);
generate_series
diff --git a/ydb/library/yql/tests/postgresql/cases/int8.sql b/ydb/library/yql/tests/postgresql/cases/int8.sql
index c0705302b2..84bef05f5b 100644
--- a/ydb/library/yql/tests/postgresql/cases/int8.sql
+++ b/ydb/library/yql/tests/postgresql/cases/int8.sql
@@ -3,11 +3,11 @@
-- Test int8 64-bit integers.
--
CREATE TABLE INT8_TBL(q1 int8, q2 int8);
-INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
-INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
-INSERT INTO INT8_TBL VALUES('4567890123456789','123');
-INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
-INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES(' 123 ',' 456');
+INSERT INTO INT8_TBL (q1, q2) VALUES('123 ','4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES('4567890123456789','123');
+INSERT INTO INT8_TBL (q1, q2) VALUES(+4567890123456789,'4567890123456789');
+INSERT INTO INT8_TBL (q1, q2) VALUES('+4567890123456789','-4567890123456789');
-- bad inputs
INSERT INTO INT8_TBL(q1) VALUES (' ');
INSERT INTO INT8_TBL(q1) VALUES ('xxx');
@@ -16,9 +16,87 @@ INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340329840934');
INSERT INTO INT8_TBL(q1) VALUES ('- 123');
INSERT INTO INT8_TBL(q1) VALUES (' 345 5');
INSERT INTO INT8_TBL(q1) VALUES ('');
+SELECT * FROM INT8_TBL;
+-- int8/int8 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789;
SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789;
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789;
+-- int8/int4 cmp
+SELECT * FROM INT8_TBL WHERE q2 = 456;
+SELECT * FROM INT8_TBL WHERE q2 <> 456;
+SELECT * FROM INT8_TBL WHERE q2 < 456;
+SELECT * FROM INT8_TBL WHERE q2 > 456;
+SELECT * FROM INT8_TBL WHERE q2 <= 456;
+SELECT * FROM INT8_TBL WHERE q2 >= 456;
+-- int4/int8 cmp
+SELECT * FROM INT8_TBL WHERE 123 = q1;
+SELECT * FROM INT8_TBL WHERE 123 <> q1;
+SELECT * FROM INT8_TBL WHERE 123 < q1;
SELECT * FROM INT8_TBL WHERE 123 > q1;
+SELECT * FROM INT8_TBL WHERE 123 <= q1;
+SELECT * FROM INT8_TBL WHERE 123 >= q1;
+-- int8/int2 cmp
+SELECT * FROM INT8_TBL WHERE q2 = '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 <> '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 < '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 > '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 <= '456'::int2;
+SELECT * FROM INT8_TBL WHERE q2 >= '456'::int2;
+-- int2/int8 cmp
+SELECT * FROM INT8_TBL WHERE '123'::int2 = q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 <> q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 < q1;
SELECT * FROM INT8_TBL WHERE '123'::int2 > q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 <= q1;
+SELECT * FROM INT8_TBL WHERE '123'::int2 >= q1;
+SELECT q1 AS plus, -q1 AS minus FROM INT8_TBL;
+SELECT q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
+SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+SELECT q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL;
+SELECT 37 + q1 AS plus4 FROM INT8_TBL;
+SELECT 37 - q1 AS minus4 FROM INT8_TBL;
+SELECT 2 * q1 AS "twice int4" FROM INT8_TBL;
+SELECT q1 * 2 AS "twice int4" FROM INT8_TBL;
+-- int8 op int4
+SELECT q1 + 42::int4 AS "8plus4", q1 - 42::int4 AS "8minus4", q1 * 42::int4 AS "8mul4", q1 / 42::int4 AS "8div4" FROM INT8_TBL;
+-- int4 op int8
+SELECT 246::int4 + q1 AS "4plus8", 246::int4 - q1 AS "4minus8", 246::int4 * q1 AS "4mul8", 246::int4 / q1 AS "4div8" FROM INT8_TBL;
+-- int8 op int2
+SELECT q1 + 42::int2 AS "8plus2", q1 - 42::int2 AS "8minus2", q1 * 42::int2 AS "8mul2", q1 / 42::int2 AS "8div2" FROM INT8_TBL;
+-- int2 op int8
+SELECT 246::int2 + q1 AS "2plus8", 246::int2 - q1 AS "2minus8", 246::int2 * q1 AS "2mul8", 246::int2 / q1 AS "2div8" FROM INT8_TBL;
+SELECT q2, abs(q2) FROM INT8_TBL;
+SELECT min(q1), min(q2) FROM INT8_TBL;
+SELECT max(q1), max(q2) FROM INT8_TBL;
+-- TO_CHAR()
+--
+SELECT to_char(q1, '9G999G999G999G999G999'), to_char(q2, '9,999,999,999,999,999')
+ FROM INT8_TBL;
+SELECT to_char(q1, '9G999G999G999G999G999D999G999'), to_char(q2, '9,999,999,999,999,999.999,999')
+ FROM INT8_TBL;
+SELECT to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+ FROM INT8_TBL;
+SELECT to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+ FROM INT8_TBL;
+SELECT to_char(q2, 'MI9999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FMS9999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999THPR') FROM INT8_TBL;
+SELECT to_char(q2, 'SG9999999999999999th') FROM INT8_TBL;
+SELECT to_char(q2, '0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'S0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM0999999999999999') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999.000') FROM INT8_TBL;
+SELECT to_char(q2, 'L9999999999999999.000') FROM INT8_TBL;
+SELECT to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
+SELECT to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
+SELECT to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
+SELECT to_char(q2, '999999SG9999999999') FROM INT8_TBL;
-- check min/max values and overflow behavior
select '-9223372036854775808'::int8;
select '-9223372036854775809'::int8;
@@ -51,5 +129,9 @@ select '100'::int2 / '0'::int8;
SELECT CAST('42'::int2 AS int8), CAST('-37'::int2 AS int8);
SELECT CAST('36854775807.0'::float4 AS int8);
SELECT CAST('922337203685477580700.0'::float8 AS int8);
+SELECT CAST(q1 AS oid) FROM INT8_TBL;
+-- bit operations
+SELECT q1, q2, q1 & q2 AS "and", q1 | q2 AS "or", q1 # q2 AS "xor", ~q1 AS "not" FROM INT8_TBL;
+SELECT q1, q1 << 2 AS "shl", q1 >> 3 AS "shr" FROM INT8_TBL;
-- generate_series
SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8);
diff --git a/ydb/library/yql/tests/postgresql/cases/text.err b/ydb/library/yql/tests/postgresql/cases/text.err
index bc09ac9361..c156283fdd 100644
--- a/ydb/library/yql/tests/postgresql/cases/text.err
+++ b/ydb/library/yql/tests/postgresql/cases/text.err
@@ -11,10 +11,10 @@ SELECT text 'this is a text string' = text 'this is a text strin' AS false;
CREATE TABLE TEXT_TBL (f1 text);
</sql-statement>
<sql-statement>
-INSERT INTO TEXT_TBL VALUES ('doh!');
+INSERT INTO TEXT_TBL (f1) VALUES ('doh!');
</sql-statement>
<sql-statement>
-INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+INSERT INTO TEXT_TBL (f1) VALUES ('hi de ho neighbor');
</sql-statement>
<sql-statement>
SELECT * FROM TEXT_TBL;
diff --git a/ydb/library/yql/tests/postgresql/cases/text.out b/ydb/library/yql/tests/postgresql/cases/text.out
index 626f759176..334728e4ea 100644
--- a/ydb/library/yql/tests/postgresql/cases/text.out
+++ b/ydb/library/yql/tests/postgresql/cases/text.out
@@ -14,8 +14,15 @@ SELECT text 'this is a text string' = text 'this is a text strin' AS false;
(1 row)
CREATE TABLE TEXT_TBL (f1 text);
-INSERT INTO TEXT_TBL VALUES ('doh!');
-INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+INSERT INTO TEXT_TBL (f1) VALUES ('doh!');
+INSERT INTO TEXT_TBL (f1) VALUES ('hi de ho neighbor');
+SELECT * FROM TEXT_TBL;
+ f1
+-------------------
+ doh!
+ hi de ho neighbor
+(2 rows)
+
select reverse('abcde');
reverse
---------
diff --git a/ydb/library/yql/tests/postgresql/cases/text.sql b/ydb/library/yql/tests/postgresql/cases/text.sql
index 7887dd6482..b92059d2f5 100644
--- a/ydb/library/yql/tests/postgresql/cases/text.sql
+++ b/ydb/library/yql/tests/postgresql/cases/text.sql
@@ -4,8 +4,9 @@
SELECT text 'this is a text string' = text 'this is a text string' AS true;
SELECT text 'this is a text string' = text 'this is a text strin' AS false;
CREATE TABLE TEXT_TBL (f1 text);
-INSERT INTO TEXT_TBL VALUES ('doh!');
-INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
+INSERT INTO TEXT_TBL (f1) VALUES ('doh!');
+INSERT INTO TEXT_TBL (f1) VALUES ('hi de ho neighbor');
+SELECT * FROM TEXT_TBL;
select reverse('abcde');
select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i;
select quote_literal('');
diff --git a/ydb/library/yql/tests/postgresql/patches/boolean.out.patch b/ydb/library/yql/tests/postgresql/patches/boolean.out.patch
new file mode 100644
index 0000000000..41699dcb1e
--- /dev/null
+++ b/ydb/library/yql/tests/postgresql/patches/boolean.out.patch
@@ -0,0 +1,11 @@
+--- boolean.out
++++ boolean.out
+@@ -469,7 +469,7 @@ FROM booltbl3 ORDER BY o;
+ -- correct. Use a table as source to prevent constant simplification
+ -- to interfer.
+ CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
+-INSERT INTO booltbl4 VALUES (false, true, null);
++INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
+ \pset null '(null)'
+ -- AND expression need to return null if there's any nulls and not all
+ -- of the value are true
diff --git a/ydb/library/yql/tests/postgresql/patches/boolean.sql.patch b/ydb/library/yql/tests/postgresql/patches/boolean.sql.patch
new file mode 100644
index 0000000000..b74329b0d7
--- /dev/null
+++ b/ydb/library/yql/tests/postgresql/patches/boolean.sql.patch
@@ -0,0 +1,11 @@
+--- boolean.sql
++++ boolean.sql
+@@ -224,7 +224,7 @@ FROM booltbl3 ORDER BY o;
+ -- correct. Use a table as source to prevent constant simplification
+ -- to interfer.
+ CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
+-INSERT INTO booltbl4 VALUES (false, true, null);
++INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
+ \pset null '(null)'
+
+ -- AND expression need to return null if there's any nulls and not all
diff --git a/ydb/library/yql/tests/postgresql/patches/int8.out.patch b/ydb/library/yql/tests/postgresql/patches/int8.out.patch
new file mode 100644
index 0000000000..d3a8223d8c
--- /dev/null
+++ b/ydb/library/yql/tests/postgresql/patches/int8.out.patch
@@ -0,0 +1,19 @@
+--- int8.out
++++ int8.out
+@@ -3,11 +3,11 @@
+ -- Test int8 64-bit integers.
+ --
+ CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+-INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+-INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+-INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+-INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+-INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
++INSERT INTO INT8_TBL (q1, q2) VALUES(' 123 ',' 456');
++INSERT INTO INT8_TBL (q1, q2) VALUES('123 ','4567890123456789');
++INSERT INTO INT8_TBL (q1, q2) VALUES('4567890123456789','123');
++INSERT INTO INT8_TBL (q1, q2) VALUES(+4567890123456789,'4567890123456789');
++INSERT INTO INT8_TBL (q1, q2) VALUES('+4567890123456789','-4567890123456789');
+ -- bad inputs
+ INSERT INTO INT8_TBL(q1) VALUES (' ');
+ ERROR: invalid input syntax for type bigint: " "
diff --git a/ydb/library/yql/tests/postgresql/patches/int8.sql.patch b/ydb/library/yql/tests/postgresql/patches/int8.sql.patch
new file mode 100644
index 0000000000..a9a9499d1f
--- /dev/null
+++ b/ydb/library/yql/tests/postgresql/patches/int8.sql.patch
@@ -0,0 +1,19 @@
+--- int8.sql
++++ int8.sql
+@@ -4,11 +4,11 @@
+ --
+ CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+
+-INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
+-INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
+-INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+-INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
+-INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
++INSERT INTO INT8_TBL (q1, q2) VALUES(' 123 ',' 456');
++INSERT INTO INT8_TBL (q1, q2) VALUES('123 ','4567890123456789');
++INSERT INTO INT8_TBL (q1, q2) VALUES('4567890123456789','123');
++INSERT INTO INT8_TBL (q1, q2) VALUES(+4567890123456789,'4567890123456789');
++INSERT INTO INT8_TBL (q1, q2) VALUES('+4567890123456789','-4567890123456789');
+
+ -- bad inputs
+ INSERT INTO INT8_TBL(q1) VALUES (' ');
diff --git a/ydb/library/yql/tests/postgresql/patches/text.out.patch b/ydb/library/yql/tests/postgresql/patches/text.out.patch
new file mode 100644
index 0000000000..532827f6aa
--- /dev/null
+++ b/ydb/library/yql/tests/postgresql/patches/text.out.patch
@@ -0,0 +1,13 @@
+--- text.out
++++ text.out
+@@ -14,8 +14,8 @@ SELECT text 'this is a text string' = text 'this is a text strin' AS false;
+ (1 row)
+
+ CREATE TABLE TEXT_TBL (f1 text);
+-INSERT INTO TEXT_TBL VALUES ('doh!');
+-INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
++INSERT INTO TEXT_TBL (f1) VALUES ('doh!');
++INSERT INTO TEXT_TBL (f1) VALUES ('hi de ho neighbor');
+ SELECT * FROM TEXT_TBL;
+ f1
+ -------------------
diff --git a/ydb/library/yql/tests/postgresql/patches/text.sql.patch b/ydb/library/yql/tests/postgresql/patches/text.sql.patch
new file mode 100644
index 0000000000..56fea44670
--- /dev/null
+++ b/ydb/library/yql/tests/postgresql/patches/text.sql.patch
@@ -0,0 +1,13 @@
+--- text.sql
++++ text.sql
+@@ -8,8 +8,8 @@ SELECT text 'this is a text string' = text 'this is a text strin' AS false;
+
+ CREATE TABLE TEXT_TBL (f1 text);
+
+-INSERT INTO TEXT_TBL VALUES ('doh!');
+-INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
++INSERT INTO TEXT_TBL (f1) VALUES ('doh!');
++INSERT INTO TEXT_TBL (f1) VALUES ('hi de ho neighbor');
+
+ SELECT * FROM TEXT_TBL;
+
diff --git a/ydb/library/yql/tests/postgresql/pg_tests.csv b/ydb/library/yql/tests/postgresql/pg_tests.csv
index 7f73f8040f..66bdc4ff13 100644
--- a/ydb/library/yql/tests/postgresql/pg_tests.csv
+++ b/ydb/library/yql/tests/postgresql/pg_tests.csv
@@ -3,7 +3,7 @@ aggregates,416,51,12.26
alter_table,1679,11,0.66
arrays,410,119,29.02
bit,115,84,73.04
-boolean,93,73,78.49
+boolean,93,79,84.95
case,63,29,46.03
char,25,16,64.0
comments,7,7,100.0
@@ -20,7 +20,7 @@ horology,306,79,25.82
insert,357,15,4.2
int2,49,47,95.92
int4,70,70,100.0
-int8,142,48,33.8
+int8,142,113,79.58
interval,168,115,68.45
join,591,106,17.94
json,454,114,25.11
@@ -42,7 +42,7 @@ select_implicit,44,13,29.55
select_into,67,3,4.48
strings,390,31,7.95
subselect,234,5,2.14
-text,76,15,19.74
+text,76,16,21.05
time,39,33,84.62
timestamp,145,98,67.59
timestamptz,315,108,34.29
diff --git a/ydb/library/yql/tests/postgresql/status.md b/ydb/library/yql/tests/postgresql/status.md
index aef2262f26..7a0a442296 100644
--- a/ydb/library/yql/tests/postgresql/status.md
+++ b/ydb/library/yql/tests/postgresql/status.md
@@ -2,14 +2,14 @@
#|
||№ п/п | Имя теста|Число операторов| Из них выполняется| % выполнения | Последнее обновление | Основные проблемы ||
-|| 1 | boolean | 93 | 73 | 78.49 | 16.12.2023 | YQL-17569 ||
-|| 2 | char | 25 | 16 (+13) | 64.0 | 19.01.2024 | implicit cast, pgbpchar vs pgtext ||
-|| 3 | name | 40 | 22 | 55.0 | 29.09.2023 | parse_ident, implicit casts ||
-|| 4 | varchar | 24 | 15 (+13) | 62.5 | 19.01.2024 | ||
-|| 5 | text | 76 | 15 | 19.74 | 12.12.2023 | строковые функции (format, concat, concat_ws, length) и оператор конкатенации, implicit casts, отличаются сообщения об ошибках для оператора конкатенации с аргументами неподходящих типов ||
-|| 6 | int2 | 49 | 47 | 95.92 | 29.09.2023 | ||
+|| 1 | boolean | 93 | 79 (+6) | 84.95 | 22.01.2024 | YQL-17569 ||
+|| 2 | char | 25 | 16 (+13) | 64.0 | 19.01.2024 | YQL-17571 ||
+|| 3 | name | 40 | 22 | 55.0 | 29.09.2023 | YQL-17598 ||
+|| 4 | varchar | 24 | 15 (+13) | 62.5 | 19.01.2024 | YQL-17603 ||
+|| 5 | text | 76 | 16 (+1) | 21.05 | 22.01.2024 | YQL-17568 ||
+|| 6 | int2 | 49 | 47 | 95.92 | 29.09.2023 | YQL-17612 ||
|| 7 | int4 | 70 | 70 | 100.0 | 29.09.2023 | ||
-|| 8 | int8 | 142 | 48 | 33.8 | 12.12.2023 | generate_series, pg_type, gcd, implicit casts ||
+|| 8 | int8 | 142 | 113 (+65) | 79.58 | 22.01.2024 | YQL-17614 ||
|| 9 | oid | 27 | 21 | 77.78 | 29.09.2023 | ||
|| 10 | float4 | 96 | 48 | 50.0 | 29.09.2023 | CREATE TYPE, CREATE FUNCTION, WITH, форматирование NaN и Infinity, float4send ||
|| 11 | float8 | 168 | 96 | 57.14 | 25.10.2023 | CREATE CAST, форматирование NaN и Infinity, extra_float_digits, implicit casts, float8send ||