Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
psql -1f ccushing postgres
SET ERROR:  Can't locate Email/ in @INC (@INC contains: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at line 3.
BEGIN failed--compilation aborted at line 3.
CONTEXT:  compilation of PL/Perl function "check_email"

My current @INC is


obviously my problem is that Email::Valid is not in my @INC, can I globally change Postgres @INC Paths? also related is postgres only capable of using the Perl it's built against? or can I make it use my perlbrew.

share|improve this question
up vote 1 down vote accepted

Can't you just push it into @INC before you use it? At the first line in your func? I'm pretty sure that should work.

PostgreSQL will only use the perl it's built against. You'd have to rebuild it (or at least plperl) against your custom perl.

share|improve this answer
well part of the problem was that postgres didn't have read access to that directory. I ended up giving a local::lib to postgres – xenoterracide Jan 4 '12 at 0:10
@xenoterracide How did you give postgres a "local::lib"? -- If the related env vars are in my .bashrc, will that be adequate enough for the postgres install to see them? – Robbie Dec 13 '12 at 20:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.