Search Postgresql Archives

Function to ADD a value into each column of real[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
 if I have this table:
 CREATE TABLE teste (
id     integer,
picos   real[],
);

and insert this values:
INSERT INTO teste VALUES(1, '{{1,2,3},{1,2,3},{1,2,3},{1,2,3},
{1,2,3}}');
INSERT INTO teste VALUES(2, '{{1,2,3},{1,2,3},{1,2,3},{1,2,3},{1,2,3},
{1,2,3},{1,2,3}}');
INSERT INTO teste VALUES(3, '{{1,2,3},{1,2,3},{1,2,3},{1,2,3},{1,2,3},
{1,2,3},{1,2,3},{1,2,3}}');
INSERT INTO teste VALUES(4, '{{1,2,3},{1,2,3},{1,2,3}}');

I need to write a function to return all the record of this table and
add a 0 in the begin of each array.
Ex.:

1, {{0,1,2,3},{0,1,2,3},{0,1,2,3},{0,1,2,3},{0,1,2,3}}
.............

How can I do that?
Any idea?!



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux