numerus/deploy/country_code.sql

15 lines
304 B
PL/PgSQL

-- Deploy numerus:country_code to pg
-- requires: schema_numerus
begin;
set search_path to numerus, public;
create domain country_code as text
check (value ~ '^[A-Z]{2}$');
comment on domain country_code is
'A correctly formated, but not necessarily valid, ISO 3166-1 alpha-2 country code';
commit;