Обсуждение: Calling pgScript from the command line
Is it possible to run pgscripts from the command line? i.e like with:
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgscript/pgScript/src/pgsMain.cpp
If not it would great if pgadminIII included a command line utility.
Cheers
Jeremy
This message contains information, which is confidential and may be subject to legal privilege.
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz ) and destroy the original message.
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz ) and destroy the original message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.
Thank you.
Le 14/01/2011 02:50, Jeremy Palmer a écrit : > Is it possible to run pgscripts from the command line? i.e like with: > No, all you can do is launch the query tool and open a script file. But it doesn't run it automatically, and you need the usual graphic stuff to work. > http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgscript/pgScript/src/pgsMain.cpp > > If not it would great if pgadminIII included a command line utility. > Could be interesting to add this to pgAgent too. -- Guillaumehttp://www.postgresql.frhttp://dalibo.com
On Fri, Jan 14, 2011 at 7:06 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote: > Le 14/01/2011 02:50, Jeremy Palmer a écrit : >> Is it possible to run pgscripts from the command line? i.e like with: >> > > No, all you can do is launch the query tool and open a script file. But > it doesn't run it automatically, and you need the usual graphic stuff to > work. > >> http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgscript/pgScript/src/pgsMain.cpp >> >> If not it would great if pgadminIII included a command line utility. >> > > Could be interesting to add this to pgAgent too. There used to be something in xtra/pgScript, but it appears to have bit-rotted. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
It would be really awesome for DBAs admins to be able to run pgscripts from the command line which have developed in pgadmin.Even better if the programme is distributed with the standard win32 download. Would it be possible to revive it and integrate xtra/pgScript into the pgadmin? Cheers Jeremy -----Original Message----- From: Dave Page [mailto:dpage@pgadmin.org] Sent: Friday, 14 January 2011 11:03 p.m. To: Guillaume Lelarge Cc: Jeremy Palmer; pgadmin-support@postgresql.org Subject: Re: [pgadmin-support] Calling pgScript from the command line There used to be something in xtra/pgScript, but it appears to have bit-rotted. ______________________________________________________________________________________________________ This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) and destroythe original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank you. ______________________________________________________________________________________________________
On Sun, Jan 16, 2011 at 9:50 PM, Jeremy Palmer <JPalmer@linz.govt.nz> wrote: > It would be really awesome for DBAs admins to be able to run pgscripts from the command line which have developed in pgadmin.Even better if the programme is distributed with the standard win32 download. > > Would it be possible to revive it and integrate xtra/pgScript into the pgadmin? Well it's already in the source tree, and already integrated into the pgAdmin GUI. All that is needed is a patch to fix the bitrot. As always, patches are welcome. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On Sun, Jan 16, 2011 at 23:02, Dave Page <dpage@pgadmin.org> wrote: > On Sun, Jan 16, 2011 at 9:50 PM, Jeremy Palmer <JPalmer@linz.govt.nz> wrote: >> It would be really awesome for DBAs admins to be able to run pgscripts from the command line which have developed in pgadmin.Even better if the programme is distributed with the standard win32 download. >> >> Would it be possible to revive it and integrate xtra/pgScript into the pgadmin? > > Well it's already in the source tree, and already integrated into the > pgAdmin GUI. All that is needed is a patch to fix the bitrot. As > always, patches are welcome. Seems the first issue at least comes from patch 93834d477cd3fb91deacc0946ef845622fd6678d which removed our md5 support. But there seems to be other issues as well. If you (=Jeremy) want to look at this, that'd be great - if not, I can probably look at it, but not right now. (btw, we really should look at making it not compile pgscript twice - once for pgadmin and once for the one in xtra/. But that's something for another day :D) -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
On Mon, Jan 17, 2011 at 07:46, Magnus Hagander <magnus@hagander.net> wrote: > On Sun, Jan 16, 2011 at 23:02, Dave Page <dpage@pgadmin.org> wrote: >> On Sun, Jan 16, 2011 at 9:50 PM, Jeremy Palmer <JPalmer@linz.govt.nz> wrote: >>> It would be really awesome for DBAs admins to be able to run pgscripts from the command line which have developed inpgadmin. Even better if the programme is distributed with the standard win32 download. >>> >>> Would it be possible to revive it and integrate xtra/pgScript into the pgadmin? >> >> Well it's already in the source tree, and already integrated into the >> pgAdmin GUI. All that is needed is a patch to fix the bitrot. As >> always, patches are welcome. > > Seems the first issue at least comes from patch > 93834d477cd3fb91deacc0946ef845622fd6678d which removed our md5 > support. But there seems to be other issues as well. If you (=Jeremy) > want to look at this, that'd be great - if not, I can probably look at > it, but not right now. > > (btw, we really should look at making it not compile pgscript twice - > once for pgadmin and once for the one in xtra/. But that's something > for another day :D) Here's a patch that seems to make it work. The issues were: * md5 no longer available - but also not needed, removed. * qtIdent() was not available in commandline mode, but needed. This in turn required db/keywords.c to be linked in. Comments/objections on patch? -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
Вложения
Wow thanks for the patch Magnus - so fast! Patch looks great. Is it also possible to update the patch to include the win32 executable into the packaging? i.e pkg/win32/src/pgadmin3.wxs Cheers Jeremy -----Original Message----- From: Magnus Hagander [mailto:magnus@hagander.net] Sent: Tuesday, 18 January 2011 2:17 a.m. To: Dave Page Cc: Jeremy Palmer; Guillaume Lelarge; pgadmin-support@postgresql.org Subject: Re: [pgadmin-support] Calling pgScript from the command line On Mon, Jan 17, 2011 at 07:46, Magnus Hagander <magnus@hagander.net> wrote: > On Sun, Jan 16, 2011 at 23:02, Dave Page <dpage@pgadmin.org> wrote: >> On Sun, Jan 16, 2011 at 9:50 PM, Jeremy Palmer <JPalmer@linz.govt.nz> wrote: >>> It would be really awesome for DBAs admins to be able to run pgscripts from the command line which have developed inpgadmin. Even better if the programme is distributed with the standard win32 download. >>> >>> Would it be possible to revive it and integrate xtra/pgScript into the pgadmin? >> >> Well it's already in the source tree, and already integrated into the >> pgAdmin GUI. All that is needed is a patch to fix the bitrot. As >> always, patches are welcome. > > Seems the first issue at least comes from patch > 93834d477cd3fb91deacc0946ef845622fd6678d which removed our md5 > support. But there seems to be other issues as well. If you (=Jeremy) > want to look at this, that'd be great - if not, I can probably look at > it, but not right now. > > (btw, we really should look at making it not compile pgscript twice - > once for pgadmin and once for the one in xtra/. But that's something > for another day :D) Here's a patch that seems to make it work. The issues were: * md5 no longer available - but also not needed, removed. * qtIdent() was not available in commandline mode, but needed. This in turn required db/keywords.c to be linked in. Comments/objections on patch? -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/ ______________________________________________________________________________________________________ This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) and destroythe original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank you. ______________________________________________________________________________________________________
From what I can tell, we don't have visual studio project files for anything in xtra/ - Dave, correct? That would be a prerequisite. I'm not involved at all in the packaging, so I can't comment there - Dave, again? ;) //Magnus On Mon, Jan 17, 2011 at 22:41, Jeremy Palmer <JPalmer@linz.govt.nz> wrote: > > Wow thanks for the patch Magnus - so fast! > > Patch looks great. Is it also possible to update the patch to include the win32 executable into the packaging? i.e pkg/win32/src/pgadmin3.wxs > > Cheers > Jeremy > > -----Original Message----- > From: Magnus Hagander [mailto:magnus@hagander.net] > Sent: Tuesday, 18 January 2011 2:17 a.m. > To: Dave Page > Cc: Jeremy Palmer; Guillaume Lelarge; pgadmin-support@postgresql.org > Subject: Re: [pgadmin-support] Calling pgScript from the command line > > On Mon, Jan 17, 2011 at 07:46, Magnus Hagander <magnus@hagander.net> wrote: >> On Sun, Jan 16, 2011 at 23:02, Dave Page <dpage@pgadmin.org> wrote: >>> On Sun, Jan 16, 2011 at 9:50 PM, Jeremy Palmer <JPalmer@linz.govt.nz> wrote: >>>> It would be really awesome for DBAs admins to be able to run pgscripts from the command line which have developed inpgadmin. Even better if the programme is distributed with the standard win32 download. >>>> >>>> Would it be possible to revive it and integrate xtra/pgScript into the pgadmin? >>> >>> Well it's already in the source tree, and already integrated into the >>> pgAdmin GUI. All that is needed is a patch to fix the bitrot. As >>> always, patches are welcome. >> >> Seems the first issue at least comes from patch >> 93834d477cd3fb91deacc0946ef845622fd6678d which removed our md5 >> support. But there seems to be other issues as well. If you (=Jeremy) >> want to look at this, that'd be great - if not, I can probably look at >> it, but not right now. >> >> (btw, we really should look at making it not compile pgscript twice - >> once for pgadmin and once for the one in xtra/. But that's something >> for another day :D) > > Here's a patch that seems to make it work. The issues were: > > * md5 no longer available - but also not needed, removed. > * qtIdent() was not available in commandline mode, but needed. This in > turn required db/keywords.c to be linked in. > > Comments/objections on patch? > > -- > Magnus Hagander > Me: http://www.hagander.net/ > Work: http://www.redpill-linpro.com/ > ______________________________________________________________________________________________________ > > This message contains information, which is confidential and may be subject to legal privilege. > If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. > If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) anddestroy the original message. > LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. > > Thank you. > ______________________________________________________________________________________________________ > -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
On Tue, Jan 18, 2011 at 2:12 PM, Magnus Hagander <magnus@hagander.net> wrote: > From what I can tell, we don't have visual studio project files for > anything in xtra/ - Dave, correct? That would be a prerequisite. > > I'm not involved at all in the packaging, so I can't comment there - > Dave, again? ;) Correct. I don't really want to include it anyway, as we'll have to support it then, and this is a GUI project, not a command line one. I have no problem if people want to build and use it themselves though. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On Tue, Jan 18, 2011 at 15:34, Dave Page <dpage@pgadmin.org> wrote: > On Tue, Jan 18, 2011 at 2:12 PM, Magnus Hagander <magnus@hagander.net> wrote: >> From what I can tell, we don't have visual studio project files for >> anything in xtra/ - Dave, correct? That would be a prerequisite. >> >> I'm not involved at all in the packaging, so I can't comment there - >> Dave, again? ;) > > Correct. I don't really want to include it anyway, as we'll have to > support it then, and this is a GUI project, not a command line one. I > have no problem if people want to build and use it themselves though. Fair enough. I've applied the patch so it builds again. -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
Thanks Magnus. It's a pity that it's not going to be distributed by default with the PostgreSQL win32 installer and the pgadmin installer.It would have been nice to be able to share my scripts with colleagues knowing that they would have the tool torun the pgscripts. Thanks again, Jeremy -----Original Message----- From: Magnus Hagander [mailto:magnus@hagander.net] Sent: Wednesday, 19 January 2011 8:22 a.m. To: Dave Page Cc: Jeremy Palmer; Guillaume Lelarge; pgadmin-support@postgresql.org Subject: Re: [pgadmin-support] Calling pgScript from the command line On Tue, Jan 18, 2011 at 15:34, Dave Page <dpage@pgadmin.org> wrote: > On Tue, Jan 18, 2011 at 2:12 PM, Magnus Hagander <magnus@hagander.net> wrote: >> From what I can tell, we don't have visual studio project files for >> anything in xtra/ - Dave, correct? That would be a prerequisite. >> >> I'm not involved at all in the packaging, so I can't comment there - >> Dave, again? ;) > > Correct. I don't really want to include it anyway, as we'll have to > support it then, and this is a GUI project, not a command line one. I > have no problem if people want to build and use it themselves though. Fair enough. I've applied the patch so it builds again. -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/ ______________________________________________________________________________________________________ This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) and destroythe original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank you. ______________________________________________________________________________________________________