From fd3239c47ed37ef95df3ea9729e3faf52e24550a Mon Sep 17 00:00:00 2001 From: Harsh Raj Date: Tue, 19 Dec 2023 14:36:09 +0530 Subject: [PATCH] Create table issue when column name contains "SERIAL" in it. --- sqla_vertica_python/vertica_python.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqla_vertica_python/vertica_python.py b/sqla_vertica_python/vertica_python.py index 609977a..caac1c8 100755 --- a/sqla_vertica_python/vertica_python.py +++ b/sqla_vertica_python/vertica_python.py @@ -12,7 +12,9 @@ @compiles(CreateColumn, 'vertica') def use_identity(element, compiler, **kw): text = compiler.visit_create_column(element, **kw) - text = text.replace("SERIAL", "IDENTITY(1,1)") + ## if column name contains "SERIAL" then it was replaced with "IDENTITY(1,1)" + ## ex "LOT_SERIAL_NUMBER" was changed to "LOT_IDENTITY(1,1)_NUMBER" + text = text.replace(" SERIAL", " IDENTITY(1,1)") return text