Thread: Messed up dblink...

Messed up dblink...

From
Jerry LeVan
Date:
Something seems to have messed up my dblink interface...

The only thing I can think that has changed the last week
was the installation of 8.3.7.

It has been a long time since I have had to think about
the installation of the dblink package...

The basic situation is as follows...

I have my main financial db on my Mac Book Pro 'mbp' and
backed up to my home server 'server' a Mac Mini and
also a linux box 'linuxbox'.

All currently running pg 8.3.7

I load my financial info weekly into the mac book pro
and then transfer the new data to the 'server' and
'linuxbox'.

I do this by connecting say to 'server' and then
connecting back to 'mbp' via dbilink and then pulling
the new data back to 'server' via dblink calls.

Here is a simplified version of the problem...

[mbp:~]$ psql -hserver -Ulevan
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
        \h for help with SQL commands
        \? for help with psql commands
        \g or terminate with semicolon to execute query
        \q to quit

levan=# select dblink_connect('host=mbp user=levan dbname=levan
password=foobar')
levan-# ;
ERROR:  could not establish connection
DETAIL:  could not translate host name "mbp" to address: Temporary
failure in name resolution

levan=# \q

The above error did not occur last week prior to the installation of
8.3.7

Going the other way...

server:~ jerry$ psql -hmbp -Ulevan
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
        \h for help with SQL commands
        \? for help with psql commands
        \g or terminate with semicolon to execute query
        \q to quit

levan=# select dblink_connect('host=server user=levan dbname=levan
password=foobar')
levan-# ;
  dblink_connect
----------------
  OK
(1 row)

Seems to work.

Also connecting to the linuxbox and coming back seems to work...

[mbp:~]$ psql -hlinuxbox -Ulevan
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
        \h for help with SQL commands
        \? for help with psql commands
        \g or terminate with semicolon to execute query
        \q to quit

levan=# select dblink_connect('host=mbp user=levan dbname=levan
password=foobar');
  dblink_connect
----------------
  OK
(1 row)

levan=# \q

I did a make and make install in the dblink directory on both
server and mbp and the results did not change...

any suggestions?

Thanks

Jerry



Re: Messed up dblink...

From
Tom Lane
Date:
Jerry LeVan <jerry.levan@eku.edu> writes:
> Something seems to have messed up my dblink interface...
> The only thing I can think that has changed the last week
> was the installation of 8.3.7.

What version were you using beforehand?  Are you *sure* nothing else in
your environment has changed?

> levan=# select dblink_connect('host=mbp user=levan dbname=levan
> password=foobar')
> levan-# ;
> ERROR:  could not establish connection
> DETAIL:  could not translate host name "mbp" to address: Temporary
> failure in name resolution

... because it is really, really hard to see how that particular
failure could arise from anything except a broken DNS configuration.

Try "nslookup mbp" at the shell command prompt.  If that fails with
a similar error message, Postgres is not at fault.

            regards, tom lane

Re: Messed up dblink...

From
Jerry LeVan
Date:
On Mar 21, 2009, at 12:37 PM, Tom Lane wrote:

> Jerry LeVan <jerry.levan@eku.edu> writes:
>> Something seems to have messed up my dblink interface...
>> The only thing I can think that has changed the last week
>> was the installation of 8.3.7.
>
> What version were you using beforehand?  Are you *sure* nothing else
> in
> your environment has changed?
>
>> levan=# select dblink_connect('host=mbp user=levan dbname=levan
>> password=foobar')
>> levan-# ;
>> ERROR:  could not establish connection
>> DETAIL:  could not translate host name "mbp" to address: Temporary
>> failure in name resolution
>
> ... because it is really, really hard to see how that particular
> failure could arise from anything except a broken DNS configuration.
>
> Try "nslookup mbp" at the shell command prompt.  If that fails with
> a similar error message, Postgres is not at fault.
>
>             regards, tom lane

Ok,

I found that for all of my boxen that if I connected to 'server' that
I could not connect back via dblink to the original host!

The nslookup worked fine in every case...

'server' is also my local nameserver. I took a flier and rebooted
the rascal and everything started working again :)

Thanks for the hint.

Jerry