Apparently, not a good idea as there is still a unique constraint for the null case:
postgresql$ psql oacs-dev < entities-channels-drop.sql
acs_object_type__drop_type
----------------------------
0
(1 row)
acs_object_type__drop_type
----------------------------
0
(1 row)
acs_object_type__drop_type
----------------------------
0
(1 row)
DROP INDEX
DROP INDEX
...
postgresql$ psql oacs-dev < entities-channels-create.sql
acs_object_type__create_type
------------------------------
0
(1 row)
ERROR: duplicate key value violates unique constraint "acs_object_types_table_name_un"
DETAIL: Key (table_name)=() already exists.
CONTEXT: SQL statement "insert into acs_object_types
(object_type, pretty_name, pretty_plural, supertype, table_name,
id_column, abstract_p, type_extension_table, package_name,
name_method, dynamic_p)
values
(p_object_type, p_pretty_name,
p_pretty_plural, v_supertype,
v_table_name, v_id_column,
p_abstract_p, p_type_extension_table,
v_package_name, v_name_method, p_dynamic_p)"
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying,boolean,boolean) line 54 at SQL statement
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying) line 7 at RETURN
ERROR: duplicate key value violates unique constraint "acs_object_types_table_name_un"
DETAIL: Key (table_name)=() already exists.
CONTEXT: SQL statement "insert into acs_object_types
(object_type, pretty_name, pretty_plural, supertype, table_name,
id_column, abstract_p, type_extension_table, package_name,
name_method, dynamic_p)
values
(p_object_type, p_pretty_name,
p_pretty_plural, v_supertype,
v_table_name, v_id_column,
p_abstract_p, p_type_extension_table,
v_package_name, v_name_method, p_dynamic_p)"
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying,boolean,boolean) line 54 at SQL statement
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying) line 7 at RETURN
CREATE TABLE
CREATE INDEX