pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Jeff Boes <jboes@qtm.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Trigger and function not on speaking terms
Date: Mon, 2 Aug 2004 14:21:24 -0700 (PDT)
Message-ID: <20040802141931.W62987@megazone.bigpanda.com> (raw)
In-Reply-To: <BjxPc.133622$vJ6.20511@cyclops.nntpserver.com>
References: <BjxPc.133622$vJ6.20511@cyclops.nntpserver.com>

On Mon, 2 Aug 2004, Jeff Boes wrote:

> Hmm, this is puzzling me:
>
> create or replace function fn_foo(text) returns trigger as '
> begin
>    # Do some stuff with $1
> end;
> ' language 'plpgsql';
>
> CREATE FUNCTION
>
> create table bar (aaa text);
>
> CREATE TABLE
>
> create trigger trg_bar
> after insert or update on bar
> execute procedure fn_foo('string');
>
> ERROR:  function fn_foo() does not exist
>
> It would seem my trigger definition is trying to find fn_foo(), when I
> mean for it to call fn_foo(TEXT).

I don't remember why, but the arguments from the create trigger statement
are passed differently from standard arguments (I think it's like TGARGS
in plpgsql).



view thread (4+ messages)  latest in thread

Message-ID: <20040802141931.W62987@megazone.bigpanda.com>
Permalink:  ../20040802141931.W62987@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040802141931.W62987@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, jboes@qtm.net
  Subject: Re: Trigger and function not on speaking terms
  In-Reply-To: <20040802141931.W62987@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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