[CLUE-Tech] PostgreSQL: psql dry heaves (no usable error message)

Jed S. Baer thag at frii.com
Sat Jan 19 11:56:46 MST 2002


On Sat, 19 Jan 2002 10:42:35 -0700
Grant Johnson <grant at amadensor.com> wrote:

> >Well, psql (or Postgres) won't run this DDL, and all it tells me is it
> has
> >a parse error at or near "" (i.e. null string). Any thoughts?
> >
> I found it.  The last constraint has 2 more left than right parenthesis.
>  You also need a semicolon at the end (PostgreSQL does NOTHING until it 
> gets it in command line mode, and if running a file, I don't trust it 
> without)

Thanks Grant.

Actually, the semicolon isn't strictly required. In psql "\g" will also
execute the query buffer. Also, even with the semicolon, (using \edit),
when returning the to the psql prompt, it still presented as being in
"data entry" mode, and wouldn't recognize the ; as an "execute". This
looked to me like an unterminated string literal problem, since otherwise,
I'd expect any "execute" command to do just that. I also finally noticed
that the psql prompt string is context sensitive. Too bad the postres
parser isn't that intelligent - it should have caught the paren mismatch
in expression evaluation and reported it.

But, it's all happy now. I have yet to decide whether it makes any logical
sense ;-).
-- 
"Those who expect to reap the blessings of freedom must, like men,
 undergo the fatigue of supporting it."
 - Thomas Paine



More information about the clue-tech mailing list