Re: failure and silence of SQL commands

Lists: pgsql-novice
From: "John Payne" <drjohnpayne(at)gmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: failure and silence of SQL commands
Date: 2011-04-28 03:03:02
Message-ID: 000301cc0550$ca841c80$5f8c5580$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

I'm running psql version 8.1.11 on a Linux server from the command line. It
gives me absolutely no feedback from SQL commands and all SQL commands fail,
but the internal psql commands such as /d or /echo all work. I am not
running it in silent mode; the command I use to start it is just the
standard "psql -d database -U user". It tells me that I'm connected, I can
examine the tables, but it won't execute SQL.

Has anyone had similar issues?

Thanks,

John


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John Payne" <drjohnpayne(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: failure and silence of SQL commands
Date: 2011-04-28 13:28:58
Message-ID: 25877.1303997338@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

"John Payne" <drjohnpayne(at)gmail(dot)com> writes:
> I'm running psql version 8.1.11 on a Linux server from the command line. It
> gives me absolutely no feedback from SQL commands and all SQL commands fail,
> but the internal psql commands such as /d or /echo all work. I am not
> running it in silent mode; the command I use to start it is just the
> standard "psql -d database -U user". It tells me that I'm connected, I can
> examine the tables, but it won't execute SQL.

It would be easier to tell what was going on if you showed us a concrete
example (ie cut and paste from your terminal window) ... but I'm going
to take a stab in the dark and guess that maybe you're forgetting to
terminate your SQL commands with semicolons?

regards, tom lane


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 13:40:42
Message-ID: ipbqo5$ks3$1@news.albasani.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Tom Lane wrote:
> "John Payne"<drjohnpayne(at)gmail(dot)com> writes:
>> I'm running psql version 8.1.11 on a Linux server from the command line. It
>> gives me absolutely no feedback from SQL commands and all SQL commands fail,
>> but the internal psql commands such as /d or /echo all work. I am not
>> running it in silent mode; the command I use to start it is just the
>> standard "psql -d database -U user". It tells me that I'm connected, I can
>> examine the tables, but it won't execute SQL.
>
> It would be easier to tell what was going on if you showed us a concrete
> example (ie cut and paste from your terminal window) ... but I'm going
> to take a stab in the dark and guess that maybe you're forgetting to
> terminate your SQL commands with semicolons?

That's my first guess, too. But OP, your problem description is rather
imprecise. Tom's suggestion to use copy-and-paste to give details is an
excellent one if you find out that semicolons (a normal part of any SQL
command) don't fix your issue.

Let's look at the manual where it first introduces SQL syntax:
<http://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html>

"4.1. Lexical Structure

"SQL input consists of a sequence of commands. A command is composed of a
sequence of tokens, terminated by a semicolon (";")."

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