mirror of https://github.com/dbcli/pgcli
fix psycopg.sql.Identifier in \ev handling (#1384)
This commit is contained in:
parent
d6ca4c3464
commit
2db54f14aa
|
@ -12,6 +12,7 @@ Features:
|
|||
Also prevents getting stuck in a retry loop.
|
||||
* Config option to not restart connection when cancelling a `destructive_warning` query. By default,
|
||||
it will now not restart.
|
||||
* Fix \ev not producing a correctly quoted "schema"."view"
|
||||
|
||||
3.5.0 (2022/09/15):
|
||||
===================
|
||||
|
|
|
@ -470,7 +470,7 @@ class PGExecute:
|
|||
return (
|
||||
psycopg.sql.SQL(template)
|
||||
.format(
|
||||
name=psycopg.sql.Identifier(f"{result.nspname}.{result.relname}"),
|
||||
name=psycopg.sql.Identifier(result.nspname, result.relname),
|
||||
stmt=psycopg.sql.SQL(result.viewdef),
|
||||
)
|
||||
.as_string(self.conn)
|
||||
|
|
|
@ -558,6 +558,7 @@ def test_view_definition(executor):
|
|||
run(executor, "create view vw1 AS SELECT * FROM tbl1")
|
||||
run(executor, "create materialized view mvw1 AS SELECT * FROM tbl1")
|
||||
result = executor.view_definition("vw1")
|
||||
assert 'VIEW "public"."vw1" AS' in result
|
||||
assert "FROM tbl1" in result
|
||||
# import pytest; pytest.set_trace()
|
||||
result = executor.view_definition("mvw1")
|
||||
|
|
Loading…
Reference in New Issue