Re: Inconsistent SQL errors

From: Scott Mead <scott(dot)lists(at)enterprisedb(dot)com>
To: gvim <gvimrc(at)googlemail(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inconsistent SQL errors
Date: 2010-04-15 03:08:15
Message-ID: w2vd3ab2ec81004142008s7bedae3bm6fbbea626fa44b84@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 14, 2010 at 11:04 PM, gvim <gvimrc(at)googlemail(dot)com> wrote:

> I'm running PostgreSQL 8.4.3 on OS X Snow Leopard via MacPorts and I'm
> getting strange inconsistent errors such as:
>
> dbuser-# select * from log_form;
> ERROR: syntax error at or near "select"
> LINE 2: select * from log_form;
> ^
>
> Then later the same query will run fine, as it should.
>

Yup, it's because you previously entered something into psql without a ';'

Normally, the psql prompt shows:

dbuser=#

You are showing:

dbuser-#

(Notice the '-' instead of '=' )

This means that you entered a command and didn't put a semi-colon somewhere
along the way. If you see that, just enter a semi-colon and you'll get back
to a top-level (=#) prompt.

--Scott

>
> gvim
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2010-04-15 03:10:52 Re: [SOLVED] Error in Trigger function. How to correct?
Previous Message Bruce Momjian 2010-04-15 03:07:30 Re: How to insert Ecoded values into postrgresql