treasure-data / prestogres

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

prestogres_init_database on every connection #47

Open agarstang opened 8 years ago

agarstang commented 8 years ago

I am having issues connecting after database has been initialised.

Prestogres connects without any errors on the initial connection and successfully initialises the database. However, on subsequent connections it appears to attempt to run prestogres_init_database again (which has now gone - as the init completed?).

I have tried this with all combinations of PostgreSQL 9.3 & 9.5 as well as Prestogres 0.6.7 and the latest master branch; all have the same result.

Configuration is as per the README. I am changing presto_server, presto_catalog, and presto_schema (this obviously works as I can login on initial connection and see all Schemas from Presto). I have added my remote host to prestogres_hba.conf as trusted to allow connection.

Any ideas would be appreciated.

LOG:  statement: create database "postgres"
ERROR:  database "postgres" already exists
STATEMENT:  create database "postgres"
LOG:  statement: create role "prestogres" with login
ERROR:  role "prestogres" already exists
STATEMENT:  create role "prestogres" with login
LOG:  statement: select prestogres_init_database('prestogres', 'postgres', E'host=\'127.0.0.1\' port=5432 dbname=\'postgres\' user=\'prestogres\' password=\'blahblag\'')
ERROR:  function prestogres_init_database(unknown, unknown, unknown) does not exist at character 8
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
STATEMENT:  select prestogres_init_database('prestogres', 'postgres', E'host=\'127.0.0.1\' port=5432 dbname=\'postgres\' user=\'prestogres\' password=\'blahblag\'')
2016-04-26 15:34:43: pid 16006: ERROR:  error while initializing database pg_database = "postgres" for pg_user = "prestogres": "ERROR:  function prestogres_init_database(unknown, unknown, unknown) does not exist
        LINE 1: select prestogres_init_database('prestogres', 'postgres', E'...
                       ^
        HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Thanks.

agarstang commented 8 years ago

48