BUG #5286: pgAdmin will put table and field names in apostrophes which then must be used for accessing them

Lists: pgsql-bugs
From: "G(dot)Schaeffler" <scgn(at)sie(dot)at>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5286: pgAdmin will put table and field names in apostrophes which then must be used for accessing them
Date: 2010-01-18 11:03:54
Message-ID: 201001181103.o0IB3sth028745@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5286
Logged by: G.Schaeffler
Email address: scgn(at)sie(dot)at
PostgreSQL version: 8.4.2
Operating system: windows server 2003 std
Description: pgAdmin will put table and field names in apostrophes
which then must be used for accessing them
Details:

if i create a table by using the pgadmin gui, it will create statements
like
CREATE TABLE "t_test" (
id integer,
"val" character varying(1000) NOT NULL );
after creation, i can only access the table again if i wrap the apostrophes
around the table and field names as in the create table statement.

ie.
SELECT * from t_test; will return ERROR: Relation t_test does not exit
SELECT val from "t_test" will return ERROR: field val does not exist.

when using the following sql statement
select * from information_schema.tables where table_schema='public' and
table_type='BASE TABLE'
to get the tablename as it is saved in the db, it will return t_test, not
"t_test" though.


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "G(dot)Schaeffler" <scgn(at)sie(dot)at>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5286: pgAdmin will put table and field names in apostrophes which then must be used for accessing them
Date: 2010-01-18 15:16:03
Message-ID: 603c8f071001180716w15c14f78u2e496ff3222eaabc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Mon, Jan 18, 2010 at 6:03 AM, G.Schaeffler <scgn(at)sie(dot)at> wrote:
>
> The following bug has been logged online:
>
> Bug reference:      5286
> Logged by:          G.Schaeffler
> Email address:      scgn(at)sie(dot)at
> PostgreSQL version: 8.4.2
> Operating system:   windows server 2003 std
> Description:        pgAdmin will put table and field names in apostrophes
> which then must be used for accessing them
> Details:
>
> if i create a table by using the pgadmin gui, it will create statements
> like
> CREATE TABLE "t_test" (
> id integer,
> "val" character varying(1000) NOT NULL );
> after creation, i can only access the table again if i wrap the apostrophes
> around the table and field names as in the create table statement.
>
> ie.
> SELECT * from t_test; will return ERROR: Relation t_test does not exit
> SELECT val from "t_test" will return ERROR: field val does not exist.
>
> when using the following sql statement
> select * from information_schema.tables where table_schema='public' and
> table_type='BASE TABLE'
> to get the tablename as it is saved in the db, it will return t_test, not
> "t_test" though.

The good news is that I don't think you've found a bug. You're
probably making a mistake somewhere in here. Someone else would have
surely noticed by now if what you're saying were true. The bad news
is that I don't know what advice to give you on how to fix it. The
further bad news is that this is not the right place for pgadmin
questions (if you reread the bug reporting form carefully, you'll
notice that pgadmin bugs are listed as one of the things not to report
here). I think you might want to try here:

http://archives.postgresql.org/pgadmin-support/

...Robert


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "G(dot)Schaeffler" <scgn(at)sie(dot)at>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5286: pgAdmin will put table and field names in apostrophes which then must be used for accessing them
Date: 2010-01-18 20:38:20
Message-ID: 20100118203820.GD3617@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

G.Schaeffler wrote:

> if i create a table by using the pgadmin gui, it will create statements
> like
> CREATE TABLE "t_test" (
> id integer,
> "val" character varying(1000) NOT NULL );
> after creation, i can only access the table again if i wrap the apostrophes
> around the table and field names as in the create table statement.

Does your table name have uppercase chars? If it has, that's probably
the reason the name doesn't work unless quoted. This is expected
behavior for identifiers.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support