Re: Mysql -> PgSQL - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Mysql -> PgSQL
Date
Msg-id 200208231529.g7NFTXj07978@candle.pha.pa.us
Whole thread Raw
In response to Re: Mysql -> PgSQL  (Tommi Maekitalo <t.maekitalo@epgmbh.de>)
List pgsql-general
What the SQL standard wants you to do with SETs is to create another
table to hold the codes, and another table to hold the relationships
between the master table rows and the values.

We do have an array type that may work in such cases, though the array
type is ordered and doesn't have pre-defined values for the elements.

---------------------------------------------------------------------------

Tommi Maekitalo wrote:
> Am Freitag, 23. August 2002 09:41 schrieb Jeff Davis:
> > Another question that comes to mind is: are there any plans to allow
> > user-defined types to accept argument lists? If that were the case, this
> > wouldn't be much of an issue, because anyone could just make a set type. As
> > it is, I think it needs to be added as a special case.
> >
> > Regards,
> >     Jeff
> >
>
> That brings me to an idea. You can write a function, which converts a list of
> strings to a bitmask and stores this value. Then it should be possible to
> write something like
>
>   insert into table(..., my_set) values (..., set('val1', 'val2', 'val3'))
>
> as the original poster inteded to do. You need then a set of functions, for
> queriing the values.
>
> I'm not so familiar with udfs in postgresql. Is it possible to write udfs with
> a variable number of arguments? Or is it possible to give a array-parameter
> to a udf.
>
> Mysqls set-type is still much more comfortable. Udfs is not a feature the
> average Mysql-user wants to use.
>
>
> Tommi
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: "Peter Gibbs"
Date:
Subject: Re: How to retrieve a comment/description from a table
Next
From: Stephan Szabo
Date:
Subject: Re: How to retrieve a comment/description from a table