How to connect a card template to PostgreSQL

What you'll learn

Connect a card template to a table on a PostgreSQL server with the Database Wizard, link its columns to card objects, and show the records in Operating mode. The records stay on the server: eMedia Cards reads and writes them live.

Before you start

  • Standard Edition or higher. In Starter Edition, Next shows an upgrade note and the wizard does not continue.

  • Your own PostgreSQL server, with a database and a table that holds your card data. We can't provide a sample database: PostgreSQL is a server, not a file.

  • A PostgreSQL login: user name and password, with read rights on the table, and write rights to add, change or delete records.

  • The 64-bit psqlODBC driver on each PC that runs eMedia Cards. Download psqlodbc_x64.msi from odbc.postgresql.org and install it. You don't need to create an ODBC data source (DSN).

The screenshots use the Northwind Badges template, Northwind Badges.eccbak from How to export a full backup, and our test server on the same PC: Server: localhost, Database: emc_test, User ID: emc_rw. Use your own server, database, user name and password.

How to connect a PostgreSQL table to a template

  1. Open your template and switch to Design mode. Here: the Northwind Badges template, still connected to its Excel file.

  2. Click Tools > Connect to database.... If the message Database Connected appears, click Disconnect & Continue. The Database Wizard opens on step 1, Connection.

Northwind Badges template in Design mode with the Tools menu open on Connect to database...
  1. Under Select a database connection type:, click PostgreSQL.

  2. Click Next. Step 2, Configure Columns, opens on Connect to PostgreSQL:. The message PostgreSQL driver found shows the driver version.

Database Wizard, Connection step, with PostgreSQL (64-bit psqlODBC) selected under Select a database connection type:
  1. In Server:, type the name or IP address of the PostgreSQL server, for example badge-server. Here: localhost, because the server runs on the same PC.

  2. In Port:, keep 5432 unless your server uses another port.

  3. In Database:, type the database name. Here: emc_test.

  4. In User ID:, type your PostgreSQL user name. Here: emc_rw.

  5. In Password:, type your password. It shows as dots.

  6. In SSL:, keep Prefer. Choose Require if your server accepts encrypted connections only, or Off if it has no SSL.

  7. Click Test connection. The message shows the database, the server and the number of tables: here Connected to emc_test on localhost. 7 tables found.

Connect to PostgreSQL with Server: localhost, Port: 5432, Database: emc_test, User ID: emc_rw, the password as dots, SSL: Prefer, and the message Connected to emc_test on localhost. 7 tables found.
  1. In Source:, keep Table. The list also offers View and SQL.

  2. In Table:, choose your table. Here: northwind_badges. Tables of the public schema show their name only. Tables of another schema show schema.table, for example hr.contractors.

Table: list open on badges, departments, empty_badges, hr.contractors, northwind_badges, smoke_badges and Visitor Log
  1. In Key column:, choose the primary key of the table. Here: EmployeeID. Check this list: the wizard can propose another column, here Id.

  2. Check the Preview (first rows) table. It shows the first 10 rows, here the 8 Northwind badges.

  3. Click Next. Step 3, Operator Fields, opens.

Configure Columns step with Source: Table, Table: northwind_badges, Key column: EmployeeID and the Preview (first rows) table showing the 8 Northwind badges
  1. In the Display and Edit columns, untick the fields the operator must not see or change. Optional: under Operator permissions, untick Add records, Modify records or Delete records.

  2. Click Next. Step 4, Link & Summary, opens.

Operator Fields step with all eight columns ticked under Display and Edit, and Add records, Modify records and Delete records ticked under Operator permissions
  1. Check Connection:, Total columns: and Linked objects:. Here: PostgreSQL, 8 and 7. Each column whose name matches a card object is linked automatically. Id stays on (none): it is not shown on the card.

  2. Click Connect Data Source.

Link & Summary step with Connection: PostgreSQL, Total columns: 8, Linked objects: 7, Photo typed Image Path, and every column linked to the card object of the same name except Id on (none)
  1. Click View > Operating mode. The card and the records grid show the rows of the PostgreSQL table.

Operating mode with the Northwind badge of Marcus Bennett, Sales Lead, and the records grid listing the 8 rows read from the PostgreSQL table

Tips

  • The PostgreSQL table is the live database. Changes made in Operating mode are written to the server. Click Requery to read changes made by other users.

  • Columns named like the card objects are linked automatically.

  • Picture columns hold file names, such as NWB-01.jpg. eMedia Cards finds the files in the template's pictures folder.

  • The password is saved with the template's connection details.

  • The text after Could not connect: comes from the server or the driver. It can be in the server's language.

Common errors

Symptom Cause Fix
PostgreSQL ODBC driver not installed The psqlODBC driver is not installed on this PC. Click Download psqlODBC, install psqlodbc_x64.msi, then click Check again.
Only the 32-bit PostgreSQL driver is installed. eMedia Cards is a 64-bit app and needs the 64-bit psqlODBC driver (psqlodbc_x64.msi). Install it, then click Check again. Only the 32-bit driver is installed. Install psqlodbc_x64.msi, then click Check again.
Only the ANSI PostgreSQL driver is installed. eMedia Cards needs the Unicode driver, PostgreSQL Unicode(x64), from the same 64-bit psqlODBC package. Install it, then click Check again. The Unicode driver is missing. Install the full 64-bit psqlODBC package, then click Check again.
Could not connect: Connection refused. Is the server running on that host and accepting TCP/IP connections? Wrong Port:, or the PostgreSQL server is stopped or doesn't accept network connections. Check Port:, usually 5432. Ask your administrator to check the server.
Could not connect: timeout expired Wrong Server: address, or a firewall blocks the port. Check the server name or IP address. Ask your administrator to open the port in the firewall.
Could not connect: The user name or password is incorrect. Check them and try again. Wrong User ID: or Password:. Type the user name and your password again. User names are case-sensitive.
Could not connect:, followed by a message that the server refuses this PC or this user The server does not accept connections from this PC. Ask your administrator to allow this PC to connect.
Could not connect:, followed by a message about SSL The SSL: choice doesn't match the server. Choose Prefer. If the server accepts encrypted connections only, choose Require.
Could not connect:, followed by a message that the database does not exist The Database: name is wrong. Check the name and the case of the database.
Connected, but user emc_rw cannot see any tables in this database. Wrong database, or your login has no rights on its tables. Check Database:. Ask your administrator for read rights on the table.

Last reviewed: 2026-11-17