| From: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
|---|---|
| To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
| Cc: | o15611(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: BUG #19473: regression error in dblink: another command is already in progress |
| Date: | 2026-05-12 13:59:03 |
| Message-ID: | CALdSSPgqY49dY==D=kUZ6Z3+TV+PFSOO5ZU103TpFL4UtL800w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Tue, 12 May 2026, 18:47 Fujii Masao, <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Sat, May 9, 2026 at 4:43 AM PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
> >
> > The following bug has been logged on the website:
> >
> > Bug reference: 19473
> > Logged by: Oleg Ivanov
> > Email address: o15611(at)gmail(dot)com
> > PostgreSQL version: 18.3
> > Operating system: Linux
> > Description:
> >
> > Testcase:
> > SELECT * FROM dblink('dbname=postgres user=postgres', $$ select 7; $$ )
> as
> > (col1 int);
> > SELECT * FROM dblink_connect('connection1', 'host=/var/run/postgresql
> > port=5432');
> > SELECT * FROM dblink_send_query('connection1', $$ select 8 from
> pg_sleep(1);
> > $$ );
> > SELECT dblink_is_busy('connection1');
> > SELECT * FROM dblink_get_result('connection1') as t(col1 int);
> > --- SELECT dblink_is_busy('connection1');
> > SELECT * FROM dblink_exec('connection1', $$ CHECKPOINT; $$);
> > SELECT * FROM dblink_disconnect('connection1');
> >
> > col1
> > ------
> > 7
> > (1 row)
> >
> > dblink_connect
> > ----------------
> > OK
> > (1 row)
> >
> > dblink_send_query
> > -------------------
> > 1
> > (1 row)
> >
> > dblink_is_busy
> > ----------------
> > 1
> > (1 row)
> >
> > col1
> > ------
> > 8
> > (1 row)
> >
> > ERROR: another command is already in progress
> > CONTEXT: while executing command on dblink connection named
> "connection1"
> > dblink_disconnect
> > -------------------
> > OK
> > (1 row)
> >
> > There was no error in 16 version. The error appeared in 17 version. It
> > seems, there is a regression bug.
> > The workaround is to uncomment a commented statement.
>
> The documentation for dblink_get_result() notes "It must be called once for
> each query sent, and one additional time to obtain an empty set result,
> before the connection can be used again". So in your case, it seems that
> dblink_get_result() needs to be called one more time before calling
> dblink_exec(). If you do that, I think that the error "another command is
> already in progress" should not occur. Therefore, this does not seem to be
> a bug to me. Thought?
>
> Regards,
>
> --
> Fujii Masao
>
Doesn't dblink_is_busy violates this doc then? I mean, dblink_is_busy has
side effect of changing connection state. Is this OK?
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PG Bug reporting form | 2026-05-12 14:23:39 | BUG #19476: Segmentation fault in contrib/spi |
| Previous Message | Fujii Masao | 2026-05-12 13:47:24 | Re: BUG #19473: regression error in dblink: another command is already in progress |