[Catalyst] PostgreSQL connect error

张淼 yourselfzm at gmail.com
Wed Jun 6 03:00:09 GMT 2007

#MyAPP name is "NIC",

package NIC::Model::NiscDB;
use strict;
use base 'Catalyst::Model::DBIC::Schema';
    schema_class =3D> 'NiscDB',
    connect_info =3D> [


package NiscDB;
use base qw/DBIx::Class::Schema/;
    NiscDB =3D> [qw/UserInfo/]


package NiscDB::UserInfo;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/PK::Auto Core/);
__PACKAGE__->add_columns(qw/serial_no dept_no user_no user_name user_addr
ip_addr mac_addr link_switch node_no phone email memo/);

#And in my Controller Macs,the function is below
sub find : Local {
    my ( $self, $c, $mac ) =3D @_;
    $c->res->redirect( $c->uri_for('/') ) unless ( $mac );
    (my $user) =3D $c->model('NiscDB::UserInfo')->search({mac_addr =3D> $ma=
    $c->stash->{user} =3D $user;
    $c->stash->{template} =3D 'macs/find.tt2';

#But When I locate http://catalyst/nic/macs/find/00:19:21:4b:05:24, There is
an error:

Caught exception in NIC::Controller::Macs->find
"DBIx::Class::ResultSet::search(): DBI Connection failed: could not
connect to server: Permission denied
	Is the server running on host "210.42.1**.***" and accepting
	TCP/IP connections on port 5432?"

#How can I deal with it? Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070606/305fe=

More information about the Catalyst mailing list