I want to create a database from shell script, I add this line to my script
psql -c 'CREATE DATABASE template1 WITH OWNER = postgres ENCODING = 'LATIN1' TABLESPACE = pg_default LC_COLLATE = "fr_FR iso88591" LC_CTYPE = "fr_FR iso88591" CONNECTION LIMIT = -1 TEMPLATE template0;'
but I get the error ERROR: invalid locale name: "fr_FR iso88591"
When I connect to postgresql then I run CREATE DATABASE template1 WITH OWNER = postgres ENCODING = 'LATIN1' TABLESPACE = pg_default LC_COLLATE = "fr_FR iso88591" LC_CTYPE = "fr_FR iso88591" CONNECTION LIMIT = -1 TEMPLATE template0;
it works
What's the problem ? why I cannot create the database from shell script ?
fr_FR.iso88591
rather thanfr_FR iso88591
(if this is glibc). Otherwise, it looks fine.