Re: Problem with pl/python procedure connecting to the internet

From: s d <daku(dot)sandor(at)gmail(dot)com>
To: Igor Sosa Mayor <joseleopoldo1792(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with pl/python procedure connecting to the internet
Date: 2015-08-23 14:34:00
Message-ID: CAKyoTgarr+TSpe2cbUM1Lis-XaCriW2unjFFSk87q7Hpr-_u2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It might be a dumb thought, but...
Did you run the script from ipython as postgres user?
External programs called by triggers run as postgres, and maybe your
postgres user doesn't have rights to reach the remote service.

Regards,
Sandor

On 23 August 2015 at 09:09, Igor Sosa Mayor <joseleopoldo1792(at)gmail(dot)com>
wrote:

> "Charles Clavadetscher" <clavadetscher(at)swisspug(dot)org> writes:
>
> > Are you sure that you really use exactly the same code? The indication
> > "survice unknown" seems to point to an error in the URL and not to an
> > authorization problem. Maybe some encoding problem?
>
> THnaks for your hints.
>
> Yes, exactly the same code. Exactly the same query: two consoles, one
> with postgres, other with ipython. Postgres gives the error; ipython
> works.
>
> > The irritating thing is that you mention that it works sometimes and
> > sometimes not. Getting back to the encoding problem idea, is there a
> > difference if you call the function with a name containing special
> > characters (e.g. "é", "à", "ñ") or not?
>
> No special characters in the query. To be honest: it worked only 2-3
> times at work and I thought 'finally I managed to do it work'. But since
> then, it is not working anymore...
>
> In any case: I'm pretty sure it is a problem of postgres which is not
> able to make the connection. If I put a parameter timeout=15,
> postgres gives immediately the same error.
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2015-08-23 14:45:50 Re: 9.5 beta pg_upgrade documentation
Previous Message Adrian Klaver 2015-08-23 14:29:09 Re: Problem with pl/python procedure connecting to the internet