Re: Mysql -> PgSQL

From: Jeff Davis <list-pgsql-general(at)empires(dot)org>
To: Tommi Maekitalo <t(dot)maekitalo(at)epgmbh(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: Mysql -> PgSQL
Date: 2002-08-23 20:44:47
Message-ID: 200208231344.47146.list-pgsql-general@empires.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, user defined functions can take arrays as arguments, and I think they can
take a variable number of arguments (after all, coalesce does).

And yes, MySQL's way is cleaner. I think the key is to allow user defined
types to take arguments, then all this stuff could go into a contrib module
and the functionality would be available with little effort.

Regards,
Jeff

On Friday 23 August 2002 01:25 am, 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arguile 2002-08-23 22:42:42 Re: Transaction processing from a Perl script....
Previous Message Oleg Bartunov 2002-08-23 20:06:39 Re: [GENERAL] integer[] Update Questions