Re: integer array, push and pop

From: Ryan Mahoney <ryan(at)paymentalliance(dot)net>
To: Teodor Sigaev <teodor(at)stack(dot)net>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: integer array, push and pop
Date: 2002-10-22 14:41:06
Message-ID: 1035297666.1086.78.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is excellent! Thanks so much!

-r

On Tue, 2002-10-22 at 04:07, Teodor Sigaev wrote:
> regression=# select '{124,567,66}'::int[] + 345;
> ?column?
> ------------------
> {124,567,66,345}
> (1 row)
> regression=# select '{124,567,66}'::int[] + '{345,1}'::int[];
> ?column?
> --------------------
> {124,567,66,345,1}
> (1 row)
> select '{124,567,66}'::int[] - 567;
> ?column?
> ----------
> {124,66}
> (1 row)
> regression=# select '{124,567,66}'::int[] - '{567,66}';
> ?column?
> ----------
> {124}
> (1 row)
>
>
> Ryan Mahoney wrote:
> > Hi Oleg (and pgsql hackers!),
> >
> > Recently I encountered a problem attempting to use the integer array
> > function for pushing an integer onto an integer array field.
> >
> > Can you write an example of a sql statement for pushing a single value onto
> > an integer array and for popping a specific value off of an integer array?
> > I see the function in the documentation, but the actual statement syntax to
> > use is not clear to me.
> >
> > Thanks for any help you can provide!
> >
> > Ryan Mahoney
> >
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
> >
>
> --
> Teodor Sigaev
> teodor(at)stack(dot)net
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Sullivan 2002-10-22 14:51:48 Re: Disabling triggers (was Re: pgsql 7.2.3 crash)
Previous Message Zeugswetter Andreas SB SD 2002-10-22 14:35:46 Re: autocommit vs TRUNCATE et al