Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

\d schema.table crashes

Đang mở
#87 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
postgresql, python
Lĩnh vực
cli, databases

Hướng nghiên cứu

Tái hiện lỗi crash với %sql \d pg_catalog.pg_class thông qua ipython-sql trên PostgreSQL 11.5, sau đó kiểm tra kết quả pgspecial tại lệnh gọi sql/run.py được hiển thị trong trace. So sánh với đường dẫn đang hoạt động %sql \dn pg_catalog; được coi là hoàn tất khi lệnh bảng không còn gây ra AttributeError và trả về kết quả của nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I am using the latest version of pgspecial with postgresql 11.5 on Manjaro Linux.

I am using pgspecial from ipython-sql

Once I connect to my DB, I can run commands such as:

%sql \dn pg_catalog

and get proper output

But, if I try to run a command such as:

%sql \d pg_catalog.pg_class

it crashes with the following stack trace

`

AttributeError Traceback (most recent call last)
in
----> 1 get_ipython().run_line_magic('sql', '\d pg_catalog.pg_class')

/usr/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2312 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2313 with self.builtin_trap:
-> 2314 result = fn(*args, **kwargs)
2315 return result
2316

</usr/lib/python3.7/site-packages/decorator.py:decorator-gen-127> in execute(self, line, cell, local_ns)

/usr/lib/python3.7/site-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

</usr/lib/python3.7/site-packages/decorator.py:decorator-gen-126> in execute(self, line, cell, local_ns)

/usr/lib/python3.7/site-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

/usr/lib/python3.7/site-packages/sql/magic.py in execute(self, line, cell, local_ns)
93
94 try:
---> 95 result = sql.run.run(conn, parsed['sql'], self, user_ns)
96
97 if result is not None and not isinstance(result, str) and self.column_local_vars:

/usr/lib/python3.7/site-packages/sql/run.py in run(conn, sql, config, user_namespace)
335 _, cur, headers, _ = pgspecial.execute(
336 conn.session.connection.cursor(), statement)[0]
--> 337 result = FakeResultProxy(cur, headers)
338 else:
339 txt = sqlalchemy.sql.text(statement)

/usr/lib/python3.7/site-packages/sql/run.py in init(self, cursor, headers)
298
299 def init(self, cursor, headers):
--> 300 self.fetchall = cursor.fetchall
301 self.fetchmany = cursor.fetchmany
302 self.rowcount = cursor.rowcount

AttributeError: 'list' object has no attribute 'fetchall'
`

It doesn't matter what table I use.

Ngôn ngữ chính
Python
Star
86
Fork
54
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dbcli/pgspecial

Tất cả issue của dbcli/pgspecial

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.