Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LZ4 is configured during compilation, but not available when querying the docker container #1191

Open
Dutchgoose opened this issue Feb 6, 2024 · 1 comment

Comments

@Dutchgoose
Copy link

Hello,

I am using the 16-alpine image for a docker container. I am using alpine specifically because lz4 appears to be enabled during compilation of the docker image. However, when I connect to the docker container and write SQL that depends on lz4 I get this error:

ERROR:  compression method lz4 not supported
DETAIL:  This functionality requires the server to be built with lz4 support.
HINT:  You need to rebuild PostgreSQL using --with-lz4.
SQL state: 0A000

However, in the dockerfile, LZ4 compression is enabled

--with-lz4 \

Here is an example SQL query I am trying to run:

CREATE TABLE my_table (
    ...
    id bigint GENERATED ALWAYS AS IDENTITY,
    data text COMPRESSION lz4,
    ...
);

Is there some additional configuration I need to pass into the docker container?
Here is a snippet of the docker-compose

postgres:
    image: postgres:16-alpine
    container_name: my_postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: postgres
    volumes:
      - type: bind
        source: ../..
        target: /my_dir
    ports:
      - "5432:5432"

I have also downgraded and tried with 15.5-alpine.

@tianon
Copy link
Member

tianon commented Feb 6, 2024

I can't actually reproduce. 😅

I tried literally your CREATE TABLE verbatim on postgres:16-alpine and it succeeded:

CREATE TABLE my_table (
    id bigint GENERATED ALWAYS AS IDENTITY,
    data text COMPRESSION lz4
);
$ docker run -it --rm --name foo --env POSTGRES_PASSWORD=... postgres:16-alpine
...
$ docker exec -it foo psql -U postgres
psql (16.1)
Type "help" for help.

postgres=# CREATE TABLE my_table (
postgres(#     id bigint GENERATED ALWAYS AS IDENTITY,
postgres(#     data text COMPRESSION lz4
postgres(# );
CREATE TABLE
postgres=# 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants