pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedindexing arrays in pgaccess's query interface is failing
3+ messages / 3 participants
[nested] [flat]
* indexing arrays in pgaccess's query interface is failing
@ 2001-07-03 09:05 David Stanaway <david@netventures.com.au>
2001-07-03 14:41 ` Re: [SQL] indexing arrays in pgaccess's query interface is failing Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: David Stanaway @ 2001-07-03 09:05 UTC (permalink / raw)
To: pgsql-sql@postgresql.org
Hi there, I am having some difficulties with using arrays in pgaccess
relating to arrays.
Here is an example schema:
CREATE TABLE arraykeys (
akID int,
akName varchar(12),
PRIMARY KEY(akID)
);
CREATE TABLE items (
itID serial,
itProperties bool[],
PRIMARY KEY(itID)
);
--.. And some Data
INSERT INTO arraykeys VALUES (1,'Active');
INSERT INTO arraykeys VALUES (2,'Overdue');
INSERT INTO arraykeys VALUES (3,'Local');
INSERT INTO items (itProperties) VALUES ( '{1,0,1}');
INSERT INTO items (itProperties) VALUES ( '{0,1,1}');
--.. And now the query that I am having problems with.
SELECT itID, itProperties[akID], akName
FROM items, arraykeys;
In the readline client psql, the above select statement works perfectly
scratch-# FROM items, arraykeys;
itid | itproperties | akname
------+--------------+---------
1 | t | Active
1 | f | Overdue
1 | t | Local
2 | f | Active
2 | t | Overdue
2 | t | Local
(6 rows)
However
In pgaccess,
when I try to execute the same query in query builder,
I get the tcl error dialogue:
Error: invalid command name "akID"
Is there an alternate way indexing arrays in queries that I should be
using?
Or is pgaccess just not suitable for this class of queries!
--
Best Regards
David Stanaway
========================.---------------------------------------------
Technology Manager - Australia's Premier Internet Broadcasters
david@NetVentures.com.au Office +612 9357 1699
========================'---------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [SQL] indexing arrays in pgaccess's query interface is failing
2001-07-03 09:05 indexing arrays in pgaccess's query interface is failing David Stanaway <david@netventures.com.au>
@ 2001-07-03 14:41 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-07-04 13:02 ` Re: Re: [SQL] indexing arrays in pgaccess's query interface is failing Constantin Teodorescu <teo@flex.ro>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2001-07-03 14:41 UTC (permalink / raw)
To: David Stanaway <david@netventures.com.au>; +Cc: pgsql-sql@postgresql.org; pgsql-interfaces
[ redirected to pgsql-interfaces, which seems a more appropriate venue ]
David Stanaway <david@netventures.com.au> writes:
> --.. And now the query that I am having problems with.
>
> SELECT itID, itProperties[akID], akName
> FROM items, arraykeys;
>
> In pgaccess,
> when I try to execute the same query in query builder,
> I get the tcl error dialogue:
> Error: invalid command name "akID"
Someone isn't quoting the query string correctly on the Tcl side ---
[akID] is Tclese for command substitution. Sounds like pgaccess expects
the user to quote command punctuation characters that should be passed
through. Not sure if that should be regarded as a bug or a feature.
It could be considered a feature that you can enter SQL commands with
Tcl command substitution performed on them, but it's something that
would confuse non-Tcl-users a lot.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Re: [SQL] indexing arrays in pgaccess's query interface is failing
2001-07-03 09:05 indexing arrays in pgaccess's query interface is failing David Stanaway <david@netventures.com.au>
2001-07-03 14:41 ` Re: [SQL] indexing arrays in pgaccess's query interface is failing Tom Lane <tgl@sss.pgh.pa.us>
@ 2001-07-04 13:02 ` Constantin Teodorescu <teo@flex.ro>
0 siblings, 0 replies; 3+ messages in thread
From: Constantin Teodorescu @ 2001-07-04 13:02 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Stanaway <david@netventures.com.au>; pgsql-sql@postgresql.org; pgsql-interfaces
Tom Lane wrote:
>
> [ redirected to pgsql-interfaces, which seems a more appropriate venue ]
>
> David Stanaway <david@netventures.com.au> writes:
> > --.. And now the query that I am having problems with.
> >
> > SELECT itID, itProperties[akID], akName
> > FROM items, arraykeys;
> >
> > In pgaccess,
> > when I try to execute the same query in query builder,
> > I get the tcl error dialogue:
> > Error: invalid command name "akID"
>
> Someone isn't quoting the query string correctly on the Tcl side ---
> [akID] is Tclese for command substitution. Sounds like pgaccess expects
> the user to quote command punctuation characters that should be passed
> through. Not sure if that should be regarded as a bug or a feature.
> It could be considered a feature that you can enter SQL commands with
> Tcl command substitution performed on them, but it's something that
> would confuse non-Tcl-users a lot.
Got the message!
I'll fix the Query builder to quote []'s!
Teo
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-07-04 13:02 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-03 09:05 indexing arrays in pgaccess's query interface is failing David Stanaway <david@netventures.com.au>
2001-07-03 14:41 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-07-04 13:02 ` Constantin Teodorescu <teo@flex.ro>
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