Hi, John,
jd: When you use psql, you must specify the database you want to connect
to. It is not a step after connecting. This might not be apparent if you
quickly glance at the documentation because it shows that dbname and user
name are optional parameters. But if you don't supply a database name, it
tries to connect to a database which matches your account user name.
dss: I will take a closer look at that logon command syntax.
...
dss: >> Why am I not able to select from the test db table I created?
Instead, I get... ERROR: relation "default_cols" does not exist?
jd: PostgreSQL folds unquoted identifier names to lower case. If your table
listing shows the name in upper (or mixed) case, it likely means that the
table was named with quotes as in
CREATE TABLE "DEFAULT_COLS" ...
rather than
CREATE TABLE DEFAULT_COLS ...
So if it is named using double quotes, you will have to use that in your
commands:
select * from "DEFAULT_COLS";
dss: PROBLEM SOLVED. The quotes were the issue. fyi, the table was
created by using pgAdmin III (default settings), so that default is naming
tables using quotes. Thank you very much, Sir.
David Sadler
Ref:
(1)
----- Original Message -----
From: "John DeSoi" <desoi@pgedit.com>
To: "David Sadler" <david@dicapp.com>
Cc: "pgsql-novice" <pgsql-novice@postgresql.org>
Sent: Saturday, May 28, 2005 12:11 AM
Subject: Re: [NOVICE] ERROR: relation "default_cols" does not exist
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL