Ioan
Ioan

Reputation: 5187

Postgresql : set timestamp to null

I have searched across SO related questions, but I couldn't find the solution for :

How to set timestamp to NULL during an insert to DB or an update ? (in postgresql).

If I put NULL like pstat.setTimestamp(idx++, null); I get an error which says that the type I put in is integer and that I should cast to Timestamp.

As definition for this table column, I use : ADD COLUMN admin_validation_date timestamp with time zone

Thank you for your help.

Upvotes: 2

Views: 2343

Answers (1)

user330315
user330315

Reputation:

pstat.setNull(idx++, Types.TIMESTAMP);

should do it.

Upvotes: 3

Related Questions