By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,773 Members | 1,724 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,773 IT Pros & Developers. It's quick & easy.

Calling triggers with arguments

P: n/a

Greetings,

I've come across something that either doesn't work spec'd or I'm
missing something (I suspect the latter). I'm trying this:
CREATE TRIGGER classified_index_trigger
BEFORE INSERT OR UPDATE ON ads
FOR EACH ROW
EXECUTE PROCEDURE htdig_index('classified_en');

and the error message I get is:

ERROR: function htdig_index() does not exist

However if I do \df htdig_index I get this:

List of functions
Result data type | Schema | Name | Argument data types
------------------+--------+-------------+---------------------
"trigger" | public | htdig_index | text
Is there something I'm missing in order to pass an argument in a
trigger? I've tried double quotes, and two singles as well as no
quotes, and all lead to the same thing.

Any info would be much appreciated.

Cheers,

Chris

--
Christopher Murtagh
Enterprise Systems Administrator
ISR / Web Communications Group
McGill University
Montreal, Quebec
Canada

Tel.: (514) 398-3122
Fax: (514) 398-2017

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Christopher Murtagh <ch*****************@mcgill.ca> writes:
Greetings,

I've come across something that either doesn't work spec'd or I'm
missing something (I suspect the latter). I'm trying this:


Read the docs again. Args aren't passed to triggers through the
normal mechanism but via a special variable.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #2

P: n/a
On Fri, 2004-01-23 at 17:42, Doug McNaught wrote:
Christopher Murtagh <ch*****************@mcgill.ca> writes:
Greetings,

I've come across something that either doesn't work spec'd or I'm
missing something (I suspect the latter). I'm trying this:


Read the docs again. Args aren't passed to triggers through the
normal mechanism but via a special variable.


Thanks for the info. I finally found it (TG_ARGV[]). It certainly isn't
in an obvious place, and not clearly documented, but it was there.

Cheers,

Chris

--
Christopher Murtagh
Enterprise Systems Administrator
ISR / Web Communications Group
McGill University
Montreal, Quebec
Canada

Tel.: (514) 398-3122
Fax: (514) 398-2017
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #3

P: n/a
There wasn't much help online when I decided this had to be a concept that
would work. Sybase is not a lot of help on this either. After sometimes
spending hours staring at traces and explains in order to solve a single
problem (and often using a totally heuristic approach to debugging :-)), I
finally have real world applications running (very well in fact).

In order to document the details for myself, and to share them with others,
I've setup a small website. It's a little rough and incomplete so far, but
hopefully it will be useful to someone.

The address is: http://pbpgsql.spiderbark.com

Best regards,

Jim Wilson
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.