Uncalled CREATE OR REPLACE VIEW in privileges dialog

From: Erwin Brandstetter <brsa(at)gmx(dot)at>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Uncalled CREATE OR REPLACE VIEW in privileges dialog
Date: 2011-01-04 20:24:49
Message-ID: 4D238211.7050507@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi developers!

My best wishes for 2011 to the pgAdmin team! :)

Testing v.1.12.2 (Dec 13 2010) on Windows XP Pro, Server PostgreSQL
8.4.5 on Debian Lenny.
I found some weirdness in the privileges dialog for VIEWs.

On changing any privileges via dialog, the VIEW itself gets CREATE OR
REPLACEd in addition. That's uncalled for.
As long as the used SQL is free of mistakes, this will probably go
unnoticed by most. It is still a waste of CPU cycles - and a problem
waiting to happen.
Reproducibly every time.
The matching dialog for TABLEs seems ok.
Problem is also present in v.1.10

I have created a track ticket accordingly: #296
I skipped the e-mail to the list and just filed the ticket in trac with
a couple of issues recently as I did not feel the need for more details.
I hope that is acceptable protocol ...

Testcase:
~~~~~~~~
CREATE TABLE bar( id integer, foo text);
CREATE VIEW v_test AS SELECT b.foo FROM bar b;

-- Now change any privileges via properties dialog. Check the Definition
and SQL tabs before and after making changes.
-- After revoking ALL from public, the SQL tab reads:
CREATE OR REPLACE VIEW v_test AS
SELECT b.foo
FROM bar b;; -- also note the two ";"! does not do anything,
but possibly points to weirdness in the source code!
REVOKE ALL ON TABLE v_test FROM public;

And that's what actually gets sent to the server, as the server log shows:
...
postgres LOG: Anweisung: SELECT xmin FROM pg_class WHERE oid = 335878::oid
postgres LOG: Anweisung: CREATE OR REPLACE VIEW v_test AS
SELECT b.foo
FROM bar b;;
REVOKE ALL ON TABLE v_test FROM public;
...

Regards
Erwin

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Erwin Brandstetter 2011-01-04 20:54:47 Re: Source reindenting
Previous Message pgAdmin Trac 2011-01-04 20:23:17 [pgAdmin III] #296: Uncalled CREATE OR REPLACE VIEW in privileges dialog