You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Babelfish accepts type modifier 7 for time, datetime2 and datetimeoffset columns. Internally it is handled as 6 that is a max precision for these types in Postgres.
There is a discrepancy with handling typemod 7 in DDL when the typename is bare or when it is enclosed in square brackets.
Without brackets:
createtable tab1(
col1 time(7)
)
selecta.attname, a.atttypmodfrompg_catalog.pg_attribute a
joinpg_catalog.pg_class c onc.oid=a.attrelidwherec.relname='tab1'anda.attname='col1'
attname atttypmod
---------- -----------
col1 -1
With brackets:
createtable tab2(
col2 [time](7)
)
selecta.attname, a.atttypmodfrompg_catalog.pg_attribute a
joinpg_catalog.pg_class c onc.oid=a.attrelidwherec.relname='tab2'anda.attname='col2'
attname atttypmod
---------- -----------
col2 6
It seems that the discrepancy happens on the parsing stage, the former (bare) variant does not have any typmod expressions at this point. So it does not reach the typemodin call for the time data type that returns 6 given 7 as input.
This discrepancy does not affect data handling (precision 6 is used in both cases), but it can affect tooling that use DB introspection, for example the bcp in #3120 .
Version
BABEL_4_X_DEV (Default)
Extension
babelfishpg_tsql (Default)
Which flavor of Linux are you using when you see the bug?
Fedora
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct.
The text was updated successfully, but these errors were encountered:
What happened?
Babelfish accepts type modifier
7
fortime
,datetime2
anddatetimeoffset
columns. Internally it is handled as6
that is a max precision for these types in Postgres.There is a discrepancy with handling typemod
7
in DDL when the typename is bare or when it is enclosed in square brackets.Without brackets:
With brackets:
It seems that the discrepancy happens on the parsing stage, the former (bare) variant does not have any typmod expressions at this point. So it does not reach the typemodin call for the
time
data type that returns6
given7
as input.This discrepancy does not affect data handling (precision
6
is used in both cases), but it can affect tooling that use DB introspection, for example thebcp
in #3120 .Version
BABEL_4_X_DEV (Default)
Extension
babelfishpg_tsql (Default)
Which flavor of Linux are you using when you see the bug?
Fedora
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: