| От | Bruno Wolff III |
|---|---|
| Тема | Re: execute a query in an other db |
| Дата | |
| Msg-id | 20021112141843.GA27903@wolff.to обсуждение исходный текст |
| Ответ на | execute a query in an other db ("LR" <lr-NOSPAM-@sib.org>) |
| Список | pgsql-sql |
On Sat, Nov 09, 2002 at 17:51:40 +0100, LR <lr-NOSPAM-@sib.org> wrote: > Hi, > > When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute > "select * from myTable;" in an other db (e.g. myOtherDB). > > In other words, what is the postgreSQL equivalent of the MS SQL Server > statement "USE myOtherDB SELECT * FROM myTable" ? Stock postgresql doesn't support cross database queries. There is a contrib package which does. In the example you gave, you were combining information from two databases. If it is the case that your application will be combining data from the two databases, then you can open a separate connection to each database and use the appropiate connection for your queries.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера