Sample Header Ad - 728x90

Invalid input syntax for timestamp error with Postgres Copy command

0 votes
1 answer
4944 views
I am trying to load data in Postgres through COPY command in a SQL file
COPY   (, ,  etc etc) FROM stdin;

1    test1   test2   to_timestamp(1592818988000)
But I am getting this below error: > psql:/Users/sanupin/load.sql:1045: ERROR: invalid input syntax for > type timestamp: "to_timestamp(1641278614000)" CONTEXT: COPY > cstone_storage, line 1, column last_loaded: > "to_timestamp(1641278614000)" Any idea what could be the problem? I know I have to convert the millisecond to second (div by 1000) on the epoch number, but not sure how else to proceed.
Asked by user2405589 (123 rep)
Jan 10, 2022, 01:23 AM
Last activity: Feb 27, 2025, 11:08 PM