country-list
country-list copied to clipboard
Wrong string escape format for PostgrrSQL
Hello,
I am using the country.postgresql.sql
file located at https://raw.githubusercontent.com/umpirsky/country-list/master/country/cldr/en/country.postgresql.sql.
Doing psql -f country.postgresql.sql
does not work because of the way "People's Democratic Republic of Yemen" is escaped. The escape sequence should be doubling the single-quote character ''
.
I wonder if this is expected, just thought I'd let you know.
Thanks! Cam
@tuscland Oh, this is a bug in deed. Thanks for reposting! :+1:
Also, Postgresql should not use VARCHAR(64)
, but text
. This is the convention in PG. VARCHAR is imposing a restriction that isn't needed.
If I could advise one more thing... In postgresql this is much better done as with a schema..
CREATE SCHEMA country_code;
CREATE TABLE country_code.en_US (country_code, country_name)...
Actually, the whole thing is much better done in one table... umprisky.country_codes(locale, abbreviation, expanded_name)..
and so on, I'd rather one file, and get everything in a sane prebuilt setup