I am unable to insert a null value in my postgres database where the datatype is bytea(blob). This is my code snippet from java:
ps.setNull(++index, java.sql.Types.BLOB);
The bytea column is a nullable column. The following is the table description.
testdb=# \d+ plan
Table "public.plan"
Column | Type | Modifiers | Storage | Stats target | Description
-------------+-------+-----------+----------+--------------+-------------
description | bytea | | extended | |
Has OIDs: no
I am getting the following exception java.sql.BatchUpdateException: Batch entry 11 INSERT INTO public.plan(description) VALUES(NULL) was aborted. Call getNextException to see the cause.
setObject(++index, null)orsetNull(++index, Types.OTHER)