From: | darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain) |
---|---|
To: | Zeugswetter Andreas <zeugswettera(at)wien(dot)spardat(dot)at> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Changes to functions and triggers |
Date: | 2000-06-22 13:59:26 |
Message-ID: | m1357Vu-000AY6C@druid.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thus spake Zeugswetter Andreas
> > darcy(at)druid(dot)net (D'Arcy J.M. Cain) writes:
> > > nargs = trigger->tgnargs;
> > > if (nargs != 4)
> > > elog(ERROR, "make_date (%s): %d args", relname, nargs);
>
> The simple answer is, that your procedure does not take four arguments.
> The old and new tuple are passed implicitly to your procedure,
> they don't show up in the argument list.
Right. That's why the function takes void as its parameter list. (I hadn't
shown that in my message.) The code above finds the args from the global
environment.
In fact, my problem was, I think, that I needed to use the SPI_connect() and
SPI_finish() functions which I don't think were available when I first wrote
the function. I added those, recompiled and all now works. It just took
me a while to realize that the problem was in the C code and not the SQL
statements to use it.
> This is also the reason your code works if you add four "dummy" string
> arguments (you can test that by supplying random values not the column names
> in your create trigger statement).
Nope. Without the fix above it didn't work no matter what I tried.
Thanks for everyone's help. Now I can move on to the operator defining
problem but that's a subject for another message.
It's funny but the two areas inthe new version that I am having trouble
with are the two that I originally helped document. :-)
--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2000-06-22 14:35:19 | Re: Big 7.1 open items |
Previous Message | Giles Lean | 2000-06-22 11:58:08 | Re: Big 7.1 open items |