Search Postgresql Archives

dblink does not resolve DNS, but works with IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If I have this:

CREATE OR REPLACE VIEW Link.Foo AS
  select * from dblink(
    'hostaddr=123.123.123.123 dbname=KitchenPC user=Website password=secret',
    'select * from Foo') as ...

Then it works.  However, if I do:

CREATE OR REPLACE VIEW Link.Foo AS
  select * from dblink(
    'hostaddr=db.domain.com dbname=KitchenPC user=Website password=secret',
    'select * from Foo') as ...

Then I get:

ERROR:  could not establish connection
DETAIL:  could not translate host name "db.domain.com" to address: Unknown host

However, from a command prompt I can ping db.domain.com and get 123.123.123.123.

Does dblink just not support DNS resolution?  I really don't want to hard code IP addresses in my scripts.  Thanks!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux