Comments (3)
I'd tend to agree, but here's the counterargument:
$ docker run -it --rm debian:sid bash
root@95b748d48bdc:/# apt-get update && apt-get install -y postgresql
...
root@95b748d48bdc:/# /etc/init.d/postgresql start
[ ok ] Starting PostgreSQL 9.4 database server: main.
root@95b748d48bdc:/# su - postgres
postgres@95b748d48bdc:~$ psql
psql (9.4beta2)
Type "help" for help.
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+-----------+---------+-------+-----------------------
postgres | postgres | SQL_ASCII | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
(3 rows)
postgres=#
from postgres.
I would prefer UTF8 too.
I just re-installed PostgreSQL on my machine; lo and behold:
jpetazzo@tarrasque:~$ sudo -u postgres psql -l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(3 rows)
I believe that it defaults to SQL_ASCII
, except if you have an UTF-8
locale; then it will default to that. I believe (but that's not backed by any hard data; just anecdotal experience) that everybody will use some kind of local locale, and that the vast majority (for some definition of "vast") of the installs out there will therefore have UTF8.
Now, to give you a more specific example: during the Docker training, we show an example involving Docker running a Rails app with a PostgreSQL backend. We are updating this to use the canon postgres
image instead of our hackish training/postgres
image; however, Rails complains because the DB is "only" SQL_ASCII
. I'm trying to work around the issue by specifying the encoding in the database.yml
; but it would be nice if it could work out of the box for most people.
from postgres.
Hmm, maybe it's based on LANG
, even for the default install? We have C.UTF-8
in the base images, so it shouldn't be a "do you have UTF-8; ok we'll use it" issue, but it might be. Maybe we need to locale-gen en_US.UTF-8
in this image. Thanks for doing more testing on this, @jpetazzo!
from postgres.
Related Issues (20)
- Initialization script when PGData is not empty HOT 8
- Failure oracle-libs installation
- Skip postgres restart on first run HOT 1
- Reproducible SIGSEGV in query HOT 1
- Separating config using PGDATA does not seem to behave as described in the docs HOT 12
- Upgrade older images to OCI Format or Docker Image manifest v2, schema 2 HOT 3
- Add a HEALTHCHECK to the images HOT 7
- include_dirs env var HOT 4
- Add "build from github.com/postgres/postgres" variation HOT 2
- PostgreSQL 17beta1 HOT 3
- CVE-2023-24538 CVE-2023-24540 HOT 2
- Use of GOSU introduces critical CVEs HOT 2
- PostgreSQL error ( log Docker) HOT 1
- Issue of working with pgsql in my vps machine with easypanel
- Nurlanhajizada
- Please help, I have persisted it, but the table and data are not restored after restarting the container. HOT 1
- please add a Container shell access and viewing MySQL logs directly HOT 3
- associate --user id with the internal postgres user id HOT 13
- Kill a postgres container immediately HOT 5
- Remove gosu HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgres.