Thread: float arrays

float arrays

From
oceano
Date:
I can't find any examples of using float arrays in a column.  I tried
creating a type but it keeps telling me that the type does not exist
-even though it is listed in the \dT list.
It sys it does not exist in the catalogue when I try to get access to an
index of the array?  I searched through numerous books they all seem to
skip over float arrays.  There is an ARRAY command in ORACLE.  Can this
be used in PostgresQL?

help
Shawn (newbie)


Re: float arrays

From
Tom Lane
Date:
oceano <nathan@psphalifax.ns.ca> writes:
> I can't find any examples of using float arrays in a column.

regression=# create table foo(f1 float[]);
CREATE
regression=# insert into foo values ('{1,2.4,3.7,42}');
INSERT 1523558 1
regression=# select * from foo;
           f1
------------------------
 {"1","2.4","3.7","42"}
(1 row)

regression=# update foo set f1[3] = 99.99;
UPDATE 1
regression=# select * from foo;
            f1
--------------------------
 {"1","2.4","99.99","42"}
(1 row)

regression=#

            regards, tom lane