treasure-data / prestogres

PostgreSQL protocol gateway for Presto distributed SQL query engine
Other
292 stars 61 forks source link

"\d" and "\l" don't work at prestogres 0.4.8 #14

Closed wyukawa closed 10 years ago

wyukawa commented 10 years ago

Hi.

I try to use prestogres 0.4.8 and presto 0.73 at Centos 6.5, but "\d" and "\l" don't work.

$ psql -h localhost -p 9990 -U pg default
psql (9.3.4)
Type "help" for help.

default=# \d
ERROR:  function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist
default=# \l
ERROR:  function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist

pgdata/postgres/pg_log/postgresql-Fri.log

< 2014-07-25 17:52:31.501 JST >ERROR:  function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist at character 8
< 2014-07-25 17:52:31.501 JST >HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
< 2014-07-25 17:52:31.501 JST >STATEMENT:  select prestogres_catalog.run_system_catalog_as_temp_table(E'localhost:8080', E'pg', E'hive', E'default', E'pg', E'default', E'presto_result', E'SELECT n.nspname as "Schema",
          c.relname as "Name",
          CASE c.relkind WHEN \'r\' THEN \'table\' WHEN \'v\' THEN \'view\' WHEN \'m\' THEN \'materialized view\' WHEN \'i\' THEN \'index\' WHEN \'S\' THEN \'sequence\' WHEN \'s\' THEN \'special\' WHEN \'f\' THEN \'foreign table\' END as "Type",
          pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
        FROM pg_catalog.pg_class c
             LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
        WHERE c.relkind IN (\'r\',\'v\',\'m\',\'S\',\'f\',\'\')
              AND n.nspname <> \'pg_catalog\'
              AND n.nspname <> \'information_schema\'
              AND n.nspname !~ \'^pg_toast\'
          AND pg_catalog.pg_table_is_visible(c.oid)
        ORDER BY 1,2;')
< 2014-07-25 17:52:31.502 JST >ERROR:  function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist
< 2014-07-25 17:52:31.502 JST >STATEMENT:  do $$ begin raise exception '%', E'function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist' using errcode = E'42883'; end $$ language plpgsql
< 2014-07-25 17:52:32.944 JST >ERROR:  function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist at character 8
< 2014-07-25 17:52:32.944 JST >HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
< 2014-07-25 17:52:32.944 JST >STATEMENT:  select prestogres_catalog.run_system_catalog_as_temp_table(E'localhost:8080', E'pg', E'hive', E'default', E'pg', E'default', E'presto_result', E'SELECT d.datname as "Name",
               pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
               pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
               d.datcollate as "Collate",
               d.datctype as "Ctype",
               pg_catalog.array_to_string(d.datacl, E\'\\n\') AS "Access privileges"
        FROM pg_catalog.pg_database d
        ORDER BY 1;')
< 2014-07-25 17:52:32.944 JST >ERROR:  function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist
< 2014-07-25 17:52:32.944 JST >STATEMENT:  do $$ begin raise exception '%', E'function prestogres_catalog.run_system_catalog_as_temp_table(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist' using errcode = E'42883'; end $$ language plpgsql
frsyuki commented 10 years ago

Because prestogres v0.4.8 changed internal function declaration, you need to recreate PostgreSQL data directory (prestogres -D pgdata setup). There're no migration scripts at this moment, unfortunately.

wyukawa commented 10 years ago

OK. Thanks!

frsyuki commented 10 years ago

Please reopen this issue if still doesn't work :-)