You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
docker run --rm -e POSTGRES_PASSWORD=password -e POSTGRES_DB=app -v $(pwd)/data:/var/lib/postgresql/data postgres:15.8-bookworm
docker run --rm --name postgres -v $(pwd)/data:/var/lib/postgresql/data postgres:15.8-alpine3.20
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.After calling get_collation_actual_version, the
actual_version_str
variable is NULL, because theget_collation_actual_version
function after the preprocessor looks like:And it always returns NULL
The text was updated successfully, but these errors were encountered: