pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
trigger trouble -- procedure not found
4+ messages / 3 participants
[nested] [flat]

* trigger trouble -- procedure not found
@ 2001-09-14 04:26 Kevin Way <kevin.way@overtone.org>
  2001-09-14 04:59 ` Re: trigger trouble -- procedure not found Bhuvan A <bhuvansql@yahoo.com>
  2001-09-14 05:16 ` Re: trigger trouble -- procedure not found Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2001-09-14 06:30 ` Re: trigger trouble -- procedure not found Kevin Way <kevin.way@overtone.org>
  0 siblings, 3 replies; 4+ messages in thread

From: Kevin Way @ 2001-09-14 04:26 UTC (permalink / raw)
  To: pgsql-sql

I'm having trouble creating a trigger.  First i'm creating a function,
add_to_search in PL/pgSQL.

\df verifies the existance of this function:
 smallint                 | add_to_search       | text, text, text, integer

but when I call:

CREATE TRIGGER item_insert_search_add AFTER INSERT
    ON item FOR EACH ROW
    EXECUTE PROCEDURE add_to_search (name, description, reason, node_id);

I get: 
ERROR:  CreateTrigger: function add_to_search() does not exist

What am I missing here?  It seems to me that I'm missing something very
simple, but I can't figure out what it is for the life of me.

Kevin Way



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: trigger trouble -- procedure not found
  2001-09-14 04:26 trigger trouble -- procedure not found Kevin Way <kevin.way@overtone.org>
@ 2001-09-14 04:59 ` Bhuvan A <bhuvansql@yahoo.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Bhuvan A @ 2001-09-14 04:59 UTC (permalink / raw)
  To: Kevin Way <kevin.way@overtone.org>; +Cc: pgsql-sql



On Sep 14, Kevin Way wrote:

> I'm having trouble creating a trigger.  First i'm creating a function,
> add_to_search in PL/pgSQL.
> 
> \df verifies the existance of this function:
>  smallint                 | add_to_search       | text, text, text, integer
> 

--  We can verify all the functions which wont return 'OPAQUE'.

> but when I call:
> 
> CREATE TRIGGER item_insert_search_add AFTER INSERT
>     ON item FOR EACH ROW
>     EXECUTE PROCEDURE add_to_search (name, description, reason, node_id);
> 
> I get: 
> ERROR:  CreateTrigger: function add_to_search() does not exist

The function executed by a trigger should by default return a
record. ie.. the return type should be 'OPAQUE'.

Try the above..
Hope this will work.

> 
> What am I missing here?  It seems to me that I'm missing something very
> simple, but I can't figure out what it is for the life of me.
> 
> Kevin Way
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: trigger trouble -- procedure not found
  2001-09-14 04:26 trigger trouble -- procedure not found Kevin Way <kevin.way@overtone.org>
@ 2001-09-14 05:16 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Stephan Szabo @ 2001-09-14 05:16 UTC (permalink / raw)
  To: Kevin Way <kevin.way@overtone.org>; +Cc: pgsql-sql


On Fri, 14 Sep 2001, Kevin Way wrote:

> I'm having trouble creating a trigger.  First i'm creating a function,
> add_to_search in PL/pgSQL.
> 
> \df verifies the existance of this function:
>  smallint                 | add_to_search       | text, text, text, integer
> 
> but when I call:
> 
> CREATE TRIGGER item_insert_search_add AFTER INSERT
>     ON item FOR EACH ROW
>     EXECUTE PROCEDURE add_to_search (name, description, reason, node_id);
> 
> I get: 
> ERROR:  CreateTrigger: function add_to_search() does not exist
> 
> What am I missing here?  It seems to me that I'm missing something very
> simple, but I can't figure out what it is for the life of me.

Trigger functions return opaque and take no arguments.  Arguments given
on the create trigger statement are passed in a special fashion. (I
believe for plpgsql you'd look at TG_NARGS and TG_ARGV[])




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: trigger trouble -- procedure not found
  2001-09-14 04:26 trigger trouble -- procedure not found Kevin Way <kevin.way@overtone.org>
@ 2001-09-14 06:30 ` Kevin Way <kevin.way@overtone.org>
  2 siblings, 0 replies; 4+ messages in thread

From: Kevin Way @ 2001-09-14 06:30 UTC (permalink / raw)
  To: Kevin Way <kevin.way@overtone.org>; +Cc: pgsql-sql

Thank you.  Later checking showed that these requirements were listed in
the first sentence of the relevant page.  Everything works like a champ
now.  I've made a small donation to the EFF and to the Red Cross as a
minor thanks for your prompt help.

Kevin Way



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-09-14 06:30 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-09-14 04:26 trigger trouble -- procedure not found Kevin Way <kevin.way@overtone.org>
2001-09-14 04:59 ` Bhuvan A <bhuvansql@yahoo.com>
2001-09-14 05:16 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-09-14 06:30 ` Kevin Way <kevin.way@overtone.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox