Hi,
this select produces error message:
test=> select test2(NULL);
ERROR:  typeidTypeRelid: Invalid type - oid = 0
test2:
CREATE FUNCTION test2 (int4) RETURNS int4 AS '
Declare
    keyval      Alias For $1;
    cnt         int4;
Begin
  Update hits set count = count +1  where msg_id = keyval;
  return cnt;
End;
' LANGUAGE 'plpgsql';
When I do manually update
Update hits set count = count +1  where msg_id = NULL;
it works fine. What's the problem ?
    Regards,
        Oleg
test=> \d hits
Table    = hits
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| msg_id                           | int4                             |     4 |
| count                            | int4                             |     4 |
+----------------------------------+----------------------------------+-------+
test=> select version();
version
------------------------------------------------------------------
PostgreSQL 6.5.2 on i586-pc-linux-gnulibc1, compiled by gcc 2.95.1
(1 row)
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83