[GENERAL] PREPARED STATEMENT

2004-12-11 Thread NosyMan
Hi there,

I want to know that is a posibillity to test if a statement is prepared in 
PL/PgSQL. 

I have create a function:
.
PREPARE PSTAT_SAVE_record(INTEGER, INTEGER, DATE, VARCHAR) AS INSERT INTO 
table VALUES($1, $2, $3, $4);
.

When I try to execute it second time I got an error: prepared statement  
'PSTAT_SAVE_record' already exists. How can I avoid this error? is there a 
posibillity to test if a statement was prepared before?


Thanks,
Nosy

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[GENERAL] test datatype for ANY

2005-02-11 Thread NosyMan
Hi there,

How can I test the type of a parameter passed to a function via ANY data type? 
I want something like this:

CREATE OR REPLACE FUNCTION myfunction(_param ANY) RETURNS INTEGER AS $$
BEGIN
IF "_param IS OF INTEGER TYPE" THEN
-- do something with INTEGER
END IF;
IF "param is of BOOLEAN TYPE" THEN
-- do something with BOOLEAN
END IF;
RETURN;
END;
$$ LANGUAGE plpgsql;


Thanks,
Nosy


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly