Setting up postgreSQL

Forum Home Forums Understanding the Software Setting up postgreSQL

Tagged: 

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #17730
    WayneS
    Participant

    Greetings,

    I’m having trouble getting Rapid SCADA to save data in postgreSQL. I have created a database and tables called Historical, Current and Events. I have entered the database name, type, postgre as user and the password, but am still getting an error – What should the table names be, and any hints where to look.

    Many thanks

    #17735
    Mikhail
    Moderator

    Hello,
    It’s needed to create a database, while schema and tables will be created automatically.
    Please make screenshots of the corresponding settings and error.

    #17746
    WayneS
    Participant

    Hello,

    I found the initial issue – I had the user name wrong ‘postgres’ not ‘postgre’. So now I have a connection but still don’t have any data being saved in the database. I also don’t have log files associated with the modules i.e. ModDbExport.log etc. Perhaps something is wrong with my installation?

    I have followed the instructions in the documentation and created the query as per the link.

    The more I use Rapid SCADA the more I think this is a really great product 🙂

    regards

    #17748
    Mikhail
    Moderator

    Hello,
    Please provide screenshots of the settings related to the issue.

    #17751
    WayneS
    Participant

    Hi Mikhail,

    I’m halfway through comissioning a solar farm, which is using rapid_scada.

    Screenshots are here:postgre screenshots

    Queries use Query Text

    regards

    wayne

    #17752
    Mikhail
    Moderator

    Hi,
    In a query, copy only a particular query, not all SQL.
    Maybe, it is easier just enable PostgreSQL archives instead of using DB Export Module. It can be done in the Server – Archives section of the project.

    #17754
    WayneS
    Participant

    Hi,

    OK tried that and discovered that autheication isn’t working. 100% certain login name (postgres) and password are correct. Any suggestions

    From log file:

    2026-03-18 15:33:21 [RANUI-SOLAR][RANUI-SOLAR$][ERR] Error calling the MakeReady method of the HourCopy archive:
    Npgsql.PostgresException (0x80004005): 28P01: password authentication failed for user “postgres”
    at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
    at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
    at Npgsql.Internal.NpgsqlConnector.AuthenticateSASL(List`1 mechanisms, String username, Boolean async, CancellationToken cancellationToken)
    at Npgsql.Internal.NpgsqlConnector.Authenticate(String username, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
    at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|213_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
    at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
    at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
    at Npgsql.PoolingDataSource.<Get>g__RentAsync|33_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
    at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
    at Npgsql.NpgsqlConnection.Open()
    at Scada.Server.Modules.ModArcPostgreSql.Logic.PostgreHAL.CreateDbEntities()
    at Scada.Server.Modules.ModArcPostgreSql.Logic.PostgreHAL.MakeReady()
    at Scada.Server.Engine.ArchiveHolder.MakeReady()
    Exception data:
    Severity: FATAL
    SqlState: 28P01
    MessageText: password authentication failed for user “postgres”
    File: auth.c
    Line: 324
    Routine: auth_failed

    #17755
    Mikhail
    Moderator

    Hi,
    You should enable password auth for user ‘postgres’ by editing the PostgreSQL configuration files and executing some SQL commands. This is the typical issue. Try googling it.

    #17758
    WayneS
    Participant

    Thanks Mikhail,

    The settings were all OK for password auth. I tried changing to MD5 and trust, but made no difference. I also made a new user/password. I can connect to the database OK with either the postgres user or my new user using both pgadmin4 and dbvisualiser.

    Not sure where to go next?

    regards

    #17760
    WayneS
    Participant

    Hi Mikhail

    I found the issue. Regardless of what user/password you setup in the Server/module ModArcPostgreSQL Connection settings, rapid_scada uses postgres/postgres. If you change the database password to postgres it works.

    regards

    Wayne

    #17765
    Mikhail
    Moderator

    Hi,
    Thank you for the update.
    Such credentials are located in ScadaInstanceConfig.xml
    It is possible to setup the archive to use other login/password, but in most cases it is more convenient to set them in that single file.

    #17768
    WayneS
    Participant

    Hi

    And if you want to change the password in ScadaInstanceConfig.xml, how do you encode it? e.g. to user koolbeer123 as a password what do you put in the ScadaInstanceConfig.xml?

    regards

    Wayne

    #17771
    Mikhail
    Moderator

    Hi,

    In the Administrator app, Tools – Project Tools – Encrypt Password
    Note that the encryption is not for the Users table, because the table contains hashes (not passwords).

    #17800
    WayneS
    Participant

    Hi,

    The standard archives are working well and saving data to postgresql, however I can’t make the custom archive work and indeed if I change the name of the standard archives (e.g. hour/hourcopy to 30min/30mincopy) they stop working.

    I’m using the hour archive on a 30 minute period and it would be nice to make the name more accurate.

    Is it possible to make the custom archive work or to change the name of the standard archives?

    regards

    Wayne

    #17801
    Mikhail
    Moderator

    Hi,
    Let’s make the custom archive work!
    Note that you should add a custom archive with the same Code to the Server settings, and to the Archives table in the configuration database.
    If this has already been done, please send screenshots of the relevant settings.

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.