Uploaded image for project: 'Apache HAWQ'
  1. Apache HAWQ
  2. HAWQ-982

PL/Python function with psycopg2 cannot connect to remote postgres

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: backlog
    • Component/s: Core
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              huor Ruilong Huo
              Reporter:
              lei_chang Lei Chang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: