Re: Re: Accessing other databases with DBLink when leaving user/password empty

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Hermann Muster <Hermann(dot)Muster(at)gmx(dot)de>
Subject: Re: Re: Accessing other databases with DBLink when leaving user/password empty
Date: 2008-06-06 13:53:32
Message-ID: 200806060653.33194.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 06 June 2008 2:32 am, Hermann Muster wrote:
> Does no one have any idea about that?
>
> Regards.
>
> Hermann Muster wrote:
> > Hi,
> >
> > I have the following problem when trying to access other PostgreSQL
> > databases with DBLink. I followed the instructions on
> > http://www.postgresonline.com/journal/index.php?/archives/44-Using-DbLink
> >-to-access-other-PostgreSQL-Databases-and-Servers.html.
> >
> >
> > My query to get access to another database on the same server looks like
> > this:
> >
> > select dblink_connect('1512','host=127.0.0.1 port=5432
> > dbname=Test user=postgres password=postgres');

From the documentation:
http://www.postgresql.org/docs/current/static/dblink.html
Don't do the above.

> >
> > select * from dblink('1512','select "Vorname", "Name" from
> > "PERSONEN"')
> > AS (Vorname text, Name text);

Here do:
select * from dblink('dbname=Test','select "Vorname", "Name" from
"PERSONEN"')
AS (Vorname text, Name text);

> >
> > The question is if it is possible to leave the 'user' and 'password'
> > empty, so that these are taken from the account I'm currently using, as
> > described below (taken from the above article).
> >
> > [...]
> > Below is an example of querying a database on the same server
> > and cluster using DbLink. Note if no username and password is
> > specified, then DbLink connects with whatever account you are
> > currently using.
> >
> > It is not possible to connect to the other database when they are empty
> > and it seems that DBLink can't get them from the currently used account.
> > Can you please help me with that? Thank you.
> >
> > Regards,
> > H. Muster

--
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zoltan Boszormenyi 2008-06-06 14:35:25 Heavily fragmented table and index data in 8.0.3
Previous Message Gary Fu 2008-06-06 13:35:16 Re: how to clean up temporary schemas (how to sync the system table with pg_dump)