Postgresql: Function foo() does not exist

Very often we are humbled by the simplest things and tonight I got a good one.

I had created a plpgsql function that was called from within a trigger to check for some duplicates in a table, blah blah. The function was working because I had tested it. It was registered in the "pg_proc" table and the two "proargtypes" were type 1043 ie varchar. This function was there, I could see it and if I was a character in Tron I could touch it, so why the hell when one of my scripts ran did I get: function foo does not exist.

I'll tell you why, I was not using the correct schema. Ahhhhhhhhhhhh.

I had tested it while logged in as the user who created it and that users schema is different from the user that needs to use it from the website. A quick

grant usage on schema foo to bar;

sorted that problem.

Add to delicious Digg This Add to My Yahoo! Add to Google Add to StumbleUpon
| | Comments (0)

Leave a comment

About this Entry

This page contains a single entry by Harry published on December 28, 2004 6:00 PM.

Uklug Cleanup was the previous entry in this blog.

Apache Error is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.01