Re: Creating views (Multiple Databases)
От | Michael Glaesemann |
---|---|
Тема | Re: Creating views (Multiple Databases) |
Дата | |
Msg-id | B54CA0D6-01DE-488B-9D0C-FF5149992CC0@myrealbox.com обсуждение исходный текст |
Ответ на | Creating views (Multiple Databases) (Benjamin Arai <barai@cs.ucr.edu>) |
Список | pgsql-general |
On Feb 2, 2006, at 16:05 , Benjamin Arai wrote: > Is it possible to create a view from two different database tables? Yes. You can create a view out of any query (i.e., SELECT statement). For example, CREATE VIEW companies__members__view AS SELECT company.company_name, member.given_name, member.family_name, FROM companies JOIN companies__members USING (company_id) JOIN members USING (member_id); Here's a couple of links to some of the documentation on views: http://www.postgresql.org/docs/current/interactive/sql-createview.html http://www.postgresql.org/docs/8.1/interactive/tutorial-views.html Between different *databases* is another issue. You'll need to look at something like dblink (in contrib). If you think you might be doing this a lot you might want to consider making one database, separating out different sections in different schemas as necessary. Hope this helps. Michael Glaesemann grzm myrealbox com
В списке pgsql-general по дате отправления: