pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Tables acting funny with pgaccess
6+ messages / 3 participants
[nested] [flat]

* Tables acting funny with pgaccess
@ 1999-03-01 00:25  Ben Gunter <bgunter@alef.gcsu.edu>
  0 siblings, 2 replies; 6+ messages in thread

From: Ben Gunter @ 1999-03-01 00:25 UTC (permalink / raw)
  To: pgsql-interfaces

I'm having a problem with pgaccess that's confounding me.

If I create a table with psql, I have no problems using pgaccess for
queries.  However, if I create a table using pgaccess, things go awry. 
Whenever I run a query (using psql or pgaccess) asking for specific
fields from a table created by pgaccess, I get an error similar to the
following:

> Error executing query

> declare mycursor cursor for select t0.lastname from "Present" t0

> PostgreSQL error message: ERROR: func_get_detail: No such attribute or function 'lastname'

> PostgreSQL status: PGRES_FATAL_ERROR

But if it's a table created by psql, it works.  Also, if I run a "select
*" query, it has no problem either.  It's only if I ask for a specific
field from a table created by pgaccess.

I'm using the visual query designer to create the queries.  I'm running
an AMD K6-2 300, 128MB RAM, RedHat Linux 5.2 (without the old Postgres
rpm's), kernel 2.2.1, PostgreSQL 6.4.2, and I have encountered this
error with pgaccess 0.93 and 0.94.  I have also seen the very same error
with pgaccess on a Sun Sparc 20 workstation running RedHat 5.2, kernel
2.0.35.  This also happens when using pgaccess for Windows NT 4.0 to
access the database on the Sun.

Any help would be greatly appreciated.

Thanks!

Ben



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

* Re: [INTERFACES] Tables acting funny with pgaccess
@ 1999-03-01 06:19  Constantin Teodorescu <teo@flex.ro>
  parent: Ben Gunter <bgunter@alef.gcsu.edu>
  1 sibling, 0 replies; 6+ messages in thread

From: Constantin Teodorescu @ 1999-03-01 06:19 UTC (permalink / raw)
  To: Ben Gunter <bgunter@alef.gcsu.edu>; pgsql-interfaces

Ben Gunter wrote:
> 
> > declare mycursor cursor for select t0.lastname from "Present" t0

Send me a small pg_dump of that table with a few records.
I will try it here.

-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA



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

* Re: [INTERFACES] Tables acting funny with pgaccess
@ 1999-03-01 14:40  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Ben Gunter <bgunter@alef.gcsu.edu>
  1 sibling, 1 reply; 6+ messages in thread

From: Tom Lane @ 1999-03-01 14:40 UTC (permalink / raw)
  To: bgunter@alef.gcsu.edu; +Cc: pgsql-interfaces

bgunter@alef.gcsu.edu (Ben Gunter) writes:
> I'm having a problem with pgaccess that's confounding me.
> If I create a table with psql, I have no problems using pgaccess for
> queries.  However, if I create a table using pgaccess, things go awry. 

>> PostgreSQL error message: ERROR: func_get_detail: No such attribute or function 'lastname'

> It's only if I ask for a specific
> field from a table created by pgaccess.

At a guess, pgaccess is generating the table with case of field names
preserved?  Ordinarily, table and field names are implicitly downcased,
but not if you put double quotes around 'em.

My bet is that pgaccess is quoting your field names during CREATE TABLE
but not doing so during SELECT ... a bad combination.

			regards, tom lane



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

* Re: [INTERFACES] Tables acting funny with pgaccess
@ 1999-03-01 15:00  Ben Gunter <bgunter@alef.gcsu.edu>
  0 siblings, 0 replies; 6+ messages in thread

From: Ben Gunter @ 1999-03-01 15:00 UTC (permalink / raw)
  To: Constantin Teodorescu <teo@flex.ro>; pgsql-interfaces

I have attached the pg_dump output, but you probably won't need it.

When I got your message this morning, I started looking into the problem a
little further.  I found two things that I should have noticed before:

1) The problem only occurs when I use capital letters in the field names
(e.g., "FirstName", "LastName").  Field names consisting of all lower case
letters don't cause a problem.

2) If I enclose the field name in quotes when running the query (e.g.,
SELECT t0."LastName" FROM "Present" t0;), then everything works just fine.

That _almost_ solves my problems.  It would be nice if I could use the
visual query designer to run queries on tables with field names containing
upper case letters.  (But then again, I could just make all my field names
lower case and all would be well.)

I think Tom Lane is right.  It seems like field names are being quoted when
the table is created, but not when a query is executed.

Thanks for looking into it.

-Ben

-----Original Message-----
From: Constantin Teodorescu <teo@flex.ro>
To: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgreSQL.org>
Date: Monday, March 01, 1999 2:17 AM
Subject: Re: [INTERFACES] Tables acting funny with pgaccess


>Ben Gunter wrote:
>>
>> > declare mycursor cursor for select t0.lastname from "Present" t0
>
>Send me a small pg_dump of that table with a few records.
>I will try it here.
>
>--
>Constantin Teodorescu
>FLEX Consulting Braila, ROMANIA
>
>




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

* Re: [INTERFACES] Tables acting funny with pgaccess
@ 1999-03-01 15:02  Ben Gunter <bgunter@alef.gcsu.edu>
  0 siblings, 0 replies; 6+ messages in thread

From: Ben Gunter @ 1999-03-01 15:02 UTC (permalink / raw)
  To: Constantin Teodorescu <teo@flex.ro>; pgsql-interfaces

Oops...here's the attachment.

-----Original Message-----
From: Ben Gunter <bgunter@alef.gcsu.edu>
To: Constantin Teodorescu <teo@flex.ro>; pgsql-interfaces@postgreSQL.org
<pgsql-interfaces@postgreSQL.org>
Date: Monday, March 01, 1999 10:00 AM
Subject: Re: [INTERFACES] Tables acting funny with pgaccess


>I have attached the pg_dump output, but you probably won't need it.
>
>When I got your message this morning, I started looking into the problem a
>little further.  I found two things that I should have noticed before:
>
>1) The problem only occurs when I use capital letters in the field names
>(e.g., "FirstName", "LastName").  Field names consisting of all lower case
>letters don't cause a problem.
>
>2) If I enclose the field name in quotes when running the query (e.g.,
>SELECT t0."LastName" FROM "Present" t0;), then everything works just fine.
>
>That _almost_ solves my problems.  It would be nice if I could use the
>visual query designer to run queries on tables with field names containing
>upper case letters.  (But then again, I could just make all my field names
>lower case and all would be well.)
>
>I think Tom Lane is right.  It seems like field names are being quoted when
>the table is created, but not when a query is executed.
>
>Thanks for looking into it.
>
>-Ben
>
>-----Original Message-----
>From: Constantin Teodorescu <teo@flex.ro>
>To: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgreSQL.org>
>Date: Monday, March 01, 1999 2:17 AM
>Subject: Re: [INTERFACES] Tables acting funny with pgaccess
>
>
>>Ben Gunter wrote:
>>>
>>> > declare mycursor cursor for select t0.lastname from "Present" t0
>>
>>Send me a small pg_dump of that table with a few records.
>>I will try it here.
>>
>>--
>>Constantin Teodorescu
>>FLEX Consulting Braila, ROMANIA
>>
>>
>

Attachments:

  Present.out (application/octet-stream, 439B) download

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

* Re: [INTERFACES] Tables acting funny with pgaccess
@ 1999-03-01 16:23  Constantin Teodorescu <teo@flex.ro>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Constantin Teodorescu @ 1999-03-01 16:23 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-interfaces; Ben Gunter <bgunter@alef.gcsu.edu>

Tom Lane wrote:
> 
> At a guess, pgaccess is generating the table with case of field names
> preserved?  Ordinarily, table and field names are implicitly downcased,
> but not if you put double quotes around 'em.

A very good guess I could say ! :-)

I have fixed that bug so we have a PgAccess 0.95 version !
The bug was also present in sort field  specification and in filter
field specification.
I have tested with several examples, including field names with mixed
case letters and also having spaces inside field names. It worked.

Please get the latest 0.95 version from http://www.flex.ro/pgaccess or
ftp://ftp.flex.ro/pub/pgaccess/pgaccess-0.95.tar.gz and let me know if
it's working as you expected.

Thanks for your help improving PgAccess,
-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA



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


end of thread, other threads:[~1999-03-01 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-01 00:25 Tables acting funny with pgaccess Ben Gunter <bgunter@alef.gcsu.edu>
1999-03-01 06:19 ` Constantin Teodorescu <teo@flex.ro>
1999-03-01 14:40 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-03-01 16:23   ` Constantin Teodorescu <teo@flex.ro>
1999-03-01 15:00 Re: [INTERFACES] Tables acting funny with pgaccess Ben Gunter <bgunter@alef.gcsu.edu>
1999-03-01 15:02 Re: [INTERFACES] Tables acting funny with pgaccess Ben Gunter <bgunter@alef.gcsu.edu>

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