Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't call method "prepare" on an undefined value at ./pg_table_recovery.pl line 118. #4

Open
th0mcat opened this issue Feb 12, 2024 · 1 comment

Comments

@th0mcat
Copy link

th0mcat commented Feb 12, 2024

When running the script, I get the error Can't call method "prepare" on an undefined value at ./pg_table_recovery.pl line 118.. I have pulled the script down and filled in the variables several times, still nothing.

OS: Ubuntu 22.04
DB container: postgres:12.1-alpine
Perl version: v5.34.0 built for x86_64-linux-gnu-thread-multi

$dbname = "<db>"; 
$username = "<user>";
$password = "<pw>";
$dbhost = "<docker_container_ip>";
$dbport = "5432";
$dboptions = "-e";
$dbtty = "ansi";

$table = "<table>";
$tableid = "id";
$write = 0;
$verbose = 1; 
@xyhtac
Copy link
Owner

xyhtac commented Mar 3, 2024

Hi, do you have any issues with linking Perl:DBI or creating the object:

$dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$dbhost;port=$dbport;options=$dboptions;tty=$dbtty","$username","$password",
            {PrintError => 0});

also make sure that you have installed Perl:DBI before launching the script:

> sudo apt-get install libdbi-perl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants