How Do I Connect to a Postgresql Server Using Libreoffice Base?

How Do I Connect to a Postgresql Server Using Libreoffice Base?

I'm running into errors when I try to connect to a PostgreSQL server on the local machine using LibreOffice Base 3.5 (this applies to LibreOffice 4 as well):

The following syntax (localhost:5432=<database name>; database name worktime) doesn't work:

When I try to test the connection on the next page, I get the following error:

Error in database URL 'sdbc:postgresql:localhost:5432=localhost':
invalid connection option "localhost:5432"

What is the correct syntax for the datasource URL?

3

3 Answers

Ever Forward will answer your question:

This is not an Internet URL, but it functions similarly. You now need to tell LibreOffice to connect to a specific database on a specific computer:

dbname=mydb host=localhost

Use the name of your database in the dbname part. I used localhost for the host part, since PostgreSQL is on the same computer, but I would need to change that in the event that I want to connect from a remote computer.

0

I know this Q is answered.. but here is more data information for someone who may stumble across this topic.

Another form of datasource URL is in the format of:

dbname=postgres hostaddr=127.0.0.1 port=5433 user=db_user password=libreoffice

I needed the above, because the default port used by LibreBase is 5432, but I needed 5433.

This URL format is discussed at

As I read here:

Like me, this workaround can help you
Go to
Edit->Database->Properties... and
Edit->Database->Connection Type...

Set something like this (according to your values):

postgresql://localhost:5432/mydb

Explanation
host = localhost
port = 5432
database to connect = mydb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.