Обсуждение: Intermittent Empty return

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

Intermittent Empty return

От
John Mulkerin
Дата:
I'm new to Postgres.  I'm trying to select data from my survey_results 
table.   My server is running Postgres 7.3.4.   I log in as root (its 
RH), then
psql database_name.   Its says "Welcome..... ". I then type "SELECT * 
from survey_results" and hit enter. Nothing!  It just goes back to the 
database_name prompt.

Its like there is no data in the table and I know its there.  I can see 
it in the Cold Fusion admin screen and I've seen it before in sql. \du 
reflects root being a superuser.\dp survey_results says root has arwdRxt 
access privileges.  It just seems that 95% of time I get nothing back.   
Even if I type "SELECT * from trash", It returns nothing and I can't 
find any table called trash.

I've searched the list archives but haven't found any solution to my 
problem.
Can anyone suggest a fix?

John



Re: Intermittent Empty return

От
Tom Lane
Дата:
John Mulkerin <jmulkerin@comcast.net> writes:
> I'm new to Postgres.  I'm trying to select data from my survey_results 
> table.   My server is running Postgres 7.3.4.

Do you realize how ancient that version is?  An update would be a
real good idea.

> I log in as root (its RH), then
> psql database_name.   Its says "Welcome..... ". I then type "SELECT * 
> from survey_results" and hit enter. Nothing!  It just goes back to the 
> database_name prompt.

It sounds like you've forgotten to end the command with a semicolon.
        regards, tom lane


Re: Intermittent Empty return

От
John Mulkerin
Дата:
I agree its old.   I'm working on the upgrade but first need to verify 
and then purge some data. 

I tried with and without a semicolon

However, with a semicolon results in

Just tried semicolon again..   First time resulted in results.  Second 
time resulted in
select * from survey_results;
ERROR:  parser: parse error at or near "select" at character 30.
Maybe another reason I need to upgrade?

Tom Lane wrote:
> John Mulkerin <jmulkerin@comcast.net> writes:
>   
>> I'm new to Postgres.  I'm trying to select data from my survey_results 
>> table.   My server is running Postgres 7.3.4.
>>     
>
> Do you realize how ancient that version is?  An update would be a
> real good idea.
>
>   
>> I log in as root (its RH), then
>> psql database_name.   Its says "Welcome..... ". I then type "SELECT * 
>> from survey_results" and hit enter. Nothing!  It just goes back to the 
>> database_name prompt.
>>     
>
> It sounds like you've forgotten to end the command with a semicolon.
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>   


Re: Intermittent Empty return

От
"Scott Marlowe"
Дата:
On 9/22/07, John Mulkerin <jmulkerin@comcast.net> wrote:
> I agree its old.   I'm working on the upgrade but first need to verify
> and then purge some data.
>
> I tried with and without a semicolon
>
> However, with a semicolon results in
>
> Just tried semicolon again..   First time resulted in results.  Second
> time resulted in
> select * from survey_results;
> ERROR:  parser: parse error at or near "select" at character 30.
> Maybe another reason I need to upgrade?

That's because what it's doing it running this:
select * from table select * from table;

i.e. it's seeing the first one you typed without the semicolon then
second one too.

You'll notice the prompt looks like this;

dbname => select * from table
dbname -> select * from table;

notice the ->  That means there's already something in the buffer.

\r resets the buffer.  Just try it with ONLY the semicolon and it'll work.

and yeah, get to work on that upgrade... :)


Re: Intermittent Empty return

От
John Mulkerin
Дата:
Thanks a lot.

Scott Marlowe wrote:
> On 9/22/07, John Mulkerin <jmulkerin@comcast.net> wrote:
>   
>> I agree its old.   I'm working on the upgrade but first need to verify
>> and then purge some data.
>>
>> I tried with and without a semicolon
>>
>> However, with a semicolon results in
>>
>> Just tried semicolon again..   First time resulted in results.  Second
>> time resulted in
>> select * from survey_results;
>> ERROR:  parser: parse error at or near "select" at character 30.
>> Maybe another reason I need to upgrade?
>>     
>
> That's because what it's doing it running this:
> select * from table select * from table;
>
> i.e. it's seeing the first one you typed without the semicolon then
> second one too.
>
> You'll notice the prompt looks like this;
>
> dbname => select * from table
> dbname -> select * from table;
>
> notice the ->  That means there's already something in the buffer.
>
> \r resets the buffer.  Just try it with ONLY the semicolon and it'll work.
>
> and yeah, get to work on that upgrade... :)
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
>