pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: variadic flag doesn't work with "any" type
Date: Fri, 10 Dec 2010 14:26:06 -0500
Message-ID: <27791.1292009166@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTi=L2LrEc+ohLVGs=4yHkes7yF3sejP4-m1nVi-H@mail.gmail.com>
References: <AANLkTimZPnb006g7xUKS0mT3KBYngGzohsNMmGMBnFUq@mail.gmail.com>
	<29821.1291928919@sss.pgh.pa.us>
	<AANLkTinU-jsNCiL9XUgnfatKZTixvSxWeG1N35XBfR2S@mail.gmail.com>
	<8691.1291934337@sss.pgh.pa.us>
	<AANLkTi=L2LrEc+ohLVGs=4yHkes7yF3sejP4-m1nVi-H@mail.gmail.com>

Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2010/12/9 Tom Lane <tgl@sss.pgh.pa.us>:
>> What exactly is the use-case for that?

> I am working on function that can help with record updating. It's
> based on polymorphic types. I would to allow a multiple modification
> per one call - like UPDATE statement does.
> some like:
> record_set_fields(anyelement, key text, value "any" [, key text, value
> "any" [..]]) returns anyelement

OK, makes sense, since you don't want to constrain the values to be all
the same datatype.

> sometimes can be interesting to use a VARIADIC value - so list of
> pairs (key,  value) can be created dynamically - (now I don't talk if
> this is good way or not).

That can't work unless you constrain all the values to be text (to match
the column-name parameters), which more or less defeats the entire point
of the function.  So I see no interesting use-case for VARIADIC here.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <27791.1292009166@sss.pgh.pa.us>
Permalink:  ../27791.1292009166@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27791.1292009166@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com
  Subject: Re: variadic flag doesn't work with "any" type
  In-Reply-To: <27791.1292009166@sss.pgh.pa.us>
  References: <AANLkTimZPnb006g7xUKS0mT3KBYngGzohsNMmGMBnFUq@mail.gmail.com> <29821.1291928919@sss.pgh.pa.us> <AANLkTinU-jsNCiL9XUgnfatKZTixvSxWeG1N35XBfR2S@mail.gmail.com> <8691.1291934337@sss.pgh.pa.us> <AANLkTi=L2LrEc+ohLVGs=4yHkes7yF3sejP4-m1nVi-H@mail.gmail.com> <27791.1292009166@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox