Re: Command tags in create/drop scripts

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Command tags in create/drop scripts
Date: 2007-05-31 12:56:00
Message-ID: 200705311456.00717.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

The messages output by the "scripts" always seemed unnecessary to me, e.g.,

$ createdb foo
CREATE DATABASE

A Unix program (hi Magnus) shouldn't need to say anything if the requested
action succeeded.

I believe the history of this output is actually that these scripts simply
used to call psql and no one really questioned why the output should be this
way. There are also some inconsistencies, e.g., createlang doesn't output
anything, and createuser outputs CREATE ROLE.

I would just remove all this, but I suppose this will be controversial?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: "CAJ CAJ" <pguser(at)gmail(dot)com>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-05-31 17:06:00
Message-ID: 467669b30705311006w5d2863ddlb7644589ca8e1dcd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 5/31/07, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>
> The messages output by the "scripts" always seemed unnecessary to me, e.g
> .,
>
> $ createdb foo
> CREATE DATABASE
>
> A Unix program (hi Magnus) shouldn't need to say anything if the requested
> action succeeded.
>
> I believe the history of this output is actually that these scripts simply
> used to call psql and no one really questioned why the output should be
> this
> way. There are also some inconsistencies, e.g., createlang doesn't output
> anything, and createuser outputs CREATE ROLE.
>
> I would just remove all this, but I suppose this will be controversial?

Can it me made to return an integer like most UNIX commands do? This helps
immensely when writing shell scripts.

Thanks!


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "CAJ CAJ" <pguser(at)gmail(dot)com>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-05-31 17:25:04
Message-ID: 10308.1180632304@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"CAJ CAJ" <pguser(at)gmail(dot)com> writes:
> Can it me made to return an integer like most UNIX commands do? This helps
> immensely when writing shell scripts.

Don't they do that already? If not, that's a bug quite independent of
Peter's cosmetic concern.

regards, tom lane


From: "CAJ CAJ" <pguser(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-05-31 21:22:04
Message-ID: 467669b30705311422m572c675dsb5d8dfe06112ec4e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 5/31/07, CAJ CAJ <pguser(at)gmail(dot)com> wrote:
>
>
> > Can it me made to return an integer like most UNIX commands do? This
> > helps
> > > immensely when writing shell scripts.
> >
> > Don't they do that already? If not, that's a bug quite independent of
> > Peter's cosmetic concern.
>
>
>
> Ah, I just tested it. create/drop user commands does return an integer.
> It's not mentioned in the manpages though.
>

BTW, there is a "-q" option to quieten the output.
>


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-01 18:23:38
Message-ID: 200706011823.l51INcf00825@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> The messages output by the "scripts" always seemed unnecessary to me, e.g.,
>
> $ createdb foo
> CREATE DATABASE
>
> A Unix program (hi Magnus) shouldn't need to say anything if the requested
> action succeeded.
>
> I believe the history of this output is actually that these scripts simply
> used to call psql and no one really questioned why the output should be this
> way. There are also some inconsistencies, e.g., createlang doesn't output
> anything, and createuser outputs CREATE ROLE.
>
> I would just remove all this, but I suppose this will be controversial?

Removal of the tags is fine with me.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-01 19:29:24
Message-ID: 46607394.6020408@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> The messages output by the "scripts" always seemed unnecessary to me, e.g.,
>
> $ createdb foo
> CREATE DATABASE
>
> A Unix program (hi Magnus) shouldn't need to say anything if the requested
> action succeeded.
>
> I believe the history of this output is actually that these scripts simply
> used to call psql and no one really questioned why the output should be this
> way. There are also some inconsistencies, e.g., createlang doesn't output
> anything, and createuser outputs CREATE ROLE.
>
> I would just remove all this, but I suppose this will be controversial?

And what about replace all "scripts" by one command e.g pg_cmd with
following interface:

pg_cmd create database <...>
create role ...
drop database ...
list database
...

It solves potential name collision (for example createuser should
collide with other unix command) and output is easy maintainable in one
application.

Zdenek


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-01 20:05:47
Message-ID: 46607C1B.6040002@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Zdenek Kotala wrote:
>
> And what about replace all "scripts" by one command e.g pg_cmd with
> following interface:
>
> pg_cmd create database <...>
> create role ...
> drop database ...
> list database
> ...
>
>
> It solves potential name collision (for example createuser should
> collide with other unix command) and output is easy maintainable in
> one application.
>
>
>

And we'll break a million applications that rely on the command names.
We really don't have the luxury of being able to revisit every design
decision that's ever been made.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-01 20:46:10
Message-ID: 23221.1180730770@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Zdenek Kotala wrote:
>> And what about replace all "scripts" by one command e.g pg_cmd with
>> following interface:
>>
>> pg_cmd create database <...>

> And we'll break a million applications that rely on the command names.

If you want that, it already exists: it's pronounced "psql -c ...".

regards, tom lane


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-01 22:20:06
Message-ID: 46609B96.2010206@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Zdenek Kotala wrote:
>>> And what about replace all "scripts" by one command e.g pg_cmd with
>>> following interface:
>>>
>>> pg_cmd create database <...>
>
>> And we'll break a million applications that rely on the command names.

Compatibility is possible solve with parsing arg[0]. If old name appears
there command line will be parsed in old style... This functionally
should keep there for some transition interval. Packager will be
responsible if he create links for backward compatibility or not.

> If you want that, it already exists: it's pronounced "psql -c ...".

No, it is not solution, because you still have binaries with strange
names (e.g. createuser) on the disk.

Zdenek


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-02 02:20:47
Message-ID: 4660D3FF.2040503@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Zdenek Kotala wrote:
> Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> Zdenek Kotala wrote:
>>>> And what about replace all "scripts" by one command e.g pg_cmd with
>>>> following interface:
>>>>
>>>> pg_cmd create database <...>
>>
>>> And we'll break a million applications that rely on the command names.
>
> Compatibility is possible solve with parsing arg[0]. If old name
> appears there command line will be parsed in old style... This
> functionally should keep there for some transition interval. Packager
> will be responsible if he create links for backward compatibility or not.

Well, I don't think rolling up the miscellaneous commands into a single
binary with behaviour dependent on arg[0] is a bad idea. I don't think
it's something to be looked at during feature freeze, though, especially
given our backlog. I think we'd need a good long lead time before we
removed the old names from our default install - at least one release
cycle, so it would be two years or more before this became any sort of
reality.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-02 05:24:32
Message-ID: 833.1180761872@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Zdenek Kotala wrote:
>>>> And what about replace all "scripts" by one command e.g pg_cmd with
>>>> following interface:

> Well, I don't think rolling up the miscellaneous commands into a single
> binary with behaviour dependent on arg[0] is a bad idea.

I don't think that responds to Zdenek's complaint though. He's unhappy
about polluting /usr/bin with commands like "createuser" --- which is
not an unreasonable gripe. AFAICS it doesn't help if "createuser"
is a link to a single executable rather than a file of its own.

But in the light of backwards-compatibility requirements, I can't see us
removing "createuser" from the distribution ... not in 8.4, nor several
releases thereafter.

Sun's certainly free to not ship createuser in their packaging of PG,
and see what sort of push-back they get.

regards, tom lane


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-04 10:14:27
Message-ID: 4663E603.2040504@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane napsal(a):
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Zdenek Kotala wrote:
>>>>> And what about replace all "scripts" by one command e.g pg_cmd with
>>>>> following interface:
>
>> Well, I don't think rolling up the miscellaneous commands into a single
>> binary with behaviour dependent on arg[0] is a bad idea.
>
> I don't think that responds to Zdenek's complaint though. He's unhappy
> about polluting /usr/bin with commands like "createuser" --- which is
> not an unreasonable gripe. AFAICS it doesn't help if "createuser"
> is a link to a single executable rather than a file of its own.

Yes, It was one idea (after midnight :-) how to keep backward
compatibility for next few releases, but better solution is keep old
binaries for couple of release cycles.

> But in the light of backwards-compatibility requirements, I can't see us
> removing "createuser" from the distribution ... not in 8.4, nor several
> releases thereafter.

I agree, I only want to start discussion about new command which will
replace old binaries. Old binaries will be marked as obsolete and they
will be removed e.g. in 9.0. Until we do not have the new command we can
not start thinking about remove old one. I think we can have new command
ready for 8.4.

Zdenek


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-04 13:39:17
Message-ID: 200706041339.l54DdHb18031@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Is this a TODO?

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

Zdenek Kotala wrote:
> Tom Lane napsal(a):
> > Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> >> Zdenek Kotala wrote:
> >>>>> And what about replace all "scripts" by one command e.g pg_cmd with
> >>>>> following interface:
> >
> >> Well, I don't think rolling up the miscellaneous commands into a single
> >> binary with behaviour dependent on arg[0] is a bad idea.
> >
> > I don't think that responds to Zdenek's complaint though. He's unhappy
> > about polluting /usr/bin with commands like "createuser" --- which is
> > not an unreasonable gripe. AFAICS it doesn't help if "createuser"
> > is a link to a single executable rather than a file of its own.
>
> Yes, It was one idea (after midnight :-) how to keep backward
> compatibility for next few releases, but better solution is keep old
> binaries for couple of release cycles.
>
> > But in the light of backwards-compatibility requirements, I can't see us
> > removing "createuser" from the distribution ... not in 8.4, nor several
> > releases thereafter.
>
> I agree, I only want to start discussion about new command which will
> replace old binaries. Old binaries will be marked as obsolete and they
> will be removed e.g. in 9.0. Until we do not have the new command we can
> not start thinking about remove old one. I think we can have new command
> ready for 8.4.
>
>
> Zdenek
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-04 14:31:26
Message-ID: 19015.1180967486@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Is this a TODO?

I don't think so; there is no demand from anybody but Zdenek to remove
those programs. Has it ever even come up before?

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-04 14:43:27
Message-ID: 200706041443.l54EhRM20784@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Is this a TODO?
>
> I don't think so; there is no demand from anybody but Zdenek to remove
> those programs. Has it ever even come up before?

No. Agreed.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: "Robert Haas" <Robert(dot)Haas(at)dyntek(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Zdenek Kotala" <Zdenek(dot)Kotala(at)Sun(dot)COM>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-05 01:16:24
Message-ID: 57653AD4C1743546B3EE80B21262E5CB7370F9@EXCH01.ds.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

It's always seemed a little odd to me that Postgres should install a
command called "createuser" or "createlang", because it's entirely
non-obvious on first examination that these commands (which often live
in /usr/bin) have any connections with PostgreSQL. Shouldn't there be
at least be a "pg" in the name somewhere?

...Robert

-----Original Message-----
From: pgsql-hackers-owner(at)postgresql(dot)org
[mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Monday, June 04, 2007 10:31 AM
To: Bruce Momjian
Cc: Zdenek Kotala; Andrew Dunstan; Peter Eisentraut;
pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Command tags in create/drop scripts

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Is this a TODO?

I don't think so; there is no demand from anybody but Zdenek to remove
those programs. Has it ever even come up before?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-05 16:05:28
Message-ID: 466589C8.1070409@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>> Is this a TODO?
>
> I don't think so; there is no demand from anybody but Zdenek to remove
> those programs. Has it ever even come up before?
>

Tom, Bruce

I started with postgres 6.5 as administrator and from this version names
of these utilities have been for me little bit confusing and annoying. I
have hoped that it will be changed in the future. It is my personal
feeling since 1999. I prefer to add on TODO list and also question is
why we don't have:

"pg_ctl -D <path> init" instead of initdb command?

Zdenek


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-05 16:19:50
Message-ID: 20070605161950.GF14474@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Zdenek Kotala wrote:
> Tom Lane wrote:
> >Bruce Momjian <bruce(at)momjian(dot)us> writes:
> >>Is this a TODO?
> >
> >I don't think so; there is no demand from anybody but Zdenek to remove
> >those programs. Has it ever even come up before?

Personally I found really strange to have "createuser" and "createdb"
shipped by Postgres when I started using it. I just didn't complain.

> "pg_ctl -D <path> init" instead of initdb command?

Seems a reasonable thing to do too. Harder to type for developers, but
how much of a problem this is for real users? And developers can script
the thing anyway so I don't think this is a real problem.

One idea is to move the offending binaries into libexec, and have pg_ctl
or other helpers (pg_cmd) call them; and where compatibility with the
old versions is requested, create symlinks in bindir.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-05 17:52:39
Message-ID: 1181065959.618700.42900@j4g2000prf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jun 5, 9:19 am, alvhe(dot)(dot)(dot)(at)commandprompt(dot)com (Alvaro Herrera) wrote:
> Zdenek Kotala wrote:
> > Tom Lane wrote:
> > >Bruce Momjian <b(dot)(dot)(dot)(at)momjian(dot)us> writes:
> > >>Is this a TODO?
>
> > >I don't think so; there is no demand from anybody but Zdenek to remove
> > >those programs. Has it ever even come up before?
>
> Personally I found really strange to have "createuser" and "createdb"
> shipped by Postgres when I started using it. I just didn't complain.

+1. Given the prevalence of the pg_foo convention, those names are
clunky. So is initdb. I'm less creative than Zdenek, so I'd suggest
simply renaming to pg_createuser and friends with the same command
line options as the originals. Have the binaries check $0 and emit a
warning about using the deprecated name to STDERR if called by a name
that doesn't have the pg_ prefix. Default to symlinking the old names
for backwards compatibility until 9.0.

Andrew


From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-09 01:12:22
Message-ID: 20070609011221.GU92628@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 05, 2007 at 05:52:39PM -0000, Andrew Hammond wrote:
> On Jun 5, 9:19 am, alvhe(dot)(dot)(dot)(at)commandprompt(dot)com (Alvaro Herrera) wrote:
> > Zdenek Kotala wrote:
> > > Tom Lane wrote:
> > > >Bruce Momjian <b(dot)(dot)(dot)(at)momjian(dot)us> writes:
> > > >>Is this a TODO?
> >
> > > >I don't think so; there is no demand from anybody but Zdenek to remove
> > > >those programs. Has it ever even come up before?
> >
> > Personally I found really strange to have "createuser" and "createdb"
> > shipped by Postgres when I started using it. I just didn't complain.
>
> +1. Given the prevalence of the pg_foo convention, those names are
> clunky. So is initdb. I'm less creative than Zdenek, so I'd suggest
> simply renaming to pg_createuser and friends with the same command
> line options as the originals. Have the binaries check $0 and emit a
> warning about using the deprecated name to STDERR if called by a name
> that doesn't have the pg_ prefix. Default to symlinking the old names
> for backwards compatibility until 9.0.

+1
--
Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-09 05:42:44
Message-ID: 466A3DD4.3000403@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Jim C. Nasby wrote:
> On Tue, Jun 05, 2007 at 05:52:39PM -0000, Andrew Hammond wrote:
>> On Jun 5, 9:19 am, alvhe(dot)(dot)(dot)(at)commandprompt(dot)com (Alvaro Herrera) wrote:
>>> Zdenek Kotala wrote:
>>>> Tom Lane wrote:
>>>>> Bruce Momjian <b(dot)(dot)(dot)(at)momjian(dot)us> writes:
>>>>>> Is this a TODO?
>>>>> I don't think so; there is no demand from anybody but Zdenek to remove
>>>>> those programs. Has it ever even come up before?
>>> Personally I found really strange to have "createuser" and "createdb"
>>> shipped by Postgres when I started using it. I just didn't complain.
>> +1. Given the prevalence of the pg_foo convention, those names are
>> clunky. So is initdb. I'm less creative than Zdenek, so I'd suggest
>> simply renaming to pg_createuser and friends with the same command
>> line options as the originals. Have the binaries check $0 and emit a
>> warning about using the deprecated name to STDERR if called by a name
>> that doesn't have the pg_ prefix. Default to symlinking the old names
>> for backwards compatibility until 9.0.
>
> +1

+1

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>, Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-09 14:12:09
Message-ID: 15904.1181398329@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> Jim C. Nasby wrote:
>> On Tue, Jun 05, 2007 at 05:52:39PM -0000, Andrew Hammond wrote:
>>> +1. Given the prevalence of the pg_foo convention, those names are
>>> clunky. So is initdb. I'm less creative than Zdenek, so I'd suggest
>>> simply renaming to pg_createuser and friends with the same command
>>> line options as the originals. Have the binaries check $0 and emit a
>>> warning about using the deprecated name to STDERR if called by a name
>>> that doesn't have the pg_ prefix. Default to symlinking the old names
>>> for backwards compatibility until 9.0.
>>
>> +1

> +1

I like this better than the original proposal, too. Doing more than
this seems like more work and more confusion for users than the problem
justifies.

regards, tom lane


From: David Fetter <david(at)fetter(dot)org>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-09 17:16:00
Message-ID: 20070609171600.GA9435@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jun 08, 2007 at 08:12:22PM -0500, Jim C. Nasby wrote:
> On Tue, Jun 05, 2007 at 05:52:39PM -0000, Andrew Hammond wrote:
> > On Jun 5, 9:19 am, alvhe(dot)(dot)(dot)(at)commandprompt(dot)com (Alvaro Herrera) wrote:
> > > Zdenek Kotala wrote:
> > > > Tom Lane wrote:
> > > > >Bruce Momjian <b(dot)(dot)(dot)(at)momjian(dot)us> writes:
> > > > >>Is this a TODO?
> > >
> > > > >I don't think so; there is no demand from anybody but Zdenek to remove
> > > > >those programs. Has it ever even come up before?
> > >
> > > Personally I found really strange to have "createuser" and "createdb"
> > > shipped by Postgres when I started using it. I just didn't complain.
> >
> > +1. Given the prevalence of the pg_foo convention, those names are
> > clunky. So is initdb. I'm less creative than Zdenek, so I'd suggest
> > simply renaming to pg_createuser and friends with the same command
> > line options as the originals. Have the binaries check $0 and emit a
> > warning about using the deprecated name to STDERR if called by a name
> > that doesn't have the pg_ prefix. Default to symlinking the old names
> > for backwards compatibility until 9.0.
>
> +1

+1

It's a lot easier just to prefix the names than to do something
"clever."

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: David Fetter <david(at)fetter(dot)org>
Cc: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>, Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2007-06-12 12:53:25
Message-ID: 466E9745.5010803@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:
> On Fri, Jun 08, 2007 at 08:12:22PM -0500, Jim C. Nasby wrote:
>> On Tue, Jun 05, 2007 at 05:52:39PM -0000, Andrew Hammond wrote:
>>> On Jun 5, 9:19 am, alvhe(dot)(dot)(dot)(at)commandprompt(dot)com (Alvaro Herrera) wrote:
>>>> Zdenek Kotala wrote:
>>>>> Tom Lane wrote:
>>>>>> Bruce Momjian <b(dot)(dot)(dot)(at)momjian(dot)us> writes:
>>>>>>> Is this a TODO?
>>>>>> I don't think so; there is no demand from anybody but Zdenek to remove
>>>>>> those programs. Has it ever even come up before?
>>>> Personally I found really strange to have "createuser" and "createdb"
>>>> shipped by Postgres when I started using it. I just didn't complain.
>>> +1. Given the prevalence of the pg_foo convention, those names are
>>> clunky. So is initdb. I'm less creative than Zdenek, so I'd suggest
>>> simply renaming to pg_createuser and friends with the same command
>>> line options as the originals. Have the binaries check $0 and emit a
>>> warning about using the deprecated name to STDERR if called by a name
>>> that doesn't have the pg_ prefix. Default to symlinking the old names
>>> for backwards compatibility until 9.0.
>> +1
>
> +1
>
> It's a lot easier just to prefix the names than to do something
> "clever."

I agree that it is easier to implement. But my original idea was create
one command which should be easy expandable. For example add LIST
command which it allow to get list of users, roles, langs, databases
(instead of psql -l). There is also no way how to create table space?
Will we add command pg_createtablespace ? I think better is keep it in
one binary instead extend list of deliverable object.

I think for people is better to remember pg_cmd --help instead looking
for pg_something command. And a lot of code is share anyway. The nice
example is ZFS implementation. You need only know two commands (ZPOOL
and ZFS) to configure everything include NFS sharing.

Zdenek


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command tags in create/drop scripts
Date: 2008-03-11 19:48:32
Message-ID: 200803111948.m2BJmWE15901@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Added to TODO:

* Prefix command-line utilities like createuser with 'pg_'

http://archives.postgresql.org/pgsql-hackers/2007-06/msg00025.php

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

Alvaro Herrera wrote:
> Zdenek Kotala wrote:
> > Tom Lane wrote:
> > >Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > >>Is this a TODO?
> > >
> > >I don't think so; there is no demand from anybody but Zdenek to remove
> > >those programs. Has it ever even come up before?
>
> Personally I found really strange to have "createuser" and "createdb"
> shipped by Postgres when I started using it. I just didn't complain.
>
> > "pg_ctl -D <path> init" instead of initdb command?
>
> Seems a reasonable thing to do too. Harder to type for developers, but
> how much of a problem this is for real users? And developers can script
> the thing anyway so I don't think this is a real problem.
>
> One idea is to move the offending binaries into libexec, and have pg_ctl
> or other helpers (pg_cmd) call them; and where compatibility with the
> old versions is requested, create symlinks in bindir.
>
> --
> Alvaro Herrera http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +