Re: Set Operators and Arrays Question - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Set Operators and Arrays Question
Date
Msg-id Pine.BSF.4.21.0103011116430.47142-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Set Operators and Arrays Question  (Geoff Russell <geoff@austrics.com.au>)
List pgsql-general
> Wish List Solution:
>
> Heres what I think would be really the best way to solve the problem.
>
>         create table member       (  member_id serial, data text);
>         create table mailing      (  mailing_id serial, name text);
>         create table memb_mailing (  member_id int,mailings int[]);
>
> Here the initial mailings array is empty and I say things like:
>
>         update memb_mailing add 27 into mailings
>              where member_id=templist.member_id;
>
> This just inserts the letter number 27 into the mailings array. And we could
> also say things like:
>
>         select M.member_id from member M,memb_mailing MM
>              where M.member_id=MM.member_id and
>              MM.mailings contains 27;

You may want to look at the contrib/array directory for additional
functions and operators for arrays (which includes is this an element
of this array function/operator)


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Set Operators and Arrays Question
Next
From: Peter Eisentraut
Date:
Subject: Re: Users in pg_shadow