Postgres in alpine has collation warning if database was created in another OS.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Tái hiện cảnh báo bằng các lệnh Docker được cung cấp postgres:15.8-bookworm và postgres:15.8-alpine3.20. Đọc CheckMyDatabase trong src/backend/utils/init/postinit.c và truy vết get_collation_actual_version, sau đó xác định tại sao actual_versionstr là NULL và liệu hành vi cross-OS có được mong đợi hay không.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Postgres shows warning WARNING: database "postgres" has no actual collation version, but a version was recorded if database was created in another OS.
Steps for reproduce:
- Execute postgres in debian image:
docker run --rm -e POSTGRES_PASSWORD=password -e POSTGRES_DB=app -v $(pwd)/data:/var/lib/postgresql/data postgres:15.8-bookworm - Stop this
- Execute postgres in alpine image:
docker run --rm --name postgres -v $(pwd)/data:/var/lib/postgresql/data postgres:15.8-alpine3.20 - Run psql:
$ docker exec -ti --user postgres postgres psql
WARNING: database "postgres" has no actual collation version, but a version was recorded
psql (15.8)
Type "help" for help.
postgres=# \c app
WARNING: database "app" has no actual collation version, but a version was recorded
You are now connected to database "app" as user "postgres".
app=#
Research:
I found that a warning occurs in the CheckMyDatabase function when comparing the collate version in the database and the current one in this row.
...
if (!isnull)
{
char *actual_versionstr;
char *collversionstr;
collversionstr = TextDatumGetCString(datum);
actual_versionstr = get_collation_actual_version(dbform->datlocprovider, dbform->datlocprovider == COLLPROVIDER_ICU ? iculocale : collate);
if (!actual_versionstr)
/* should not happen */
elog(WARNING,
"database \"%s\" has no actual collation version, but a version was recorded",
name);
else if (strcmp(actual_versionstr, collversionstr) != 0)
...
After calling get_collation_actual_version, the actual_version_str variable is NULL, because the get_collation_actual_version function after the preprocessor looks like:
char *
get_collation_actual_version(char collprovider, const char *collcollate)
{
char *collversion = NULL;
if (collprovider == COLLPROVIDER_LIBC &&
pg_strcasecmp("C", collcollate) != 0 &&
pg_strncasecmp("C.", collcollate, 2) != 0 &&
pg_strcasecmp("POSIX", collcollate) != 0)
{
}
return collversion;
}
And it always returns NULL
- Ngôn ngữ chính
- Shell
- Star
- 2.5k
- Fork
- 1.2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker-library/postgres
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
docker-library/postgres#1420 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
docker-library/postgres#1419 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
docker-library/postgres#1389 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
docker-library/postgres#1356 · 5 bình luận · 7 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
docker-library/postgres#1355 · 10 bình luận · 11 reaction ·
Tất cả issue của docker-library/postgres
Issue tương tự
-
Standalone Unix updater reports success when curl fails (`curl | sh` masks the exit status); Windows path is unaffectedCó thể đã có người làm @akhil9tiet đã nhận hôm nay. Đang mởbug CLI windows-os
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openai/codex#54465 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ChrisTitusTech/dwm-titus#397 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Translate zstd cheat sheet to frĐang mởgood first issue help wanted language:fr translation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
mrvi0/cli-cheatsheet#268 ·