Uncalled CREATE OR REPLACE VIEW in privileges dialog

Поиск
Список
Период
Сортировка
От Erwin Brandstetter
Тема Uncalled CREATE OR REPLACE VIEW in privileges dialog
Дата
Msg-id 4D238211.7050507@gmx.at
обсуждение исходный текст
Ответы Re: Uncalled CREATE OR REPLACE VIEW in privileges dialog  (Guillaume Lelarge <guillaume@lelarge.info>)
Список 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

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: "pgAdmin Trac"
Дата:
Сообщение: [pgAdmin III] #296: Uncalled CREATE OR REPLACE VIEW in privileges dialog
Следующее
От: Erwin Brandstetter
Дата:
Сообщение: Re: Source reindenting