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.)


Tue, 18 Mar 2003 17:19:47 -0500 (EST)
petere@postgresql.org (Peter Eisentraut - PostgreSQL)
pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
> 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


Wed, 19 Mar 2003 09:33:22 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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

Tue, 18 Mar 2003 20:34:15 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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


Thu, 20 Mar 2003 17:19:00 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...

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

Thu, 20 Mar 2003 11:22:01 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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

Thu, 20 Mar 2003 11:55:09 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ... 
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

Thu, 20 Mar 2003 11:58:25 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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"

Thu, 20 Mar 2003 13:22:28 -0400
Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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

Thu, 20 Mar 2003 12:25:03 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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.

Thu, 20 Mar 2003 13:31:29 -0400
Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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

Thu, 20 Mar 2003 12:33:18 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
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.

Thu, 20 Mar 2003 13:39:12 -0400
Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
Tom Lane writes:

> > for d in $(psql -l --somthing); do vacuum $d; done
> 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 don't know how Windows users typically manage their systems, but if they
use batch files they can also write a similar loop with the native shell.
(I just tried it.)

My problem with a program that runs a command for all databases is that it
is too rigid:  What if you want to run maintenance only on some databases
(owned by you, big/small, even/odd, starting with 'x')?  --- Cannot use
it, back to the manual approach.

-- 
Peter Eisentraut   peter_e@gmx.net


Fri, 21 Mar 2003 18:05:36 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: [COMMITTERS] pgsql-server/ oc/src/sgml/manage-ag.sgml oc/sr ...
Peter Eisentraut wrote:
> Tom Lane writes:
> 
> > > for d in $(psql -l --somthing); do vacuum $d; done
> > 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 don't know how Windows users typically manage their systems, but if they
> use batch files they can also write a similar loop with the native shell.
> (I just tried it.)
> 
> My problem with a program that runs a command for all databases is that it
> is too rigid:  What if you want to run maintenance only on some databases
> (owned by you, big/small, even/odd, starting with 'x')?  --- Cannot use
> it, back to the manual approach.

My assumption was that if you wanted only a few databases, you would use
psql.  I see the only major advantage to the vacuumdb-like commands is
doing all databases.  Are there other advantages?

-- 
  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

Fri, 21 Mar 2003 12:15:19 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [COMMITTERS] pgsql-server/ oc/src/sgml/manage-ag.sgml