2025-02-28     2025-03-01     2025-03-02

countrysubdivs have a subdiv type code

number of errors=32
number of warnings=0

select countrycode,iso_3166_2,name,subdivisionid from countrysubdivision where countrysubdivtypeid is null and geonameslevel=1 and validtill is null order by countrycode

[{key=IO,number=8}, {key=US,number=6}, {key=CS,number=4}, {key=KN,number=2}, {key=NO,number=2}, {key=SJ,number=2}, {key=IQ,number=1}, {key=KR,number=1}, {key=MK,number=1}, {key=MM,number=1}, {key=RS,number=1}, {key=RU,number=1}, {key=SD,number=1}, {key=TM,number=1}]

insert into countrysubdivtype(typeid,cc,type) values (nextval('countrysubdivtypeid'),'xx','xx');

update countrysubdivision set countrysubdivtypeid = xx where countrysubdivtypeid is null and countrycode='xx';

countrycode	iso_3166_2	name	subdivisionid	
CS	VOJ	Vojvodina	null	
CS	SER	Serbia	null	
CS	KOS	Kosovo	null	
CS	MON	Montenegro	null	
IO	SI	Salomon Islands	null	
IO	EA	Eagle Islands	null	
IO	DG	Diego Garcia	null	
IO	NI	Nelsons Island	null	
IO	PB	Peros Banhos	null	
IO	EG	Egmont Islands	null	
IO	TB	Three Brothers	null	
IO	DI	Danger Island	null	
IQ	null	Halabja	12218240	
KN	K	Saint Kitts	null	
KN	N	Nevis	null	
KR	50	Sejong	8394437	
MK	null	Skopje	11398357	
MM	18	Nay Pyi Taw	8239588	
NO	21	Svalbard	null	
NO	22	Jan Mayen	null	
RS	null	Serbia Centrale	785958	
RU	ZAB	Zabaykal'skiy kray	7779061	
SD	GK	West Kurdufan	408659	
SJ	22	Jan Mayen	3041964	
SJ	21	Svalbard	7521757	
TM	S	Aşgabat	162182	
US	AS	American Samoa	null	
US	UM	U.S. Minor Outlying Islands	null	
US	GU	Guam	null	
US	MP	Northern Mariana Islands	null	
US	PR	Puerto Rico	null	
US	VI	Virgin Islands of the U.S.	null