Обсуждение: PgAdmin3 1.8.0 Beta 3 r 6606 bug

Поиск
Список
Период
Сортировка

PgAdmin3 1.8.0 Beta 3 r 6606 bug

От
"Luiz K. Matsumura"
Дата:
Hi,
I downloaded the last snapshot on Dave page (svn rev 6606).
This version don't work with postgres 8.1 and 8.0.
I think that error is caused by a modification in pgDatabase.c
I try to find an equivalent query but I not sure if this is correct,
please see if this will work fine.

Hope this can help.

Regards

--
Luiz K. Matsumura
Plan IT Tecnologia Informática Ltda.

Index: H:/svn/pgadmin3/pgadmin3/pgadmin/schema/pgDatabase.cpp
===================================================================
--- H:/svn/pgadmin3/pgadmin3/pgadmin/schema/pgDatabase.cpp    (revision 6607)
+++ H:/svn/pgadmin3/pgadmin3/pgadmin/schema/pgDatabase.cpp    (working copy)
@@ -492,8 +492,8 @@
            wxT("SELECT db.oid, datname, spcname, datallowconn, datconfig, datacl, ")
            wxT("pg_encoding_to_char(encoding) AS serverencoding, pg_get_userbyid(datdba) AS datowner,")
            wxT("has_database_privilege(db.oid, 'CREATE') as cancreate, \n")
-           wxT("(select setting AS default_tablespace from pg_show_all_settings() x(name text, setting text, unit
text,category text, short_desc text, extra_desc text, context text, vartype text, source text, min_val text, max_val
text)where name = 'default_tablespace') AS default_tablespace\n") 
-           wxT("  FROM pg_database db\n")
+           wxT("select current_setting('default_tablespace') AS default_tablespace\n")
+           wxT("  FROM pg_database db\n")
            wxT("  LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace=ta.OID\n")
            + restr +
            wxT(" ORDER BY datname"));

Re: PgAdmin3 1.8.0 Beta 3 r 6606 bug

От
Dave Page
Дата:
Luiz K. Matsumura wrote:
> Hi,
> I downloaded the last snapshot on Dave page (svn rev 6606).
> This version don't work with postgres 8.1 and 8.0.
> I think that error is caused by a modification in pgDatabase.c
> I try to find an equivalent query but I not sure if this is correct,
> please see if this will work fine.
>

There's an extra 'select' in your patch which I removed, but otherwise,
yes, thats good. I was looking for 'current_setting()' yesterday but
couldn't find it - probably because we have:

set_config()
current_setting()
pg_show_all_settings()

which couldn't be more different in naming styles if they tried!

Thanks, Dave.


Re: PgAdmin3 1.8.0 Beta 3 r 6606 bug

От
"Luiz K. Matsumura"
Дата:
Dave Page wrote:
> set_config()
> current_setting()
> pg_show_all_settings()
>
> which couldn't be more different in naming styles if they tried!
>
>   
Yes, and I as we say here in Brazil:

"Paguei um mico"

I don't know how to translate, but is something like "to be with shame" 
(google translation)
I search by 1 hour for this function and don't find nothing. Then I send 
a suggestion to pg list
to include a get_config() function and Alvaro Herrera show me that's
this already exists as current_setting() function.

Thanks to Alvaro.

-- 
Luiz K. Matsumura
Plan IT Tecnologia Informática Ltda.