public inbox for [email protected]  
help / color / mirror / Atom feed
help for postgreSQL in shell
2+ messages / 2 participants
[nested] [flat]

* help for postgreSQL in shell
@ 2003-04-02 13:44  rx <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: rx @ 2003-04-02 13:44 UTC (permalink / raw)
  To: Undisclosed-Recipient:;@postgresql.org

Hallo,

I have a question in postgreSQL. I need your help!

I execute the psql as PostgreSQL 7.2 devel Documentation. 

But there is an Error:"ERROR: Relation "faxeingang" does not exist".

But the table "Faxeingang" is actually exist in Database "data"

my system: SuSE Linux 8.0, PostgreSQL 7.2.2, bash.

data is datebaseName.

faxeingang is TableName.

----------------------------------------------------------------------------------------------------------------------

Under is my command:

TuxFax:~ # echo "\x \\ select * from "Faxeingang";" | psql -U postgres data

Expanded display is on.

invalid command \

TuxFax:~ # echo "select * from "Faxeingang";" | psql -U postgres data

ERROR: Relation "faxeingang" does not exist

TuxFax:~ # echo "select * from Faxeingang;" | psql -U postgres data

ERROR: Relation "faxeingang" does not exist

TuxFax:~ # echo "select * from ""Faxeingang"";" | psql -U postgres data

ERROR: Relation "faxeingang" does not exist

TuxFax:~ # psql data -U postgres -c "select * from "Faxeingang""

ERROR: Relation "faxeingang" does not exist

TuxFax:~ # psql data -U postgres -c "select * from Faxeingang"

ERROR: Relation "faxeingang" does not exist

TuxFax:~ # psql data -U postgres -c "select * from ""Faxeingang"""

ERROR: Relation "faxeingang" does not exist

TuxFax:~ # 

*************************************************************************************
PostgreSQL 7.2 devel Documentation

psql
Name
psql --  PostgreSQL interactive terminal 
Synopsis
psql [option...] [dbname [username]]

Description
psql is a terminal-based front-end to PostgreSQL. It enables you to type in queries interactively, issue them to PostgreSQL, and see the query results. Alternatively, input can be from a file. In addition, it provides a number of meta-commands and various shell-like features to facilitate writing scripts and automating a wide variety of tasks. 

Options
-c command
--command command 

Specifies that psql is to execute one command string, command, and then exit. This is useful in shell scripts. 

command must be either a command string that is completely parsable by the server (i.e., it contains no psql specific features), or it is a single backslash command. Thus you cannot mix SQL and psql meta-commands. To achieve that, you could pipe the string into psql, like this: echo "\x \\ select * from foo;" | psql. 

If "autocommit" is on, multiple queries in a single string are processed in a single transaction. 

***********************************************************************************************************

thank you very very Much!

rong

[email protected]



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: help for postgreSQL in shell
@ 2003-04-03 21:19  Ian Barwick <[email protected]>
  parent: rx <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Ian Barwick @ 2003-04-03 21:19 UTC (permalink / raw)
  To: rx <[email protected]>; pgsql-docs

On Wednesday 02 April 2003 15:44, rx wrote:

> TuxFax:~ # echo "\x \\ select * from "Faxeingang";" | psql -U postgres data

Try:

  echo "select * from \"Faxeingang\"" | psql -x -U postgres data

or

  echo 'select * from "Faxeingang"' | psql -x -U postgres data

Please post this kind of question to the general or admin group,
it would be more appropriate there.

Ian Barwick
[email protected]





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-04-03 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-02 13:44 help for postgreSQL in shell rx <[email protected]>
2003-04-03 21:19 ` Ian Barwick <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox