Building Minetest with Postgres support

Post Reply
User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

Building Minetest with Postgres support

by webdesigner97 » Post

I'm trying to build Minetest with Postgres support using the following Dockerfile. The postgres part is based on this post.

Code: Select all

FROM ubuntu:16.04

RUN apt update && apt install -y build-essential cmake wget libirrlicht-dev libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libpq-dev postgresql-client postgresql-server-dev-9.5

RUN wget https://github.com/minetest/minetest/archive/0.4.16.tar.gz && \
	tar xf 0.4.16.tar.gz \
	&& mv minetest-0.4.16 ./minetest && \
	rm 0.4.16.tar.gz

RUN wget https://github.com/minetest/minetest_game/archive/master.tar.gz \
	&& tar xf master.tar.gz && \
	mv minetest_game-master ./minetest/games/minetest_game && \
	rm master.tar.gz

WORKDIR /minetest
RUN cmake . \
	-DRUN_IN_PLACE=TRUE \
	-DENABLE_CURL=TRUE \
	-DBUILD_SERVER=TRUE \
	-DBUILD_CLIENT=FALSE \
	-DENABLE_POSTGRESQL=TRUE

RUN make -j $(nproc)

(...)
It compiles just fine, but when starting a world with postgres, the game exits telling me that postgres is not supported:

world.mt

Code: Select all

enable_damage = false
backend = postgresql
gameid = minetest
creative_mode = true
player_backend = postgresql

pgsql_connection = host=pgsql user=xxxxxxpassword=xxxxxx dbname=mt-world
pgsql_player_connection = host=pgsql user=xxxxxxpassword=xxxxxx dbname=mt-players
Minetest log

Code: Select all

minetest_1  | 2017-08-07 19:21:35: [Main]: Automatically selecting world at [/minetest/bin/../worlds/world]
minetest_1  | 2017-08-07 19:21:35: ERROR[Main]: An unhandled exception occurred: Database backend postgresql not supported.
minetest_1  | 2017-08-07 19:21:35: ERROR[Main]: In thread 7f2a00e4b800:
minetest_1  | 2017-08-07 19:21:35: ERROR[Main]: /minetest/src/main.cpp:e2: int main(int, char**): A fatal error occured: Database backend postgresql not supported.
minetest_1  | 2017-08-07 19:21:35: ERROR[Main]: Debug stacks:
minetest_1  | 2017-08-07 19:21:35: ERROR[Main]: DEBUG STACK FOR THREAD 7f2a00e4b800: 
minetest_1  | 2017-08-07 19:21:35: ERROR[Main]: #0  int main(int, char**)
Is it the backend name in world.mt? There doesn't seem to be documentation of which strings are allowed as backends. I tried postgresql, postgres and pgsql. None of them work. What am I doing wrong?

User avatar
mr_chicken
Member
Posts: 37
Joined: Sat Sep 07, 2019 07:18
GitHub: root
IRC: Doris Day
In-game: Faded_Glory Rex_2000
Location: Here
Contact:

Re: Building Minetest with Postgres support

by mr_chicken » Post

Did you figure it out or did you just get older
Playing minnoye ispytaniye on a Агат II, driving a Лaдa that goes 300 hectares on a single tank of kerosene

User avatar
Blockhead
Member
Posts: 1673
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Building Minetest with Postgres support

by Blockhead » Post

You shouldn't need to include the password information unless the database isn't on the same system as the Minetest server. If they're on the same system it will work with peer authentication. For instance if you make a UNIX user called minetest and set up that user's default database, you should only need these lines in world.mt:

Code: Select all

backend = postgresql
pgsql_connection=user=minetest dbname=minetest
The user minetest would then also be the owner of the minetestserver process.

I suspect PostgreSQL support didn't actually successfully compile for OP.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests