duckdb/duckdb-postgres

current_timestamp wrong when export to csv

Closed this issue · 1 comments

What happens?

When query oracle in duckdb, current_timestamp to be timestamptz format in duckdb,

con.execute("select *,pg_typeof(etl_time) from ar limit 1").fetch_df()
# timestamp with time zone

when copy to csv, it's wrong time in excel:

con.execute("copy (select * from ar limit 1) to 'ar.csv'")

then copy to postgres, same the csv.
in oracle: 2022-12-05 09:44:44.018
export to csv: 2022-12-05 17:42:44.018 PRC
copy to pg: 2022-12-05 17:42:44.018
how to export the right time in csv?

To Reproduce

-- in orcale:
create table test as select current_timestamp as etl_time from dual;
-- in duckdb:
import pandas as pd
import duckdb as dd
df=pd.read_sql_query('select * from test',conn)
con=dd.connect(':memory:')
con.execute("copy df to 'df.csv')

OS:

win10

PostgreSQL Version:

10.2

DuckDB Version:

0.6.0

DuckDB Client:

Python

Full Name:

Changzhen Wang

Affiliation:

linezonedata.com

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree

Thanks for the report! Unfortunately I can't find enough information here to reproduce the issue.