pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres Array Traversing
3+ messages / 3 participants
[nested] [flat]
* Postgres Array Traversing
@ 2007-10-03 10:27 Yogesh Arora <yogesh.arora.daffodil@gmail.com>
2007-10-03 15:28 ` Re: Postgres Array Traversing Milen A. Radev <milen@radev.net>
0 siblings, 1 reply; 3+ messages in thread
From: Yogesh Arora @ 2007-10-03 10:27 UTC (permalink / raw)
To: Vishal Arora <aroravishal22@hotmail.com>; ashish.karalkar@info-spectrum.com; pgsql-admin
Hallo All Frnds,
I have to add an array in my table. and to update the array in a
Procedure called by the trigger.
In my case Like the Elements of the array are {1,2,5} now i have to
update it to {1,2,5,7} . I.e., Keeping the previous record as such and
appending the new elements.
Please reply at the urgent basis..............
Thanks in Advance......
you can reply me also at yogesh.arora@daffodildb.com
--
Best Regards,
Yogesh Arora
Mobile: 09255123173
Web : www.daffodildb.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Postgres Array Traversing
2007-10-03 10:27 Postgres Array Traversing Yogesh Arora <yogesh.arora.daffodil@gmail.com>
@ 2007-10-03 15:28 ` Milen A. Radev <milen@radev.net>
2007-10-04 06:57 ` Re: Postgres Array Traversing yogesh.arora.daffodil@gmail.com
0 siblings, 1 reply; 3+ messages in thread
From: Milen A. Radev @ 2007-10-03 15:28 UTC (permalink / raw)
To: pgsql-admin; +Cc: yogesh.arora@daffodildb.com
Yogesh Arora написа:
> Hallo All Frnds,
>
> I have to add an array in my table. and to update the array in a
> Procedure called by the trigger.
>
> In my case Like the Elements of the array are {1,2,5} now i have to
> update it to {1,2,5,7} . I.e., Keeping the previous record as such and
> appending the new elements.
[...]
According to the manual
(http://www.postgresql.org/docs/current/static/arrays.html#AEN5830) this
should work:
UPDATE example_table SET an_array_column = an_array_column || 7 WHERE
a_key_column = <value>;
P.S. This questions is probably more appropriate for the "pgsql-sql" list.
--
Milen A. Radev
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Postgres Array Traversing
2007-10-03 10:27 Postgres Array Traversing Yogesh Arora <yogesh.arora.daffodil@gmail.com>
2007-10-03 15:28 ` Re: Postgres Array Traversing Milen A. Radev <milen@radev.net>
@ 2007-10-04 06:57 ` yogesh.arora.daffodil@gmail.com
0 siblings, 0 replies; 3+ messages in thread
From: yogesh.arora.daffodil@gmail.com @ 2007-10-04 06:57 UTC (permalink / raw)
To: pgsql-admin
On Oct 3, 8:28 pm, mi...@radev.net ("Milen A. Radev") wrote:
> Yogesh Arora :> Hallo All Frnds,
>
> > I have to add an array in my table. and to update the array in a
> > Procedure called by the trigger.
>
> > In my case Like the Elements of the array are {1,2,5} now i have to
> > update it to {1,2,5,7} . I.e., Keeping the previous record as such and
> > appending the new elements.
>
> [...]
>
> According to the manual
> (http://www.postgresql.org/docs/current/static/arrays.html#AEN5830) this
> should work:
>
> UPDATE example_table SET an_array_column = an_array_column || 7 WHERE
> a_key_column = <value>;
>
> P.S. This questions is probably more appropriate for the "pgsql-sql" list.
>
> --
> Milen A. Radev
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
> http://www.postgresql.org/about/donate
Thanks Milen A. Radev It Works..
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2007-10-04 06:57 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-10-03 10:27 Postgres Array Traversing Yogesh Arora <yogesh.arora.daffodil@gmail.com>
2007-10-03 15:28 ` Milen A. Radev <milen@radev.net>
2007-10-04 06:57 ` yogesh.arora.daffodil@gmail.com
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