Take the 2-minute tour ×
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. It's 100% free, no registration required.
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.

share|improve this question

1 Answer 1

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.