PostgreSQL "to_timestamp" function in RDS Data Service command batchExecuteStatement

0

hi, I'm trying to use the postgresql "to_timestamp" function inside a RDS Data Service batchExecuteStatement calls of the AWS Javascript SDK.

I set the parameterSets to an array. An element of the array is:

{ name: 'received_on', typeHint: 'TIMESTAMP', value: { stringValue: 'to_timestamp(' + record.received_on + ')' } },

where record.received_on is an epoch time like 1644417054153 (I also tested 1644417054.153). The execution of the code throw this error: Cannot parse date or time "to_timestamp(164441704.153)"

Where is the problem? Thanks

1개 답변
0

Hi From PostgreSQL doc: https://www.postgresql.org/docs/10/functions-datetime.html

to_timestamp(double precision)

examples in the link indicating something like:

SELECT to_timestamp(982384720.12); Result: 2001-02-17 04:38:40.12+00

Your data to_timestamp(164441704.153) seems to have one more precision.

AWS
지원 엔지니어
Kevin_Z
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인