Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: PATCH: make plpgsql IN args mutable (v1)


  • From: Jeff Davis <pgsql(at)j-davis(dot)com>
  • To: David Fetter <david(at)fetter(dot)org>
  • Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Steve Prentice <prentice(at)cisco(dot)com>, pgsql-hackers(at)postgresql(dot)org
  • Subject: Re: PATCH: make plpgsql IN args mutable (v1)
  • Date: Thu, 30 Jul 2009 18:39:24 -0700
  • Message-id: <1249004364.709.3.camel@monkey-cat.sm.truviso.com> <text/plain>

On Thu, 2009-07-30 at 17:40 -0700, David Fetter wrote:
> > > This patch changes plpgsql IN parameters so they are mutable. Previously,
> > > they were being forced constant. This patch modifies the plpgsql.sql
> > > regression test and corresponding .out file. The regression test also makes
> > > sure the passed in parameter does not get changed in the calling function.
> 
> Wouldn't INOUT parameters cover this case?

That was my first, thought, but I don't think it solves his concern. The
out parameters are returned as part of a record, but he actually wants
to mutate the value passed in.

If mutable IN parameters were allowed, I don't even think it could be
allowable to call them from the SQL level, you could only from another
function.

For instance, what would it mean if you did something like:

SELECT foo(a) FROM mytable;

Where foo() mutated it's IN argument? Would that really be an UPDATE?

Regards,
	Jeff Davis




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group