Closed dataselfservice closed 1 year ago
I noticed the WARNING: database "testdb" has no actual collation version, but a version was recorded and I am not sure how that is realted (I do not really know what is the impact of that.
With the Alpine version, you probably need to use the ICU locales setting. Or you might need to switch to the simpler Debian. At least it's documented:
POSTGRES_INITDB_ARGS
to set a different locale. ...."_Another note: When generating or using hashes, it's advisable to use the more stable "C" Collation, which is also good for performance.
If the previous settings don't resolve the issue, then it would be advisable to report it at https://github.com/iCyberon/pg_hashids
Hi @ImreSamu , thank you for the feedback, I'll make some tests and get back here.
What is best image to run into Kubernetes and is the Debian equally good for Kubernetes cluster purposes?
What is best image to run into Kubernetes and is the Debian equally good for Kubernetes cluster purposes?
Unfortunately, I can't assist with that question as I don't use Kubernetes. You might find more comprehensive and helpful answers on StackOverflow: https://stackoverflow.com/search?q=postgresql+kubernetes
However, what I would recommend is never using a PostgreSQL extension in production without testing it; especially under Alpine Linux. There's a reason why the PostGIS Alpine Dockerfile includes a comprehensive test during the build process - to detect issues as early as possible.
I made some test and wierd enough: the WARNING: database "testdb" has no actual collation version
was something related to how the init (db creating, extension etc) was done. By cleaning the persistent volume (FS) and rebuilding (on kubernetes and on local docker) it disappeared. BUT the pg_hashid
issue persists, likely unrelated to the collation stuff. I'll report to https://github.com/iCyberon/pg_hashids.
additional note: the problem is exactly the same using postgres:15.4
, with following Dockerfile
:
FROM postgres:15.4
RUN apt update && apt install -y build-essential postgresql-server-dev-15 wget && \
wget -qO- https://github.com/iCyberon/pg_hashids/archive/refs/tags/v1.2.1.tar.gz | tar xzf - -C /tmp && \
make -C /tmp/pg_hashids-1.2.1 && \
make -C /tmp/pg_hashids-1.2.1 install && \
rm -rf /tmp/pg_hashids-1.2.1 && \
apt purge -y build-essential postgresql-server-dev-15 && apt autoremove -y
Hi,
from postgresql side, what is the difference btw myfunc
and myfunc_fixin particular what is PG doing when performing multiple
SET(
myfunc) and one
SETat the time (
myfunc_fix`)?
pg_hashids
was not udpated to latest. This solved the problem:
RUN apk add --no-cache --virtual .build-deps build-base postgresql-dev clang15 llvm15 ; \
wget -qO- https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz | tar xzf - -C /tmp && \
make -C /tmp/pg_hashids-cd0e1b31d52b394a0df64079406a14a4f7387cd6 && \
make -C /tmp/pg_hashids-cd0e1b31d52b394a0df64079406a14a4f7387cd6 install && \
rm -rf /tmp/pg_hashids-cd0e1b31d52b394a0df64079406a14a4f7387cd6 && \
apk del .build-deps
Hi,
I'm running a kubernetes instance of
15.4-alpine3.18
, with modified imageIMG_POSTGRES_TAG
added withpg_hashids
via followingDockerfile
:Deployed to the cluster with:
The issue is that a trigger function which generates hashes during insert, miss-behaves and generates a wrong hash ending with a space.
Reproduce it by running the following SQL:
Run it with:
cat test.sql | psq -U testdb
.Output looks like:
The issue is the space in the end of "zmnb ". Utilizing
myfunc_fix()
which basically runs separatedUPDATE
, works i.e. generates hashes without the trailing space. But I am not at all satisfied and I would like to understand what is the root cause?!?!I noticed the
WARNING: database "testdb" has no actual collation version, but a version was recorded
and I am not sure how that is realted (I do not really know what is the impact of that.Any help or ideas?
Cheers, DataSelfService team