Back

Topic

[KB1250]Postgres provider tutorial using  Npgsql provider

Tags: Database, Provider

2 months ago
By PADJ
Options
Print
Applies to:
PcVue 16 onwards
Summary:
This article will help you to communicate PcVue with the PostgreSQL database
Details:

PostgreSQL is “the world’s most advanced open-source relational database”. It’s made by PostgreSQL Global Development Group.

Unfortunately, PostgreSQL like some open source projects such as  Maria DB  does not offer a ready to use ADO.NET provider.

Once the binaries are obtained it is possible to install a third party provider with the tool : “ProviderInstaller.exe”.

To be detected by PcVue, each ADO.NET provider must be installed in the Global Assembly Cache (GAC) of the .NET framework and referenced in the machine.config file. The tool “ProviderInstaller.exe” is there to facilitate this task.

— How to install PostgreSQL ADO.NET Provider —

1. Download Attachment “Npgsql 8.0.7 install.zip”

2. Extract “Npgsql 8.0.7 install.zip” to “Npgsql 8.0.7 install”

3. Open CMD prompt as Administrator

4. Change directory to be in “Npgsql 8.0.7 install” directory

cd “C:\Users\Dev\Desktop\Npgsql 8.0.7 install”

5. Run following command:

ProviderInstaller.exe /install

CMD Prompt

6. Restart your computer and then PcVue

— How to configure a PostgreSQL connection in PcVue —

1. At PcVue side, with Application Explorer, navigate to General > Data connections

2. Add a new SQL Connection as below

POSTGRE SQL CONNECTIONs
POSTGRE SQL CONNECTIONss

The connection string should be as below :

Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=******************************

Fill these informations in according to your database connection informations.

Like that you can get a successful connect to your postgres database server by clicking on test connection button.  

— Some usuals Sql queries —

.Create a table

CREATE TABLE MyTable (col1 INT)

POSTGRE SQL READ QUERY

. Insert a value

INSERT INTO MyTable (col1) VALUES (1)

. Display table content

SELECT * FROM public.mytable 

Attached fileDescription
Npgsql 8.0.7 install.zipNpgsql 8.0.7 install

Created on: 22 Jul 2025 Last update: 05 Sep 2025