Question

I try to execute query:

INSERT INTO table_name
(
  timedate_array_field
)
VALUES
(
  '{NULL, NULL}'
)

But I get error "Could not convert string to DateTime: 'null'".

Was it helpful?

Solution

Just add single quotes for the value:

INSERT INTO table_name (timedate_array_field)
VALUES ('{NULL, NULL}')

-> SQLfiddle

BTW, the data type is not called "DateTime" or "timedate" in Postgres, but timestamp.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top