Search Postgresql Archives

deleting function

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

 



Dear Friends

I have table called below
I need to delete the record by using id value of the table
For that I wrote below function

create or replace function newd(id integer ) returns void as $$
begin
delete from testing where id=$1;
end;
$$
language 'plpgsql';

Here I call the function as " select newd(100) "

But it is deleting every things from the table

My doubt is , why it was deleting  every thing , even I gave the
single value in function .

pavunkumar=> \d testing;
        Table "hospital.testing"
 Column  |       Type        | Modifiers
---------+-------------------+-----------
 id      | integer           | not null
 name    | character varying |
 address | character varying |
Indexes:
    "testing_pkey" PRIMARY KEY, btree (id)


-- 
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