Re: \i and \watch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Edwin UY <edwin(dot)uy(at)gmail(dot)com>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: \i and \watch
Date: 2024-11-07 13:43:02
Message-ID: 3414975.1730986982@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> Watch is documented to act on either a non-empty query buffer or the last
> sent command. I would expect that whatever the final SQL command present
> in x.sql is would be the command that gets watched. If indeed the
> preceding select 1 command is watched there would seem to be an
> undocumented interaction going on.

It looks like there's a separate query_buf for each recursive level
of MainLoop(), that is, each level of \i. So maybe the docs need
improvement here. (I think the actual behavior is probably fine.)

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Norbert Poellmann 2024-11-07 13:55:30 GRANT and predefined role
Previous Message Wasim Devale 2024-11-07 09:16:26 ON CONFLICT Clause used on partition tables