hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lei Chang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HAWQ-982) PL/Python with psycopg2 cannot connect to remote postgres
Date Fri, 05 Aug 2016 09:39:20 GMT
Lei Chang created HAWQ-982:
------------------------------

             Summary: PL/Python with psycopg2 cannot connect to remote postgres
                 Key: HAWQ-982
                 URL: https://issues.apache.org/jira/browse/HAWQ-982
             Project: Apache HAWQ
          Issue Type: Bug
          Components: Core
            Reporter: Lei Chang
            Assignee: Lei Chang



For one use case I want to connect to external postgreSQL database from HAWQ PL/Python procedure.
I use python psycopg2 library.
Remote postgreSQL server reject connecion from HAWQ  with 
this error :  FATAL  unsupported frontend protocol 28675.0: server supports 1.0 to 3.0.
The same python code is running well from OS level.

I wonder if  it is  HAWQ or PostgreSQL PL/Python interpreter related issiue.
Any help or pointers would be great.

-----------------------
my code below:

CREATE OR REPLACE FUNCTION dchoma.connection_test( ) RETURNS text AS
$$
import psycopg2

try:
    conn = psycopg2.connect("dbname='database_name' user='user' host='remote_host' password='pass'
port=5432")
    return "Connection successful "
except Exception , msg :
    return "Exception: {m}".format(m=msg)
$$
LANGUAGE 'plpythonu' VOLATILE;

select * from dchoma.connection_test();


HAWQ version 2.0.1.0 build dev ( compiled from github)
Remote database version:  PostgreSQL 9.2.15 on x86_64-redhat-linux-gnu, compiled by gcc (GCC)
4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
OS: CentOS 7-1511

i found similar issiue here, but the problem is not solved.
https://discuss.zendesk.com/hc/en-us/community/posts/200793368-greenplum-dblink-postgresql-remote-is-error




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message