Обсуждение: failure and silence of SQL commands

Поиск
Список
Период
Сортировка

failure and silence of SQL commands

От
"John Payne"
Дата:

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

Re: failure and silence of SQL commands

От
Tom Lane
Дата:
"John Payne" <drjohnpayne@gmail.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

Re: failure and silence of SQL commands

От
Lew
Дата:
Tom Lane wrote:
> "John Payne"<drjohnpayne@gmail.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