| |
1 |
1 |
|
| |
2 |
2 |
|
| |
3 |
3 |
|
| |
4 |
4 |
|
| |
5 |
5 |
|
| |
6 |
6 |
|
| |
7 |
7 |
|
| |
8 |
8 |
|
| |
9 |
9 |
|
| |
10 |
10 |
|
| |
11 |
11 |
create table countries ( |
| |
12 |
12 |
|
| |
13 |
13 |
|
| |
14 |
14 |
|
| |
15 |
15 |
default_name varchar(100) |
| |
16 |
16 |
constraint countries_default_name_nn |
| |
17 |
17 |
not null |
| |
18 |
|
constraint countries_default_name_uq |
| |
|
18 |
constraint countries_default_name_un |
| |
19 |
19 |
unique, |
| |
20 |
20 |
iso char(2) |
| |
21 |
21 |
constraint countries_iso_pk |
| |
22 |
22 |
primary key |
| |
23 |
23 |
); |
| |
24 |
24 |
|
| |
25 |
25 |
comment on table countries is ' |
| |
26 |
26 |
This is the country code/english name table from ISO 3166. |
| |
27 |
27 |
'; |
| |
28 |
28 |
|
| |
29 |
29 |
comment on column countries.default_name is ' |
| |
30 |
30 |
This is admittedly a violation of 3NF but it is more efficient and helps with non-translated values. |
| |
31 |
31 |
See country.sql for more comments. |
| |
32 |
32 |
'; |
| |
33 |
33 |
|
| |
34 |
34 |
|
| |
35 |
35 |
declare |
| |
36 |
36 |
v_id integer; |
| |
37 |
37 |
begin |
| |
38 |
38 |
v_id := acs_reference.new( |