Fix for Slony replication issue in pgAdmin

From: Neel Patel <neel(dot)patel(at)enterprisedb(dot)com>
To: Dave Page <dave(dot)page(at)enterprisedb(dot)com>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Fix for Slony replication issue in pgAdmin
Date: 2013-09-17 12:38:25
Message-ID: CAMcbDBFM28RPWxZPtPq_dqGh33ux-Kktr89u2WRGXgzOwbo-Ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Dave,

Please find the attached patch file for fix of below slony issue.

Follow the below steps after creating the set up of slony replication with
cluster name "slonycluster2".

1. Open pgAdmin
2. Go to database --> Slony Replication --> "slonycluster2" -->
"Replication Sets" --> "slony tables" --> "Tables"
3. Click on any one of the table
4. Error will come.

After following the above steps it shows the below error.

ERROR: relation "public.pgbench_accounts" does not exist at character 93

*Analysis:-*

After going through the code in pgadmin/slony/slTable.cpp it is executing
the below query to display the triggers in properties tab and in SQL Pane
window and gets failed because there is no table "pgbench_account" and
"pgbench_accounts" table will be crated by using the pgbench utility.

SELECT tgname AS trig_tgname FROM pg_trigger t, pg_proc p, pg_namespace n
WHERE t.tgrelid = 'public.pgbench_accounts'::regclass AND t.tgfoid = p.oid
AND n.nspname = '_slonycluster2'

So there should not be any dependency of pgbench utility.

To fix the issue we have changed the query as below to display the triggers
in properties and SQL pane window.

SELECT tgname AS trig_tgname FROM pg_trigger t, pg_proc p, pg_namespace n
WHERE t.tgfoid = p.oid AND p.pronamespace = n.oid AND n.nspname =
'_slonycluster2';

Please let me know for any modification.

Thanks,
Neel Patel

Attachment Content-Type Size
SlonyFix.patch application/octet-stream 979 bytes

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Linreg 2013-09-17 13:59:04 Re: pgAgent: C++ Port - Patch Review
Previous Message Dave Page 2013-09-16 10:32:02 Re: pgAgent: C++ Port - Patch Review