Using PostGreSQL on a windows platform

507 views
Skip to first unread message

Adam Kessler

unread,
Sep 1, 2018, 8:43:02 AM9/1/18
to Orthanc Users
Folks,
I have tried every possible thing I can think of to get the PostGreSQL to operate on my windows platform and nothing works.

It fails every time. I used the --upgrade command and it can't find the PostGreSQL instance. I am only trying to use the indexing and it fails miserably.

Obviously I am either missing something or this just does not work.

I followed every piece of information I can find in the book and none of it helps.  Please, for the love of God, someone explaain how this is supposed to work and explain it for idiots like me who will never touch a Linux server.

I am running the most recent 64 bit version of Orthanc 18.x.x. which supposedly comes with 64 bit .dlls for the SQL stuff.  I tried using MySQL with the same results.  something is drastically wrong.

PLEASE HELP!

Rana Asim Wajid

unread,
Sep 1, 2018, 11:38:24 AM9/1/18
to Orthanc Users
share your config file

Adam Kessler

unread,
Sep 1, 2018, 12:08:43 PM9/1/18
to Orthanc Users
{
    /**
     * Configuration to use PostgreSQL instead of the default SQLite
     * back-end of Orthanc. You will have to install the
     * "orthanc-postgresql" package to take advantage of this feature.
     **/
    "PostgreSQL" : {
        // Enable the use of PostgreSQL to store the Orthanc index?
        "EnableIndex" : true,

        // Enable the use of PostgreSQL to store the DICOM files?
        "EnableStorage" : false,

        // Option 1: Specify explicit authentication parameters
        "Host" : "localhost",
        "Port" : 5432,
        "Database" : "orthanc",
        "Username" : "orthanc",
        "Password" : "orthanc",

        // Option 2: Authenticate using PostgreSQL connection URI
        // "ConnectionUri" : "postgresql://orthanc:ort...@127.0.0.1:5432/orthanc_db",

        // Optional: Disable the locking of the PostgreSQL database
        "Lock" : true
Message has been deleted

Sébastien Jodogne

unread,
Sep 3, 2018, 7:29:05 AM9/3/18
to Orthanc Users


On Saturday, September 1, 2018 at 6:08:43 PM UTC+2, Adam Kessler wrote:
{
    /**
     * Configuration to use PostgreSQL instead of the default SQLite
     * back-end of Orthanc. You will have to install the
     * "orthanc-postgresql" package to take advantage of this feature.
     **/
    "PostgreSQL" : {
        // Enable the use of PostgreSQL to store the Orthanc index?
        "EnableIndex" : true,

        // Enable the use of PostgreSQL to store the DICOM files?
        "EnableStorage" : false,

        // Option 1: Specify explicit authentication parameters
        "Host" : "localhost",
        "Port" : 5432,
        "Database" : "orthanc",
        "Username" : "orthanc",
        "Password" : "orthanc",

        // Option 2: Authenticate using PostgreSQL connection URI
        // "ConnectionUri" : "postgresql://orthanc:orthanc@127.0.0.1:5432/orthanc_db",

Adam Kessler

unread,
Sep 3, 2018, 10:25:27 AM9/3/18
to Orthanc Users
I ran this according to the instructions (See attached).  One using my orthanc.json and the other against the PostgreSQL json. Not sure if there is a difference.
The dated log file is the production log when attempting to use PostGreSQL using the Index only.
Orthanc_Postgre.log
Orthanc.log
Orthanc.log.20180901-084036.2488

Sébastien Jodogne

unread,
Sep 3, 2018, 10:36:00 AM9/3/18
to Orthanc Users
Your "Orthanc.log.20180901-084036.2488" file contains the following error:

E0901 08:40:39.133726 PluginsManager.cpp:164] PostgreSQL error: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?

As a consequence, this is not an issue in Orthanc. Please review the configuration of your PostgreSQL server:

Regards,
Sébastien-

Adam Kessler

unread,
Sep 3, 2018, 12:11:24 PM9/3/18
to Orthanc Users
Yes. It is all on the localhost. I understand that means it is not affected by the firewall settings.

My question would then be what server is it trying to connect to? PostGre SQL or Orthanc.  And if this error is referring to Orthanc, why is it not the default of 4242? That it is on a different port would seem to indicate it is a different service it is trying to authenticate to (aka PostGreSQL). Maybe I am just thick or just stupid, but I am not following your logic here.

Sébastien Jodogne

unread,
Sep 3, 2018, 3:27:49 PM9/3/18
to Orthanc Users
Before trying to combine Orthanc and PostgreSQL, you should first learn how to use PostgreSQL alone.

There are plenty PostgreSQL tutorials available, e.g.:

In a nutshell, "5432" is the TCP port PostgreSQL is listening for SQL commands (among which those issued by Orthanc), whereas "4242" is the TCP port Orthanc is listening for DICOM commands. 
Reply all
Reply to author
Forward
0 new messages