pg.ddx.io postgres@postgres.berkeley.edu mailing list archive
help / color / mirror / Atom feedQuestion
5+ messages / 4 participants
[nested] [flat]
* Question
@ 1992-01-23 17:26 Jesualdo Cerqueira Fernandes <jcf@sputnik.ul.pt>
0 siblings, 0 replies; 5+ messages in thread
From: jcf@sputnik.ul.pt @ 1992-01-23 17:26 UTC (permalink / raw)
To: postgres@postgres.berkeley.edu
I would like to contact Dr. Stonebraker by e-mail. Would you please send me
his e-mail address ?
Thank you very much.
Jesualdo Cerqueira Fernandes (e-mail jcf@ul.pt)
^ permalink raw reply [nested|flat] 5+ messages in thread
* question
@ 1992-06-16 17:27 Carolin Engel <engel@freia.inf.tu-dresden.de>
0 siblings, 1 reply; 5+ messages in thread
From: Carolin Engel @ 1992-06-16 17:27 UTC (permalink / raw)
To: postgres@postgres.berkeley.edu
Dresden, 15.06.1992
Dear Sirs !
I'm a graduate student at the Technical University Dresden in the
department of databases.
I'm dealing with Yours system POSTGRES, Version 3.0 but I have
some problems:
1. I have defined your example object class "emp":
emp (name = char16, ..., budget = int4[12]) \g
(found in the Reference Manual, 1/16/90, Page 18)
I want to access the first element of vector "budget" addressing
it with the angular brackets:
replace emp (budget[1] = 10) \g
But it come an error message : Syntax error at or near "["
How can I address the i-th element of a vector ?
2. I have defined the following object classes and type:
create ADDRESS(city = char16, street = char16) \g
define type T_ADDR (internallength = -1,
input = array_in,
output = array_out,
element = ADDRESS) \g
create PERSON (name = char16, age = int2, adr = T_ADDR[]) \g
I want to append data to the object class PERSON so that a
person can have many different addresses.
That give a problem because the possibility define an attribute
as a postquel function described in the article "The POSTGRES
Data Model" (Page 11)
(for example: create PERSON (name = char16, adr = postquel)\g)
and than append data in the form
append PERSON (name ="Charles", adr ="retrieve (A.all)
from A in address where A.city ="Dresden")\g
is not allowed in Version 3.0.
The execute-command doesn't work too.
My question: How can I append values to an object class as
subobject references from another object class using my class
and type definition described over?
3. Can You send me some more information about handling Large
Objects (Large Object Backend Interface)?
Gratefull for Your help !
Carolin Engel
My e-mail-address:
x-400 : engel@serv1.informatik.tu-dresden.dbp.de
or UNIX: engel@freia.inf.tu-dresden.de
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: question
@ 1992-07-05 12:00
parent: Carolin Engel <engel@freia.inf.tu-dresden.de>
0 siblings, 0 replies; 5+ messages in thread
From: @ 1992-07-05 12:00 UTC (permalink / raw)
To: postgres@postgres.berkeley.edu
you write:
> 1. I have defined your example object class "emp":
> emp (name = char16, ..., budget = int4[12]) \g
> (found in the Reference Manual, 1/16/90, Page 18)
> I want to access the first element of vector "budget" addressing
> it with the angular brackets:
> replace emp (budget[1] = 10) \g
> But it come an error message : Syntax error at or near "["
>
> How can I address the i-th element of a vector ?
You can't in replace statements. We are working on overcoming the
short comings of arrays. Currently they are second class citizens
in postgres. When you want to replace a single element you are forced
to replace the entire array. That is you have to give the full array
constant as you do in append or copy.
> 2. I have defined the following object classes and type:
> create ADDRESS(city = char16, street = char16) \g
> define type T_ADDR (internallength = -1,
> input = array_in,
> output = array_out,
> element = ADDRESS) \g
> create PERSON (name = char16, age = int2, adr = T_ADDR[]) \g
>
>
> I want to append data to the object class PERSON so that a
> person can have many different addresses.
> That give a problem because the possibility define an attribute
> as a postquel function described in the article "The POSTGRES
> Data Model" (Page 11)
> (for example: create PERSON (name = char16, adr = postquel)\g)
> and than append data in the form
> append PERSON (name ="Charles", adr ="retrieve (A.all)
> from A in address where A.city ="Dresden")\g
> is not allowed in Version 3.0.
> The execute-command doesn't work too.
>
> My question: How can I append values to an object class as
> subobject references from another object class using my class
> and type definition described over?
Unfortunately arrays of complex types are not supported (and won't be
anytime soon).
> 3. Can You send me some more information about handling Large
> Objects (Large Object Backend Interface)?
The large object interface has changed significantly since version 3.
The version 4.0 docs will have a much description of how to use them and
will be out shortly.
Jeff Meredith
mer@postgres.berkeley.edU
^ permalink raw reply [nested|flat] 5+ messages in thread
* Question
@ 1993-06-10 23:55 GUO kun <guokun@cs.concordia.ca>
0 siblings, 0 replies; 5+ messages in thread
From: GUO kun @ 1993-06-10 23:55 UTC (permalink / raw)
To: postgres@postgres.berkeley.edu
I was testing a retrieve command on a class
Circle with x, and y cordinates as float8.
In retrieving an object with particular x I got this
error message
* retrieve (my_circle.all)\g
Query sent to backend is "retrieve (my_circle.all)"
---------------------------------------------------------
| center_y | center_x | color | radius |
---------------------------------------------------------
| 0 | 0 | (null) | 1 |
---------------------------------------------------------
| 0 | 0 | (null) | 2 |
---------------------------------------------------------
Go
* retrieve (my_circle.all) where my_circle.center_x = 0.0 \g
Query sent to backend is "retrieve (my_circle.all) where my_circle.center_x = 0.0 "
NOTICE:Jun 10 19:45:18:there is no operator = for types float4 and float8
NOTICE:Jun 10 19:45:18:You will either have to retype this query using an
NOTICE:Jun 10 19:45:18:explicit cast, or you will have to define the operator
WARN:Jun 10 19:45:18:= for float4 and float8 using DEFINE OPERATOR
Please let me know what can be done. According to the manual
I have on page 42 (reference man.) the operator
= is defined in both cases float4 and float8.
Thanks,
Kun Guo
^ permalink raw reply [nested|flat] 5+ messages in thread
* Question
@ 1993-06-11 01:00 Caroline M. Paxson <paxson@postgres.Berkeley.EDU>
0 siblings, 0 replies; 5+ messages in thread
From: Caroline M. Paxson @ 1993-06-11 01:00 UTC (permalink / raw)
To: postgres@postgres.berkeley.edu
You write:
I was testing a retrieve command on a class
Circle with x, and y cordinates as float8.
In retrieving an object with particular x I got this
error message
* retrieve (my_circle.all)\g
Query sent to backend is "retrieve (my_circle.all)"
- ---------------------------------------------------------
| center_y | center_x | color | radius |
- ---------------------------------------------------------
| 0 | 0 | (null) | 1 |
- ---------------------------------------------------------
| 0 | 0 | (null) | 2 |
- ---------------------------------------------------------
Go
* retrieve (my_circle.all) where my_circle.center_x = 0.0 \g
Query sent to backend is "retrieve (my_circle.all) where my_circle.center_x = 0.0 "
NOTICE:Jun 10 19:45:18:there is no operator = for types float4 and float8
NOTICE:Jun 10 19:45:18:You will either have to retype this query using an
NOTICE:Jun 10 19:45:18:explicit cast, or you will have to define the operator
WARN:Jun 10 19:45:18:= for float4 and float8 using DEFINE OPERATOR
I just tried your example and can't reproduce your problem. If,
however, I define center_x and center_y as float4's, I get the
problem. The constant 0.0 in your retrieve query is converted to
a float8 type by the parser. There is no = operator to compare
float4's and float8's. If you look at the reference manual, you
will notice that the = functions for float4 and float8 both take
two arguments of the same type. The error case occurs when a
float8 is compared to a float4.
To fix your problem, simply cast the 0.0 into the type you need:
retrieve (my_circle.all) where my_circle.center_x = 0.0::float4
Carol Paxson
paxson@cs.berkeley.edu
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~1993-06-11 01:00 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1992-01-23 17:26 Question Jesualdo Cerqueira Fernandes <jcf@sputnik.ul.pt>
1992-06-16 17:27 question Carolin Engel <engel@freia.inf.tu-dresden.de>
1992-07-05 12:00 ` Re: question
1993-06-10 23:55 Question GUO kun <guokun@cs.concordia.ca>
1993-06-11 01:00 Question Caroline M. Paxson <paxson@postgres.Berkeley.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