Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with data type "float(0)" #340

Open
JosefMachytkaNetApp opened this issue Sep 29, 2023 · 1 comment
Open

problem with data type "float(0)" #340

JosefMachytkaNetApp opened this issue Sep 29, 2023 · 1 comment

Comments

@JosefMachytkaNetApp
Copy link

Issue report

I am testing migration of Sybase (15.7) data into PostgreSQL (15.4) using TDS_FDW and when running IMPORT FOREIGN SCHEMA, some tables fail because they contain column with data type "float(0)" - really size ZERO, see below in error output.
I must exclude such a table from schema import and add manual creation of it with some non-zero size of float type.
Is there some way to avoid this error and set some default size for float data in case size is 0?
I so far did not find any mention of this problem on web, if there is already some solution, please give me a link.
Thank you very much.

Operating system

Ubuntu 20

Version of tds_fdw

tds_fdw | 2.0.3

Version of PostgreSQL

15.4

Version of FreeTDS

ii freetds-bin 1.1.6-1.1 amd64 FreeTDS command-line utilities
ii freetds-common 1.1.6-1.1 all configuration files for FreeTDS SQL client libraries
ii freetds-dev 1.1.6-1.1 amd64 MS SQL and Sybase client library (static libs and headers)

Logs

postgres=# IMPORT FOREIGN SCHEMA dbo FROM SERVER sybase_pubs3 INTO pubs3_sybase OPTIONS (import_default 'false');
NOTICE: DB-Library notice: Msg #: 5701, Msg state: 2, Msg: Changed database context to 'master'.
, Server: DKSYBASE, Process: , Line: 0, Level: 10
NOTICE: DB-Library notice: Msg #: 5701, Msg state: 1, Msg: Changed database context to 'pubs3'.
, Server: DKSYBASE, Process: , Line: 1, Level: 10
ERROR: precision for type float must be at least 1 bit
LINE 6: discount float(0) OPTIONS (column_name 'discount') NOT NUL...
^
QUERY: CREATE FOREIGN TABLE salesdetail (
stor_id char(4) OPTIONS (column_name 'stor_id') NOT NULL,
ord_num numeric(6) OPTIONS (column_name 'ord_num') NOT NULL,
title_id text OPTIONS (column_name 'title_id') NOT NULL,
qty smallint OPTIONS (column_name 'qty') NOT NULL,
discount float(0) OPTIONS (column_name 'discount') NOT NULL
) SERVER sybase_pubs3
OPTIONS (schema_name 'dbo', table_name 'salesdetail');

Sentences, data structures, data

@JosefMachytkaNetApp JosefMachytkaNetApp changed the title problem with data type "fload(0)" problem with data type "float(0)" Oct 5, 2023
@mbanck
Copy link

mbanck commented Nov 9, 2023

This was fixed a year ago in 93e8a03 but no release has happened since, see #344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants