failure and silence of SQL commands

Lists: pgsql-novice
From: "John Payne" <jcpayne(at)uw(dot)edu>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: failure and silence of SQL commands
Date: 2011-04-28 17:21:39
Message-ID: 000c01cc05c8$bcb52d10$361f8730$@edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Thank you both very much for your help; that was the problem. Stupid of me
(the answer came to me in the shower this morning as well). If anyone out
there in the developer community is listening, may I respectfully suggest
that PSQL's behavior --- to return nothing when Enter is hit - is
pathological. It would be so simple to return a message like "Waiting for
the end of the statement." and it would save novices like me a lot of very
unhappy hours.

Cheers,

John


From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 17:40:01
Message-ID: 201104281940.01380.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Thursday 28 April 2011 19:21:39 John Payne wrote:
> Thank you both very much for your help; that was the problem. Stupid of me
> (the answer came to me in the shower this morning as well). If anyone out
> there in the developer community is listening, may I respectfully suggest
> that PSQL's behavior --- to return nothing when Enter is hit - is
> pathological. It would be so simple to return a message like "Waiting for
> the end of the statement." and it would save novices like me a lot of very
> unhappy hours.

If you enter a line in psql without a final ; and then hit Enter, you should
notice that the prompt changes from a => to a ->. There's your "Waiting for
the end of the statement" message.

Your suggestion is, frankly said, ridiculous.

regards, Leif.


From: Robert Poor <rdpoor(at)gmail(dot)com>
To: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 17:50:59
Message-ID: BANLkTinEM9N+LpJyXa5NJbGwVi2_BGRSTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Thu, Apr 28, 2011 at 10:40, Leif Biberg Kristensen
<leif(at)solumslekt(dot)org> wrote:
> Your suggestion is, frankly said, ridiculous.

Gosh, Leif, where's the love? We were all novices once upon a time.


From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 18:02:40
Message-ID: 201104282002.40970.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Thursday 28 April 2011 19:50:59 Robert Poor wrote:
> On Thu, Apr 28, 2011 at 10:40, Leif Biberg Kristensen
>
> <leif(at)solumslekt(dot)org> wrote:
> > Your suggestion is, frankly said, ridiculous.
>
> Gosh, Leif, where's the love? We were all novices once upon a time.

Perhaps I was a bit harsh, but it was a reflex to the word "pathological" about
psql's behaviour. Coming from a novice, that's quite a mouthful.

regards, Leif


From: Michael Swierczek <mike(dot)swierczek(at)gmail(dot)com>
To: John Payne <jcpayne(at)uw(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 18:04:43
Message-ID: BANLkTi=qN4-RLeaTz=e3Hb-mXmQPkiLtbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Thu, Apr 28, 2011 at 1:21 PM, John Payne <jcpayne(at)uw(dot)edu> wrote:
> Thank you both very much for your help; that was the problem.  Stupid of me
> (the answer came to me in the shower this morning as well).  If anyone out
> there in the developer community is listening, may I respectfully suggest
> that PSQL’s behavior --- to return nothing when Enter is hit – is
> pathological.  It would be so simple to return a message like ”Waiting for
> the end of the statement…” and it would save novices like me a lot of very
> unhappy hours.
>

You're more ambitious than I was. When I started using PostgreSQL I
found psql intimidating so I used pgAdmin3 whenever possible.
pgAdmin3 is excellent and in my opinion much more friendly to us
novices than psql. Good luck.

Regards,
Mike


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Poor <rdpoor(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 18:30:24
Message-ID: 1342.1304015424@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Robert Poor <rdpoor(at)gmail(dot)com> writes:
> On Thu, Apr 28, 2011 at 10:40, Leif Biberg Kristensen
> <leif(at)solumslekt(dot)org> wrote:
>> Your suggestion is, frankly said, ridiculous.

> Gosh, Leif, where's the love? We were all novices once upon a time.

Yeah, and John's not exactly the first person to forget a semicolon.
I don't much like his proposed solution, because it would degrade from
"useful" to "incredibly irritating" after just a few minutes, or at
least it would as soon as you knew enough SQL to be entering multiline
queries. But it's worth thinking about how to respond to the problem.

In recent versions of psql, if you type "help" as the startup prompt
suggests, it will mention use of a semicolon:

$ psql postgres
psql (9.1devel)
Type "help" for help.

postgres=# help
You are using psql, the command-line interface to PostgreSQL.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=#

Now the first question is whether the "terminate with semicolon"
bit is clear enough for a novice. Some comments on this message
from someone who's just seen it for the first time might be useful.

The other thing that strikes me is that in order to make sure that
we don't accidentally take part of a SQL command as a help request,
"help" is only recognized as the very first word of input. So if
you'd put in some text and then started to wonder why you're not
getting an answer, "help" doesn't help:

postgres=# select 2+2
postgres-# help
postgres-#

Maybe we should be a little looser there? I mean, in theory the word
"help" alone on a line could be an intended part of a larger SQL
command, but in practice what are the odds?

regards, tom lane


From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 18:41:18
Message-ID: 201104282041.18270.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Thursday 28 April 2011 20:30:24 Tom Lane wrote:
> Robert Poor <rdpoor(at)gmail(dot)com> writes:
> > On Thu, Apr 28, 2011 at 10:40, Leif Biberg Kristensen
> >
> > <leif(at)solumslekt(dot)org> wrote:
> >> Your suggestion is, frankly said, ridiculous.
> >
> > Gosh, Leif, where's the love? We were all novices once upon a time.
>
> Yeah, and John's not exactly the first person to forget a semicolon.
> I don't much like his proposed solution, because it would degrade from
> "useful" to "incredibly irritating" after just a few minutes, or at
> least it would as soon as you knew enough SQL to be entering multiline
> queries. But it's worth thinking about how to respond to the problem.

I remember, back in the Stone Age, my first word processor had 4 levels of help
which could be changed by the user as he grew more proficient. Maybe a distinct
"Novice mode" in psql with the proposed kind of chatter could ease the
learning curve for the command-line challenged.

regards, Leif.


From: Robert Poor <rdpoor(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 19:22:59
Message-ID: BANLkTimnw0zh8pCn7q4UFraePn1HxecxdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

@Lief, @Tom: Good points (especially 'and John's not exactly the first
person to forget a semicolon.' ;)

Part of the problem may be that 'postgres=#' and 'postgres-#' look
mighty similar. If so, a simple fix would be to change PROMPT2 from
'%/%R%# ' to '%R%# ', that is, make a toplevel prompt show the
database name:

postgres=#

and drop the database name in the 'continuation' prompt:

-#

which would make it a lot more obvious that it's waiting for input.
John (et al) -- what do you think?

- r


From: Lew <noone(at)lewscanon(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 20:33:19
Message-ID: ipcitn$gno$1@news.albasani.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On 04/28/2011 01:21 PM, John Payne wrote:
> Thank you both very much for your help; that was the problem. Stupid of me
> (the answer came to me in the shower this morning as well). If anyone out
> there in the developer community is listening, may I respectfully suggest that
> PSQL’s behavior --- to return nothing when Enter is hit – is pathological. It
> would be so simple to return a message like ”Waiting for the end of the
> statement…” and it would save novices like me a lot of very unhappy hours.

Terrible idea. Then you'd be peppered with stupid messages while you're
composing a statement. It doesn't make sense to alter the system for one user
who refuses to learn it correctly.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg