Thread: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
petere@postgresql.org (Peter Eisentraut - PostgreSQL)
Date:
CVSROOT:    /cvsroot
Module name:    pgsql-server
Changes by:    petere@postgresql.org    03/03/18 17:19:47

Modified files:
    doc/src/sgml   : manage-ag.sgml
    doc/src/sgml/ref: createdb.sgml createlang.sgml createuser.sgml
                      dropdb.sgml droplang.sgml dropuser.sgml
    src/bin/scripts: Makefile
Added files:
    src/bin/scripts: common.c common.h createdb.c createlang.c
                     createuser.c dropdb.c droplang.c dropuser.c
                     nls.mk
Removed files:
    src/bin/scripts: createdb createlang.sh createuser dropdb
                     droplang dropuser

Log message:
    Reimplement create and drop scripts in C, to reduce repetitive
    connections, increase robustness, add NLS, and prepare for Windows port.
    (vacuumdb and clusterdb will follow later.)


Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
"Christopher Kings-Lynne"
Date:
> Log message:
> Reimplement create and drop scripts in C, to reduce repetitive
> connections, increase robustness, add NLS, and prepare for Windows port.
> (vacuumdb and clusterdb will follow later.)

How about reindexdb?

Do you think we should replace them all with a utility called pg_maintain
that can do all of them?

Chris


Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Bruce Momjian
Date:
Christopher Kings-Lynne wrote:
> > Log message:
> > Reimplement create and drop scripts in C, to reduce repetitive
> > connections, increase robustness, add NLS, and prepare for Windows port.
> > (vacuumdb and clusterdb will follow later.)
>
> How about reindexdb?
>
> Do you think we should replace them all with a utility called pg_maintain
> that can do all of them?

And analyze-only.  Good idea.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Peter Eisentraut
Date:
Christopher Kings-Lynne writes:

> How about reindexdb?
> Do you think we should replace them all with a utility called pg_maintain
> that can do all of them?

If you ask me, we could get rid of them completely because

for d in $(psql -l --somthing); do vacuum $d; done

seems perfectly fine.

--
Peter Eisentraut   peter_e@gmx.net


Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Bruce Momjian
Date:
Maybe a simple utility that just loops through all databases and runs an
SQL command.

---------------------------------------------------------------------------

Peter Eisentraut wrote:
> Christopher Kings-Lynne writes:
>
> > How about reindexdb?
> > Do you think we should replace them all with a utility called pg_maintain
> > that can do all of them?
>
> If you ask me, we could get rid of them completely because
>
> for d in $(psql -l --somthing); do vacuum $d; done
>
> seems perfectly fine.
>
> --
> Peter Eisentraut   peter_e@gmx.net
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Christopher Kings-Lynne writes:
>> Do you think we should replace them all with a utility called pg_maintain
>> that can do all of them?

> If you ask me, we could get rid of them completely because
> for d in $(psql -l --somthing); do vacuum $d; done
> seems perfectly fine.

If you have a real shell (and know how to use it), sure.  Is such a
solution acceptable to all those Windows users we're hoping to attract?

            regards, tom lane

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Bruce Momjian
Date:
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Christopher Kings-Lynne writes:
> >> Do you think we should replace them all with a utility called pg_maintain
> >> that can do all of them?
>
> > If you ask me, we could get rid of them completely because
> > for d in $(psql -l --somthing); do vacuum $d; done
> > seems perfectly fine.
>
> If you have a real shell (and know how to use it), sure.  Is such a
> solution acceptable to all those Windows users we're hoping to attract?

That's why I am thinking of some wrapper that will loop through the
databases and run psql commands.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Alvaro Herrera
Date:
On Thu, Mar 20, 2003 at 11:58:25AM -0500, Bruce Momjian wrote:
> Tom Lane wrote:
> > Peter Eisentraut <peter_e@gmx.net> writes:
> > > Christopher Kings-Lynne writes:
> > >> Do you think we should replace them all with a utility called pg_maintain
> > >> that can do all of them?
> >
> > > If you ask me, we could get rid of them completely because
> > > for d in $(psql -l --somthing); do vacuum $d; done
> > > seems perfectly fine.
> >
> > If you have a real shell (and know how to use it), sure.  Is such a
> > solution acceptable to all those Windows users we're hoping to attract?

