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

Started by Nonamealmost 23 years ago14 messages
#1Noname
petere@postgresql.org

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

#2Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Noname (#1)
Re: 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

#3Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Christopher Kings-Lynne (#2)
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
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Christopher Kings-Lynne (#2)
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

#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Peter Eisentraut (#4)
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
#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#4)
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

#7Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Tom Lane (#6)
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
#8Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Bruce Momjian (#7)
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"

#9Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Alvaro Herrera (#8)
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
#10Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Bruce Momjian (#9)
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.

#11Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Alvaro Herrera (#10)
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
#12Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Bruce Momjian (#11)
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.

#13Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#6)
Re: [COMMITTERS] 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

#14Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Peter Eisentraut (#13)
Re: [COMMITTERS] pgsql-server/ oc/src/sgml/manage-ag.sgml

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