agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedRe: < ``arrays of arrays'' >
9+ messages / 8 participants
[nested] [flat]
* Re: < ``arrays of arrays'' >
@ 1993-01-19 14:05 aoki@postgres.berkeley.edu
parent: Robert Rothe <rot@unlisys.IN-Berlin.DE>
0 siblings, 0 replies; 9+ messages in thread
From: aoki@postgres.berkeley.edu @ 1993-01-19 14:05 UTC (permalink / raw)
To: legacy
> is the following behavior concerning the entry 'Susi' correct ?
> append bla (name="Susi", telno = "{ "1191" }" ) \g
> ---------------------------------------------
> | Susi | {} | (null) |
> ---------------------------------------------
No. This is a bug in the array code. The code that parses array strings
first counts values in such a way that it can never count exactly one value.
Hence, you can never have an array constant with exactly one value.
This has been fixed in 4.1 (which will be out Any Day Now). However, you
*have* to quote a single value (or the parser can't tell the difference
between a blank text string and a null array). An artifact of the syntax..
--
Paul M. Aoki | CS Div., Dept. of EECS, UCB | aoki@postgres.Berkeley.EDU
| Berkeley, CA 94720 | ...!uunet!ucbvax!aoki
^ permalink raw reply [nested|flat] 9+ messages in thread
* < ``arrays of arrays'' >
@ 1993-01-19 20:01 Robert Rothe <rot@unlisys.IN-Berlin.DE>
0 siblings, 1 reply; 9+ messages in thread
From: Robert Rothe @ 1993-01-19 20:01 UTC (permalink / raw)
To: legacy
hi,
is the following behavior concerning the entry 'Susi' correct ?
create bla (name=char16, telno=text[]) \g
append bla (name="Hans", telno = "{ "110", "112" }") \g
append bla (name="Anna", telno = "{ "1164", "" }" ) \g
append bla (name="Karl", telno = "{ "1171", }" ) \g
append bla (name="Susi", telno = "{ "1191" }" ) \g
retrieve (bla.all, bla.telno[1]) \g
---------------------------------------------
| name | telno | telno |
---------------------------------------------
| Hans | {"110","112"} | 110 |
---------------------------------------------
| Anna | {"1164",""} | 1164 |
---------------------------------------------
| Karl | {"1171",""} | 1171 |
---------------------------------------------
| Susi | {} | (null) |
---------------------------------------------
thanx for info,
robert.
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: < ``arrays of arrays'' >
@ 1993-01-22 09:21 mick <M.J.Ridley@comp.brad.ac.uk>
0 siblings, 1 reply; 9+ messages in thread
From: mick @ 1993-01-22 09:21 UTC (permalink / raw)
To: legacy
Could someone explain which versions
have the array code bug ?
I re ran the original query on ver 4.0
and got the following .
* create bla (name=char16, telno=text[]) \g
append bla (name="Hans", telno = "{ "110", "112" }") \g
append bla (name="Anna", telno = "{ "1164", "" }" ) \g
append bla (name="Karl", telno = "{ "1171", }" ) \g
append bla (name="Susi", telno = "{ "1191" }" ) \g
CREATE
* APPEND 35951
* APPEND 35952
* APPEND 35953
* APPEND 35954
* retrieve (bla.all, bla.telno[1]) \g
-------------------------------------------
| name | telno | telno |
-------------------------------------------
| Hans | {"110","112"}| 110 |
-------------------------------------------
| Anna | {"1164",""} | 1164 |
-------------------------------------------
| Karl | {"1171",""} | 1171 |
-------------------------------------------
| Susi | {"1191"} | 1191 |
-------------------------------------------
Mick Ridley Dept of Computing
Phoenix Bldg
M.J.Ridley@bradford.ac.uk Univ of Bradford
Bradford BD7 1DP
0274 383946 UK
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: < ``arrays of arrays'' >
@ 1993-01-23 07:28 aoki@postgres.Berkeley.EDU
parent: mick <M.J.Ridley@comp.brad.ac.uk>
0 siblings, 0 replies; 9+ messages in thread
From: aoki@postgres.Berkeley.EDU @ 1993-01-23 07:28 UTC (permalink / raw)
To: legacy
> Could someone explain which versions
> have the array code bug ?
> I re ran the original query on ver 4.0
> and got the following .
Looking back at the RCS log and the date of the 4.0.1 tar file, it
looks like only 4.0.1 has that particular bug after all. Sorry to
scare people running old versions. However, the broken return
statement (in adt/arrayfunc.c:array_count) has a comment that *it*
is a fix for a bug in handling *zero*-length arrays, so ...
(BTW, the re-mailing of my last message was due to sendmail reprocessing
some enqueued messages on reboot, not my forgetful nature ..)
--
Paul M. Aoki | CS Div., Dept. of EECS, UCB | aoki@postgres.Berkeley.EDU
| Berkeley, CA 94720 | ...!uunet!ucbvax!aoki
^ permalink raw reply [nested|flat] 9+ messages in thread
* arrays of arrays
@ 1994-03-29 16:27 Dave Scott <mcsmidcs@vaxd.dct.ac.uk>
0 siblings, 1 reply; 9+ messages in thread
From: Dave Scott @ 1994-03-29 16:27 UTC (permalink / raw)
To: legacy
Dear Postgresers,
I seem to remember seeing this query before but have lost the relevant mail file.
I'm attempting to create an application which is best modelled using arrays of
arrays. I proceeded along the same lines as the example on p20 of the reference
manual but when I attempt a query similar to:
retrieve (stuff.a[2][2])\g
I receive: syntax error at or near "["
I'm now attempting to create an array type from scratch and would be grateful
for a brief explanation of how the "interesting stuff" is loaded into arrayp[0]
.....arrayp[array_size] (example p21)
Any help, pointers would be greatly appreciated,
Thanks in advance,
Dave.
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: arrays of arrays
@ 1994-03-29 19:21 Paul M. Aoki <aoki@postgres.Berkeley.EDU>
parent: Dave Scott <mcsmidcs@vaxd.dct.ac.uk>
0 siblings, 0 replies; 9+ messages in thread
From: Paul M. Aoki @ 1994-03-29 19:21 UTC (permalink / raw)
To: Dave Scott <mcsmidcs@vaxd.dct.ac.uk>; +Cc: legacy
Dave Scott <mcsmidcs@vaxd.dct.ac.uk> writes:
> I'm attempting to create an application which is best modelled using arrays of
> arrays.
the best answer, i think, is to get 4.2 which has real multidimensional
arrays.
up side: you get N-dim arrays that you can access through the query
language instead of a programming language. you also get syntax for
array slicing and other cool stuff.
down side: no one ever documented the internal format of the new arrays,
which makes it tough to manipulate them in the backend.
--
Paul M. Aoki | CS Div., Dept. of EECS, UCB | aoki@postgres.Berkeley.EDU
| Berkeley, CA 94720 | ...!uunet!ucbvax!aoki
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re:arrays of arrays
@ 1994-03-30 18:00 Dave Scott <mcsmidcs@vaxd.dct.ac.uk>
0 siblings, 0 replies; 9+ messages in thread
From: Dave Scott @ 1994-03-30 18:00 UTC (permalink / raw)
To: legacy
Thanks for the response Paul.
Unfortunately, for various reasons, I'm stuck with 4.1.
I wonder if any Postgreser out there has created a variable-length
array type from scratch as on p21 of 4.1 user manual.
I've attempted to write the functions but I guess my beginner's C
skills aren't up to it.
Any help greatly appreciated,
Dave.
^ permalink raw reply [nested|flat] 9+ messages in thread
* arrays of arrays
@ 1995-02-11 00:50 Drunkard Terry <yutaka-i@is.aist-nara.ac.jp>
0 siblings, 1 reply; 9+ messages in thread
From: Drunkard Terry @ 1995-02-11 00:50 UTC (permalink / raw)
To: legacy
When I create the attribute and append some value below...
* create manager (name = char16, employees = text[] ) \g
* append manager (name = "mike",
employees = "{"wei", "greg", "jeff", "terry"}" ) \g
* append manager (name = "alice",
employees = "{"bill", "joe", "terry"}" ) \g
So, I tried query below..
* retrieve ( manager.name ) where manager.employees="{"greg","jeff","terry"}" \g
return the message below..
------------------------
WARN:Feb 11 09:44:15:OperatorDef: no operator =
------------------------
I missed the syntax?
---------------- Terry [G'Job !]
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: arrays of arrays
@ 1995-02-12 01:35 Robert.Patrick@cs.cmu.edu
parent: Drunkard Terry <yutaka-i@is.aist-nara.ac.jp>
0 siblings, 0 replies; 9+ messages in thread
From: Robert.Patrick@cs.cmu.edu @ 1995-02-12 01:35 UTC (permalink / raw)
To: legacy
Excerpts from internet.postgres: 11-Feb-95 arrays of arrays Drunkard
Terry@is.aist-n (1109*)
> When I create the attribute and append some value below...
>
> * create manager (name = char16, employees = text[] ) \g
> * append manager (name = "mike",
> employees = "{"wei", "greg", "jeff", "terry"}" ) \g
> * append manager (name = "alice",
> employees = "{"bill", "joe", "terry"}" ) \g
> So, I tried query below..
> * retrieve ( manager.name ) where
> manager.employees="{"greg","jeff","terry"}" \g
> return the message below..
> ------------------------
> WARN:Feb 11 09:44:15:OperatorDef: no operator =
> ------------------------
> I missed the syntax?
That's funny,
rasam.ndim.edrc.cmu.edu> monitor test
Welcome to the POSTGRES terminal monitor
Go
* create manager(name=char16, employees=text[])\g
Query sent to backend is "create manager(name=char16, employees=text[])"
CREATE
Go
* append manager(name="mike",
employees="{"wei", "greg", "jeff", "terry"}")\g
Query sent to backend is "append manager(name="mike",
employees="{"wei", "greg", "jeff", "terry"}")"
APPEND 36606
Go
* append manager (name="alice",
employees="{"bill","joe","terry"}")\g
Query sent to backend is "append manager (name="alice",
employees="{"bill","joe","terry"}")"
APPEND 36607
Go
* retrieve (manager.name) where
manager.employees="{"greg","jeff","terry"}"\g
Query sent to backend is "retrieve (manager.name) where
manager.employees="{"greg","jeff","terry"}""
---------------
| name |
---------------
Go
* \q
rasam.ndim.edrc.cmu.edu>
Cheers,
Robert
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
^ permalink raw reply [nested|flat] 9+ messages in thread
end of thread, other threads:[~1995-02-12 01:35 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1993-01-19 20:01 < ``arrays of arrays'' > Robert Rothe <rot@unlisys.IN-Berlin.DE>
1993-01-19 14:05 ` aoki@postgres.berkeley.edu
1993-01-22 09:21 Re: < ``arrays of arrays'' > mick <M.J.Ridley@comp.brad.ac.uk>
1993-01-23 07:28 ` aoki@postgres.Berkeley.EDU
1994-03-29 16:27 arrays of arrays Dave Scott <mcsmidcs@vaxd.dct.ac.uk>
1994-03-29 19:21 ` Re: arrays of arrays Paul M. Aoki <aoki@postgres.Berkeley.EDU>
1994-03-30 18:00 Re:arrays of arrays Dave Scott <mcsmidcs@vaxd.dct.ac.uk>
1995-02-11 00:50 arrays of arrays Drunkard Terry <yutaka-i@is.aist-nara.ac.jp>
1995-02-12 01:35 ` Re: arrays of arrays Robert.Patrick@cs.cmu.edu
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox