postgresql - PostgreSQL:选择没有页眉/页脚行的语句
问题描述
select distinct table_schema from information_schema.tables;
提供类似的东西
table_schema
--------------------
mySchema
pg_catalog
information_schema
anotherSchem
(4 rows)
如何修改命令,以免看到前两个(table_schema 和 ---),也看不到最后一行(... rows)?
我在 bash 脚本中使用 psql 命令。我怎样才能在\pset tuples ...
那里添加?
解决方案
psql
您可以使用meta命令 \pset tuples_only
将其关闭:
postgres=> select distinct table_schema from information_schema.tables;
table_schema
--------------------
public
pg_catalog
information_schema
(3 rows)
postgres=>postgres=> \pset tuples_only
Tuples only is on.
postgres=> select distinct table_schema from information_schema.tables;
public
pg_catalog
information_schema
您可以在启动时psql
使用命令行参数打开它--tuples-only
:
psql --tuples-only -U micha -d some_db
推荐阅读
- javascript - jSignature 没有从 display:none 移动到 display:block 以多页形式正确
- r - 如何在闪亮应用的导航栏中获取 actionLink?
- php - 使用 PHP 的 include 语句时遇到问题
- javascript - 在 Chrome 扩展程序中使用 Workbox
- python - 如何解析和保存 Multipart/related type=image/jpeg 响应?(Dicom Wado 回应)
- visual-studio - 按行号获取文本
- java - 已由更新版本的 Java Runtime(类文件版本 57.0)编译
- google-cloud-platform - 选择您希望执行 Google 任务处理程序的服务
- html - 如何从此消息框/警报中删除按钮自动对焦?
- php - VSCode 调试器跳过断点