Bug 43369 - Specific UI for collecting PostgreSQL connection settings
Summary: Specific UI for collecting PostgreSQL connection settings
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Keywords: difficultyInteresting, easyHack, skillCpp, skillVcl, topicUI
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
Reported: 2011-11-30 03:09 UTC by Lionel Elie Mamane
Modified: 2020-12-21 12:48 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:
Regression By:

screenshot of MySQL-specific UI (8.92 KB, image/png)
2011-11-30 03:09 UTC, Lionel Elie Mamane

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2011-11-30 03:09:14 UTC
Created attachment 53965 [details]
screenshot of MySQL-specific UI

When connecting to a PostgreSQL database (through PostgreSQL-SDBC driver), we currently just ask the user to type a conninfo string. That's familiar to PostgreSQL experts, but other people would benefit from some hand-holding.

Implement a PostgreSQL-specific UI to get the connection info, along the lines of the MySQL-specific UI we already have.

The file you need to change in LibreOffice is dbaccess/source/ui/dlg/ConnectionHelper.cxx, in function

   IMPL_LINK(OConnectionHelper, OnBrowseConnections, PushButton*, /*_pButton*/)

there is a big

        switch ( eType )

We need to add a case for PostgreSQL. You can take inspiration from the MySQL case.

You may also need to adapt ODbDataSourceAdministrationHelper::getConnectionURL() in file DbAdminImpl.cxx, as well as ODbTypeWizDialog::determineNextState in file dbwiz to activate a new state ADDITIONAL_PAGE_PGSQL, which you have to create first.

Finally, the dialog itself would be in file dbaccess/source/ui/dlg/dbadminsetup.src, in a to-be-created section TabPage PAGE_DBWIZARD_PGSQL.

You could just generate a conninfo string from that, but I'd prefer if you set it as properties of the datasouce/database/..., so that the driver gets it through the same interface as the username and password; cf handling of these for inspiration. There is already support for that in the driver, see connectivity/source/drivers/postgresql/pq_connection.cxx, function properties2arrays. POssibly you need to extend the handling there to support more keywords.

Please *also* allow advanced users to enter a conninfo string, and mixing of entering a conninfo string (like now) and information through widgets in the specific UI. See http://developer.postgresql.org/pgdocs/postgres/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS for an up-to-date list of all recognised connection settings. Make a decision on which of these settings make or do not make sense to give a friendly UI for.
Comment 1 Terrence Enger 2011-11-30 05:16:04 UTC Comment hidden (obsolete)
Comment 2 Lionel Elie Mamane 2011-11-30 05:28:47 UTC Comment hidden (no-value)
Comment 3 Terrence Enger 2011-11-30 05:48:22 UTC Comment hidden (no-value)
Comment 4 Björn Michaelsen 2013-10-04 18:47:47 UTC Comment hidden (no-value)
Comment 5 Alex Thurgood 2015-01-03 17:39:37 UTC Comment hidden (no-value)
Comment 6 Robinson Tryon (qubit) 2015-12-14 07:02:30 UTC Comment hidden (obsolete)
Comment 7 Robinson Tryon (qubit) 2016-02-18 14:52:31 UTC Comment hidden (obsolete)
Comment 8 kerem 2016-03-29 19:05:04 UTC
I sent following for this patch;

Comment 9 Lionel Elie Mamane 2016-04-04 08:08:17 UTC
You'll need to create new dialogs (.ui files) for that. This is done with a tool called "Glade", run from a shell after doing


You can use the ones we have for MySQL as inspiration:

Comment 10 Xisco Faulí 2020-03-09 13:28:56 UTC
Please add keyword 'needsUXEval' and CC 'libreoffice-ux-advise@lists.freedesktop.org' if input from UX is needed.
Comment 11 Alex Thurgood 2020-05-07 06:47:08 UTC
*** Bug 132476 has been marked as a duplicate of this bug. ***
Comment 12 Popa Adrian Marius 2020-12-21 12:48:57 UTC
Current Link for PQconnectdbParams https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS