Skip to content

Commit 1da5436

Browse files
committed
Fix completion crash when tables are created during refresh
1 parent 0797904 commit 1da5436

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Contributors:
148148
* Charalampos Stratakis
149149
* Laszlo Bimba (bimlas)
150150
* Anjanna
151+
* Shayan Golshani (shgol)
151152

152153
Creator:
153154
--------

changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Bug fixes:
2020
* Fix trailing SQL comments preventing query submission and execution.
2121
* ``SELECT 1; -- note`` now submits correctly in multiline mode
2222
* ``rstrip(";")`` in ``pgexecute.py`` now handles comments after the semicolon
23+
* Fix completion crash when tables are created during refresh.
2324

2425
4.4.0 (2025-12-24)
2526
==================

pgcli/pgcompleter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ def extend_columns(self, column_data, kind):
229229
has_default=has_default,
230230
default=default,
231231
)
232+
metadata.setdefault(schema, {})
233+
metadata[schema].setdefault(relname, OrderedDict())
232234
metadata[schema][relname][colname] = column
233235
self.all_completions.add(colname)
234236

0 commit comments

Comments
 (0)