I created a DOMAIN:
CREATE DOMAIN public."POSTAL_CODE"
AS character(5)
NOT NULL;
I tried to set the default value:
ALTER DOMAIN public."POSTAL_CODE"
SET DEFAULT "00000";
but got the error:
ERROR: column "00000" does not exist
Then I managed to set the default value using DEFAULT 00000
, but I think it was cast to INTEGER
as it shows as 0
instead of 00000
. I tried character(5)[]
and {'0','0','0','0','0'}
without success as well.
How to get a default value as text and not get an error?
I used PostgreSQL.