473,382 Members | 1,225 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Calling triggers with arguments


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
3 1302
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Shailan | last post by:
Hi Im having trouble with the following code that seems to be behave differently when called from the browser as opposed to the command line. The calling script is a cgi that forks, with the...
8
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
5
by: jodyblau | last post by:
I have a form with a subform. The form has a button which opens a dialogbox. I would like the dialog box to call a sub in the subform. I know how I would do this in C++, but I can't seem to...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
15
by: dspfun | last post by:
Hi, Is it possible to print the function name of the calling function? For example, f1() and f2() both calls f3(), in f3() I would like to print the name of the function calling f3() which...
2
by: Spoon | last post by:
Hello everyone, AFAIU, in C89, calling fprintf with too few arguments leads to UB. 4.9.6.1 The fprintf function Synopsis #include <stdio.h> int fprintf(FILE *stream, const char *format,...
12
by: tom_kuehnert | last post by:
Hi! I'm trying to execute a program using system(). The program itself is located in some path which might contain whitespaces. Simple solution would be this: system("\"C:\A B\C.exe\""); ...
10
by: sulekhasweety | last post by:
Hi, the following is the definition for calling convention ,which I have seen in a text book, can anyone give a more detailed explanation in terms of ANSI - C "the requirements that a...
6
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.