Solid Edge SEWHD - How to run an SQL script against a Postgres embedded database

2022-08-01T17:17:23Z
APPLICATION

Summary


Details

This article will describe how to run an SQL  script against an embedded (Postgres) database for Solid Edge Wiring and Harness Design

While logged into Solid Edge Wiring and Harness Design server, the following steps will describe how to execute an SQL script against an embedded database from within a DOS window .

Solution

Navigate to %Solid Edge Wiring and Harness Design_Home%\embeddeddb\bin

The following is an example of the command used to run a script against a Solid Edge Wiring and Harness Design 2022 postgres database and record the results to a file named output.txt:

psql -h localhost -p 5472 -U electrical2022 -W -f C:\sqlscriptname.sql > C:\output.txt

Description of arguments used and what values they require:

-h hostname

-p port number

-W (this will cause the command to prompt the user for the password to connect to the database)

-U username (this is the owner of the Capital or VeSys schema)

-f directory path and sql_filename

The following image shows an example of managerprops.xml from the %Solid Edge Wiring and Harness Design_Home%\config folder.

The file contains the host name and port used for arguments -h , -p, and -W . When the command is run the user will be prompted to enter the password to connect to the database.  The default password is shown in the image below.


Notes

The passwords in the managerprops.xml may be encrypted.  You will need to enter the unencrypted value.

Do not copy and paste the command, always type the command into the cmd window.  When copy and paste is used the dash character gets converted to the longer dash character, causing the command to fail.

KB Article ID# PL8651750

Contents

SummaryDetails

Associated Components

APPLICATION: SE_ELECTRICAL