Movatterモバイル変換


[0]ホーム

URL:


Quick Links

Bug fix for psql's meta-command \ev

From:Ryoga Yoshida <bt23yoshidar(at)oss(dot)nttdata(dot)com>
To:pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject:Bug fix for psql's meta-command \ev
Date:2023-09-15 02:37:46
Message-ID:01419622d84ef093fd4fe585520bf03c@oss.nttdata.com
Views:Whole Thread |Raw Message |Download mbox |Resend email
Thread:
Lists:pgsql-hackers

Hi,

When a table name is specified as the first argument of \ev
meta-command, it reports the error message, the prompt string becomes
"-#" and then the following valid query fails because the psql's query
buffer contains the garbage string generated by failure of \ev. Please
see the following example.
=# \ev t
"public.t" is not a view

-# SELECT * FROM t;
ERROR: syntax error at or near "public" at character 1
STATEMENT: public.t AS

SELECT * FROM t;
I think this is a bug in psql's \ev meta-command. Even when \ev fails,
it should not leave the garbage string in psql's query buffer and the
following query should be completed successfully.
This problem can be resolved by resetting the query buffer on error. You
can see the attached source code. After that, it will result in output
like the following:
=# \ev t
"public.t" is not a view
=# SELECT * FROM t;
i
---
1
2
(2 rows)

Ryoga Yoshida

AttachmentContent-TypeSize
bug_fix_for_ev_command.patchtext/x-diff354 bytes

Responses

Browse pgsql-hackers by date

 FromDateSubject
Next MessageKyotaro Horiguchi2023-09-15 02:39:01Re: bug fix and documentation improvement about vacuumdb
Previous MessageAndy Fan2023-09-15 01:53:20Re: Extract numeric filed in JSONB more effectively

[8]ページ先頭

©2009-2026 Movatter.jp