I created a DOMAIN:
CREATE DOMAIN public.\"POSTAL_CODE\"
AS character(5)
NOT NULL;
I tried to set the default value:
ALTER
Try this: value should be in single quote like '00000'
ALTER DOMAIN public."POSTAL_CODE" set default '00000';
Try this
Alter table <table name> ALTER <column name> TYPE character varying, ALTER <column name> SET DEFAULT '00000'
In SQL double quotes "
are used to refer to a column or table named "select"
A string constant in SQL is an arbitrary sequence of characters bounded by single quotes ('
), for example 'This is a string'
. So this is not the same as a double-quote character ("
)
As a result you have to use single quote like below
select * from test where old_code = '220088242'
so in your case it should be like below
ALTER DOMAIN public."POSTAL_CODE"
SET DEFAULT '00000';