2
와
펄을 사용하고, 나는 내가 촉매를 생성하려고 Catalyst documentation about PostgreSQL 다음, 이제 이 코드 펄 DBI 연결 작동하지만 촉매
#!/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";
를 사용하여 로컬 PostgreSQL의 9.3 서버에 연결할 수 있어요 모델.
나는이 쉘 명령을 사용
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 }'
하지만 다음과 같은 오류가 발생합니다 :
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
오, 당신 말이 맞아요. 명령이 제대로 작동합니다. 이것은 내 안경을 바꾸어야한다는 것을 의미합니다. 내 나이에 ... –