Re: DB alias ?

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: DB alias ?
Дата
Msg-id 2011000.ZKcyhJbdz0@bheem
обсуждение исходный текст
Ответ на Re: DB alias ?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Ответы Re: DB alias ?  (Guillaume Lelarge <guillaume@lelarge.info>)
Re: DB alias ?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Re: DB alias ?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Список pgsql-general

On Wednesday, January 23, 2013 09:39:43 PM Gauthier, Dave wrote:

> Then someone who wants to look at old JAN data will have the same problem

> :-(

>

> If I recall, Oracle enables something like this. Multiple tnsfilenames (or

> something like that). There was a connect layer on the server side that

> the DBA had access to where you could do stuff like this.

> >> proposed new SQL command:

> >>READ USERS MIND;

> :

> :-)

>

> Actually, read the DBA's mind.

>

> How about...

>

> postgres=# create db_alias FEB to db JAN;

> postgres=# drop db_alias FEB;

 

I would have suggested to use pg_services file as documented at

 

http://www.postgresql.org/docs/9.1/static/libpq-pgservice.html

http://www.postgresql.org/docs/9.1/static/libpq-connect.html

 

You can think of this as tnsnames replacement.

 

but I am unable to make it work. I don't know what is wrong with this.

 

shridhar@bheem ~$ cat ~/.pg_service.conf

[test1]

host=localhost

dbname=test

 

shridhar@bheem ~$ strace -o psql.strace psql test1

psql: FATAL: database "test1" does not exist

 

shridhar@bheem ~$ grep -i pg_service psql.strace

 

shridhar@bheem ~$ psql test

psql (9.2.2)

Type "help" for help.

 

test=# \q

 

shridhar@bheem ~$ psql --version

psql (PostgreSQL) 9.2.2

 

 

--

Regards

Shridhar

В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Sending several commands simultaneously to PostgreSQL 8.4
Следующее
От: Cameron Shorter
Дата:
Сообщение: Jobs for a Oracle/Postgres DBAs in Australia