Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

\d schema.table crashes

未关闭
#87 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
postgresql, python
领域
cli, databases

调研方向

通过 ipython-sql 针对 PostgreSQL 11.5 使用 %sql \d pg_catalog.pg_class 重现崩溃,然后检查 trace 中所示的 sql/run.py 调用处的 pgspecial 结果。将其与正常工作的 %sql \dn pg_catalog 路径进行比较;完成的标准是表命令不再引发 AttributeError 并返回其结果。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
86
派生
54
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dbcli/pgspecial 的其他 Issue

查看 dbcli/pgspecial 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。