Re: BUG #15459: no connection to the server

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: jay(dot)medivh(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15459: no connection to the server
Date: 2018-10-26 14:08:00
Message-ID: CAMkU=1xLOjz=aM_YSANNhyzU2B04PrKzp0Z0dcUJe=8AHavhEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Oct 26, 2018 at 1:34 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 15459
> Logged by: medivhJay
> Email address: jay(dot)medivh(at)gmail(dot)com
> PostgreSQL version: 9.6.8
> Operating system: debian
> Description:
>
> Hello
>
> I used php7.1 + PDO connect to postgresql
>
> when I use fork , like this
>
> <?php
> $pid = pcntl_fork();
> if ( $pid === 1 ) {
> TaskManager::log('error');
> } elseif ( $pid ) {
> pcntl_wait($status);
> } else {
> try {
> call_user_func_array($func, $argv);
> } catch ( \Exception $e ) {
> TaskManager::log($e);
> }
> exit(0);
> }
>
>
> PDO throw an exception
>

You shouldn't have a database handle open over a fork call. Open it after
the fork. I have no idea how to do that, since it seems to be happening
implicitly, or at least in part of your code not shown. You might want to
ask in a forum specific to php PDO. Also, shouldn't you be testing $pid
against -1, not +1?

Cheers,

Jeff

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry Molotkov 2018-10-26 23:13:06 Re: BUG #15446: Crash on ALTER TABLE
Previous Message hubert depesz lubaczewski 2018-10-26 11:34:26 Re: BUG #15462: WITH ORDINALITY and CTEs don't work