Can sоmеbody explain me what to write in the "service" box when connecting to the local DB.
QGIS Lisboa and Postgres are installed.
What does the “service” box in the PostGIS connection dialog stand for?:
The service entry allows you to specify a service file that contains the connection parameters needed to access a certain postgresql database.
By having a service file, you can then ignore having to enter other details like database, host, port, user and password.
Can sоmеbody explain me what to write in the "service" box when connecting to the local DB.:
So unless you've got some service files made up, you don't need to enter anything - leave it blank.
I use service files so that individuals who couldn't be bothered to remember server details can easily connect when needed. It's easier for me to say, "please enter xyz into the service box and press OK."
There's also the option to save those connection details to an xml file from QGIS using the "save/load" buttons from the initial "Add PostGIS Layer" screen.
I usually keep it empty.
You just need to enter a Name for the connection, Host (either IP or hostname of the database server), Posrt, Database, userName and password.
That is more than sufficient to connect to the PostGIS database.
check your pg_hba.conf allows you to connect
In your postgres-directory(e.g. C:\Program Files\PostgreSQL\9.3\ ) you will find a subdirectory called "share". There you can find the sample-file "pg_service.conf.sample". Create a Service-Definition here like this:
Save this file as ".pg_service.conf" (the dot at the beginning of the filename is important!) and copy it to %APPDATA%\postgresql\ (you can past this path into Windows-Explorer). You will end up in a folder like C:\Users\thomas\AppData\Roaming\postgresql
Restart the PostgreSQL-Service to reload the configuration.
Now you can create a new PostGIS-Connection in QGIS just by using a service name.
Tested on a Win7 machine and works like a charme. Very useful if you want to switch from testing- to production-database-server without having to change the QGIS-Project-Files. Just change the connection parameters in the service file and there you are.
best wishes, Thomas