-
Hans Groeneveld
- PowerBuilder
- Thursday, 3 December 2026 09:51 AM UTC
Hi all,
We're moving a PowerBuilder ERP application from SAP SQL Anywhere to PostgreSQL. The database runs on-premise, on the customer's own server or PC. We've hit a problem we didn't have before, and we'd like to hear how others deal with it.
The issue: with SQL Anywhere, customers don't know the DBA password and can only reach the database through our application (plus a read-only user). With PostgreSQL, anyone with admin rights on the server can become superuser without a password, either by setting trust in pg_hba.conf or by starting the server in single-user mode. From there they can read and change everything: tables, data and the source of all our functions and stored procedures.
What we've found so far:
- Moving logic out of the database into a compiled middle layer (C#, Native AOT) means the customer can no longer change it. It doesn't keep it secret, though: the SQL it sends can be logged on the server, and the binary can be partly reverse-engineered.
- Commercial distributions (e.g. EDB) obfuscate procedure code and encrypt the files on disk. They don't protect against an admin with legitimate access.
- A locked-down VM or hosting the database ourselves would solve it. For our customer base, the cost and admin effort don't seem worth it, and over the internet our app is too chatty to perform well.
- What looks realistic: a contract clause, detecting schema changes, and a signed "heartbeat" stored outside the database so we can tell when it has been tampered with or restored from a copy.
Our questions:
- If you ship PostgreSQL on-premise, do you try to protect the database at all, or do you accept that the customer has full access?
- Do you keep business logic in PL/pgSQL, or move it into an application or middle tier?
- Do you have any practical experience with tamper detection, licence or contract terms, or commercial PostgreSQL variants in this context?
Thanks in advance for any experiences or pointers!
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.