I am using Perl, and I am able to connect to a local PostgreSQL 9.3 server using this code
#!/usr/bin/perl
use DBI;
use strict;
my $dbh = DBI->connect("dbi:Pg:dbname=postgres;host=127.0.0.1;port=5432", "postgres", "postgres", { RaiseError => 1 }) or die $DBI::errstr;
$dbh->disconnect();
print "Done\n";
Now, following the Catalyst documentation about PostgreSQL I try to generate a Catalyst model.
I use this shell command
script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
create=static components=TimeStamp,EncodedColumn \
'dbi:Pg:dbname=postgres,host=127.0.0.1,port=5432' 'postgres' 'postgres' '{ AutoCommit => 1 }'
But I get the following error:
DBIx::Class::Storage::DBI::catch {...} ():
DBI Connection failed:
DBI connect('dbname=postgres,host=127.0.0.1,port=5432','postgres',...) failed:
FATAL: database "postgres,host=127.0.0.1,port=5432" does not exist at
/usr/local/share/perl/5.18.2/DBIx/Class/Storage/DBI.pm line 1487. at
/usr/local/share/perl/5.18.2/Catalyst/Helper/Model/DBIC/Schema.pm line 637