Search Postgresql Archives

Re: deleting function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/04/2009 14:03, pavunkumar wrote:
> create or replace function newd(id integer ) returns void as $$
> begin
> delete from testing where id=$1;
> end;

I'd guess it's because the column name, "id", is the same as the
argument name - plpgsql thinks that "id" in the DELETE statement is the
argument, so in effect you're doing -

  delete from testing where true;

- with the results you saw. Give the argument a different name and you
should be OK.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@xxxxxx
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux