Ask Your Question
1

Generic form of URL for PostgreSQL [closed]

asked 2012-02-24 15:06:26 +0200

Olivier gravatar image

updated 2012-02-24 15:07:01 +0200

Hi

The help does says nothing, so how do we specify the postgreSQL URL in the second page of the new database wizzard?

It has to be something like <protocol>://<url>:<port>

Thanks

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-17 22:56:51.928918

Comments

Hi @Olivier, did @LiboV answer your question? If so, please mark his answer as correct. Thanks!

qubit gravatar imagequbit ( 2013-01-20 01:18:02 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2012-02-24 16:06:32 +0200

LiboV gravatar image

updated 2012-02-24 16:28:15 +0200

With the native postgreSQL connector the connection string is a little different. It is not a URL at all, but rather just a text string made up of propertyname=value segments, separated by a space.

The required fields (properties) are, database name and host (or hostaddr). If the postgreSQL database is using a non standard port (5432) then that must be included also.

So, if I want to connect to a database, using the default postgres configuration, named postgres on my local machine the simplest connection string would be: dbname=postgres host=localhost

Now let's say that there is an older postgres engine running using the standard 5432 port and I want to connect to a newer one using port 5433, and that I want to connect with my user name db_user, with a password of libreoffice and I don't want to type that password in each time I connect, then the connection string might look like:

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

Note that I've used the hostaddr, instead of host here, bypassing any need to do a DNS lookup.

Finally, with the native connector all options in the connection string are accepted - you can find a full list of those here: PostgreSQl 9.1 Docs Just remember that it is propertyName=value separated by spaces in Base.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-02-24 15:06:26 +0200

Seen: 13,877 times

Last updated: Sep 04 '12