'postgres', '', { AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, PrintWarn => 0, RaiseError => 1 } ); my $sth = $dbh->prepare('select 1', {pg_async => PG_ASYNC}); $sth->execute; open my $handle, '<&', $dbh->{pg_socket} or die "Can't dup: $!"; Mojo::IOLoop->singleton->reactor->io( $handle => sub { return unless $dbh->pg_ready; my $result = $sth->pg_result; my $data = $sth->fetchall_arrayref; ... Mojo::IOLoop->stop; } ); Mojo::IOLoop->start;