Re: pg_restore (fromuser -> touser)

2021-08-03 Thread Peter J. Holzer
On 2021-07-27 09:43:45 +0800, Ben Madin wrote: > Hi - we have had to do such operations quite commonly, if you want to automate > / stream such a change I would suggest that you look into sed. Off the top of > my head, consider something like this: > > pg_dump --format=p --schema=schema_a original

Re: pg_restore (fromuser -> touser)

2021-07-26 Thread Ben Madin
Hi - we have had to do such operations quite commonly, if you want to automate / stream such a change I would suggest that you look into sed. Off the top of my head, consider something like this: pg_dump --format=p --schema=schema_a original_database | sed 's/ schema_a./ schema_b./g' | psql new_da

Re: pg_restore (fromuser -> touser)

2021-07-26 Thread Mayan
Thanks for the responses everyone and the reality check of how new features get in. I will look into the suggestion by Vijaykumar in more detail and try it out. Thanks again, Mayan On Sun, Jul 25, 2021 at 10:11 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Sun, Jul 25, 2021 at

Re: pg_restore (fromuser -> touser)

2021-07-25 Thread David G. Johnston
On Sun, Jul 25, 2021 at 8:02 PM Ganesh Korde wrote: > You just need to export dump without any privileges. And while restoring > dump use the new role. > You should read the body of the original email and not just the subject line. The actual question pertains to schemas - which IIUC are tightl

Re: pg_restore (fromuser -> touser)

2021-07-25 Thread Ganesh Korde
You just need to export dump without any privileges. And while restoring dump use the new role. Regards, Ganesh Korde. On Mon, 26 Jul 2021, 1:01 am David G. Johnston, wrote: > On Sun, Jul 25, 2021 at 8:39 AM Mayan wrote: > >> Thanks for your reply. Is this something that I can request as a fea

Re: pg_restore (fromuser -> touser)

2021-07-25 Thread David G. Johnston
On Sun, Jul 25, 2021 at 8:39 AM Mayan wrote: > Thanks for your reply. Is this something that I can request as a feature > add? I don't think it should be too much of effort (based on my limited > source code knowledge), but I'm not familiar with the process to request a > feature. > You just did

Re: pg_restore (fromuser -> touser)

2021-07-25 Thread Vijaykumar Jain
On Sun, 25 Jul 2021 at 21:09, Mayan wrote: > Thanks for your reply. Is this something that I can request as a feature > add? I don't think it should be too much of effort (based on my limited > source code knowledge), but I'm not familiar with the process to request a > feature. > although there

Re: pg_restore (fromuser -> touser)

2021-07-25 Thread Mayan
Thanks for your reply. Is this something that I can request as a feature add? I don't think it should be too much of effort (based on my limited source code knowledge), but I'm not familiar with the process to request a feature. Thanks, Mayan On Fri, Jul 23, 2021, 10:58 PM Ninad Shah wrote: > T

Re: pg_restore (fromuser -> touser)

2021-07-23 Thread Ninad Shah
This is true. Such a feature is not available in PostgreSQL. What you need to do is you have to take a structure dump, and change the schema name as per required. And, then, you may copy the data. Regards, Ninad Shah On Fri, 23 Jul 2021 at 23:08, Mayan wrote: > Hi, > > > > I had a general que