I think an acceptable solution to Windows users is some kind of
"service" that can run whatever is needed, whenever is needed.  Those
poor Windows users don't have cron, remember.  IMHO this kind of tool is
part of the Windows administration package and probably doesn't belong
in the main distribution.

> That's why I am thinking of some wrapper that will loop through the
> databases and run psql commands.

Written on what language?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Limitate a mirar... y algun dia veras"

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Bruce Momjian
Date:
Alvaro Herrera wrote:
> On Thu, Mar 20, 2003 at 11:58:25AM -0500, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Peter Eisentraut <peter_e@gmx.net> writes:
> > > > Christopher Kings-Lynne writes:
> > > >> Do you think we should replace them all with a utility called pg_maintain
> > > >> that can do all of them?
> > >
> > > > If you ask me, we could get rid of them completely because
> > > > for d in $(psql -l --somthing); do vacuum $d; done
> > > > seems perfectly fine.
> > >
> > > If you have a real shell (and know how to use it), sure.  Is such a
> > > solution acceptable to all those Windows users we're hoping to attract?
>
> I think an acceptable solution to Windows users is some kind of
> "service" that can run whatever is needed, whenever is needed.  Those
> poor Windows users don't have cron, remember.  IMHO this kind of tool is
> part of the Windows administration package and probably doesn't belong
> in the main distribution.
>
> > That's why I am thinking of some wrapper that will loop through the
> > databases and run psql commands.
>
> Written on what language?

Written in C as a command-line utility.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Alvaro Herrera
Date:
On Thu, Mar 20, 2003 at 12:25:03PM -0500, Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > On Thu, Mar 20, 2003 at 11:58:25AM -0500, Bruce Momjian wrote:
> > > That's why I am thinking of some wrapper that will loop through the
> > > databases and run psql commands.
> >
> > Written on what language?
>
> Written in C as a command-line utility.

Then why not use libpq directly?  Seems safer than depending on $PATH
and who knows what else.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Major Fambrough: You wish to see the frontier?
John Dunbar: Yes sir, before it's gone.

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Bruce Momjian
Date:
Alvaro Herrera wrote:
> On Thu, Mar 20, 2003 at 12:25:03PM -0500, Bruce Momjian wrote:
> > Alvaro Herrera wrote:
> > > On Thu, Mar 20, 2003 at 11:58:25AM -0500, Bruce Momjian wrote:
> > > > That's why I am thinking of some wrapper that will loop through the
> > > > databases and run psql commands.
> > >
> > > Written on what language?
> >
> > Written in C as a command-line utility.
>
> Then why not use libpq directly?  Seems safer than depending on $PATH
> and who knows what else.

I guess you could do it in libpq, but how do you access that from the
command line.  All these vacuumdb-like utilities are for the command
line.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

From
Alvaro Herrera
Date:
On Thu, Mar 20, 2003 at 12:33:18PM -0500, Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > On Thu, Mar 20, 2003 at 12:25:03PM -0500, Bruce Momjian wrote:
> > > Alvaro Herrera wrote:
> > > > On Thu, Mar 20, 2003 at 11:58:25AM -0500, Bruce Momjian wrote:
> > > > > That's why I am thinking of some wrapper that will loop through the
> > > > > databases and run psql commands.
> > > >
> > > > Written on what language?
> > >
> > > Written in C as a command-line utility.
> >
> > Then why not use libpq directly?  Seems safer than depending on $PATH
> > and who knows what else.
>
> I guess you could do it in libpq, but how do you access that from the
> command line.  All these vacuumdb-like utilities are for the command
> line.

The same way dropuser.c and the like are all accessed now.  (Peter
changed the script versions for C versions using libpq, not calling
libpq... I just checked.)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
We take risks not to escape from life, but to prevent life escaping from us.