Обсуждение: Database Connect

Поиск
Список
Период
Сортировка

Database Connect

От
Michaël Fiey
Дата:
Hi,

I installed Postgresql 7.1 (RPMs for Redhat 7.0).
When I start psql with the command 'psql mydb', everything's ok
But whan I start psql with the command 'psql mybase@myhost' I receive  :
psql: FATAL 1: Database "mybase@myhost" does not exist in system catalog

I used this syntax with Postgresql 7.03.
Is there some modifications between 7.03 and 7.1, or is it a bad config of
my server ?

Any help will be appreciated

Thank's a lot

Michael


Re: Database Connect

От
Tom Lane
Дата:
=?iso-8859-1?Q?Micha=EBl_Fiey?= <m.fiey@futuresoundtech.com> writes:
> But whan I start psql with the command 'psql mybase@myhost' I receive  :
> psql: FATAL 1: Database "mybase@myhost" does not exist in system catalog

This syntax isn't supported.

> I used this syntax with Postgresql 7.03.

There was some undocumented and mostly-broken code in libpq that tried
to be fancy about interpreting database names to mean more than just a
database name.  I don't recall all the arguments for taking it out
versus trying to fix and document it, but the upshot was we took it out.

            regards, tom lane

Re: Database Connect

От
webb sprague
Дата:
Aahh!  I have a million Perl scripts that rely on this syntax in the DBI
to connect to remote databases.

like:

$dbh=DBI->connect( "dbi:Pg:dbname=datab@remotehost",'wsprague','pass',
             {RaiseError => 1, AutoCommit => 1})
             or print STDERR "$DBI::errstr<p>";

Umm, do you have any idea what we should do now?

Thanks for all the effort that you guys have put into Postgres--if I was
following pgsql-hackers I probably could have put my 2 cents in earlier.

W

Tom Lane wrote:

> > But whan I start psql with the command 'psql mybase@myhost' I receive  :
> > psql: FATAL 1: Database "mybase@myhost" does not exist in system catalog
>
> This syntax isn't supported.
>

Re: Database Connect

От
"Brett W. McCoy"
Дата:
On Fri, 20 Apr 2001, webb sprague wrote:

> Aahh!  I have a million Perl scripts that rely on this syntax in the DBI
> to connect to remote databases.
>
> like:
>
> $dbh=DBI->connect( "dbi:Pg:dbname=datab@remotehost",'wsprague','pass',
>              {RaiseError => 1, AutoCommit => 1})
>              or print STDERR "$DBI::errstr<p>";
>
> Umm, do you have any idea what we should do now?

perl -pie 's|@remotehost|;host=remotehost|g' <file>

Or something to that effect :-)

-- Brett
                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Women in love consist of a little sighing, a little crying, a little dying
-- and a good deal of lying.
        -- Ansey