Re: Set Operators and Arrays Question

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Geoff Russell <geoff(at)austrics(dot)com(dot)au>
Cc: PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Set Operators and Arrays Question
Date: 2001-03-01 19:18:21
Message-ID: Pine.BSF.4.21.0103011116430.47142-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paulo Parola 2001-03-01 19:31:26 libpq.so.2.1 needed by php-pgsql-4.0.1pl2-9
Previous Message Justin Yung 2001-03-01 19:17:54 Making the datestyle be SQL on postmaster startup