Function dbd_list_tables uses incorrect query to seach for tables. To retrieve relation owner OID it uses following subquery 'SELECT datdba FROM pg_database WHERE datname = ?' which is return only one (DBA) user however database may containt hudreds of users.
One way to solve ther problem use following subquery. It returns OID of the currently connected user
'SELECT usesysid FROM pg_user WHERE usename = user'
where 'user' built-in function wich returns currently connected user.
Another option use information schema for searching tables
ex. select * from information_schema.tables where table_name like <tabpattern>
This problem affects app-office/gnucash-2.4.5 when I use PostgreSQL database backend. gnucash refuses work with database on subsequent runs.
Steps to Reproduce:
1. Run gnucash
2. Save work to PG database and close application
3. Run it again and open previously saved work
gnucash complains and refuses saving changes
Created attachment 272543 [details, diff]
a bit changed query that solves the problem
All this problems should be solved in 0.9