psql -1f check_email.pl.sql ccushing postgres
psql:check_email.pl.sql:7: ERROR:  Can't locate Email/Valid.pm 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.

1 Answer 1


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.

  • 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 Commented Jan 4, 2012 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
    Commented Dec 13, 2012 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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