Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.postgresql > #614
| From | Fredrik Jonson <fredrik@jonson.org> |
|---|---|
| Newsgroups | comp.databases.postgresql |
| Subject | Re: Help databases and schemes |
| Date | 2014-11-22 16:51 +0000 |
| Message-ID | <slrnm71fo8.7tn.fredrik@biggles.jonson.org> (permalink) |
| References | <3ec57947-4f92-46c0-8101-9628a62250a7@googlegroups.com> <7b195d3f-4b82-4d92-adab-e77cecc72a2b@googlegroups.com> <cd9u7bFntcdU1@mid.uni-berlin.de> |
In <cd9u7bFntcdU1@mid.uni-berlin.de> M. Strobel wrote: > If you just ask "can I put the tables from A, B and C into D" then the > answer is yes. Your full answer is obviously correct and proper, but I got curious, as I can't recall the last time I worked with multiple schemes in the same database. My naive approach would be to use pg_dump to dump the three databases normally. Then, a quick google told me that I can specify the default scheme for commands using 'set search_path'. Thus I would try to use that, basically: create schemes for each old database in the new joint database, alter the search path, then load one database dump, then alter the default search path again, and load the next database, etc. (a few minutes of experimenting later...) While testing this, I noticed that there is a gotcha, and if you check the contents of pg_dump output, you'll see a shortcut that makes some of the above unnecessary. Any other comments or further teaching points from the group on the above? -- Fredrik Jonson
Back to comp.databases.postgresql | Previous | Next — Previous in thread | Find similar
Help databases and schemes Daniel Quisbert <dani3l.quisb3rt@gmail.com> - 2014-11-20 14:05 -0800
Re: Help databases and schemes "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2014-11-20 23:59 +0100
Re: Help databases and schemes Daniel Quisbert <dani3l.quisb3rt@gmail.com> - 2014-11-21 05:06 -0800
Re: Help databases and schemes "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2014-11-21 23:55 +0100
Re: Help databases and schemes Fredrik Jonson <fredrik@jonson.org> - 2014-11-22 16:51 +0000
csiph-web