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

date type field from MS SQL Server to PostgreSQL date type issue #361

Open
nanren8bang opened this issue Jul 17, 2024 · 0 comments
Open

Comments

@nanren8bang
Copy link

nanren8bang commented Jul 17, 2024

Issue report

We setup tds_fdw Version: 2.0.3 in PostgreSQL 14 to select data from MS SQL Server .

In MS SQL Server the field definition as below:

RequestedStartDate date NOT NULL,

In PostgreSQL Foreign table , the same field definition as below:

"RequestedStartDate" date OPTIONS (column_name 'RequestedStartDate') NOT NULL,

When I select data from field RequestedStartDate in MS SQL Server , I ONLY got date like "2022-04-24",

But when I select the same field from foreign table in postgresql , I got data like "Apr 24 2022 12:00:00:AM" and error as below:

NOTICE: tds_fdw: Query executed correctly
NOTICE: tds_fdw: Getting results
ERROR: invalid input syntax for type date: "Apr 24 2022 12:00:00:AM"

As you can see , the foreign table return not only date but also added time like "12:00:00:AM" and caused error in PostgreSQL.

Any one experience same thing and could share the solution to fix it ?

Below are some additional information for reference ?

Operating system

Rocky Linux 8.9

Version of tds_fdw

tds_fdw Version: 2.0.3

Version of PostgreSQL

PostgreSQL 14

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

1 participant