在PostgreSQL中限制可视列宽度显示

huangapple go评论97阅读模式
英文:

Limit the visual column width display in PostgreSQL

问题

如何在PostgreSQL中在视觉上限制列的显示,同时仍允许该列存储值达到其最大长度?

我的意思不是截断它,因为那只是临时的。当你再次加载表时,它将显示列的值的最大字符数。

例如,列access_token的最大字符数可以是100。但我不希望每次运行查询的时候都将这100个字符全部可视化显示出来。我希望只能看到其中的10个字符。这就像缩写一个单词一样。

我记得以前做过这个,但我已经忘记了如何做。此外,我正在使用pgAdmin4版本7.4和PostgreSQL版本15.3。请参见下面的屏幕截图。

不想要的效果:

在PostgreSQL中限制可视列宽度显示

想要的效果:

在PostgreSQL中限制可视列宽度显示

英文:

How to visually limit the display of a column while still allowing the column to store values up to its maximum length in postgresql?

I do not mean truncating it as that is only temporary. When you load the table again, it will show the column's value maximum number of characters.

Eg. Column access_token can have a maximum characters of 100. But I do not want all those 100 characters to be visually displayed every time I run a query on the table that has that column. I want to make it so that I can see only 10 character out of that 100. It is like abbreviating a word.

I remember doing this before but I had forgotten how to. Also , I am using pgAdmin4 version 7.4 and PostgreSQL version 15.3. See screenshots below

What I Don't Want

在PostgreSQL中限制可视列宽度显示

What I want

在PostgreSQL中限制可视列宽度显示

答案1

得分: 2

请查看“首选项 > 查询工具 > 结果网格”。在那里,您可以设置“最大列宽”。它不提供指定限制哪一列的选项,但可能能满足您的需求。

英文:

Check out Preferences > Query Tool > Results Grid. There, you can set Maximum Column Width. It doesn't give an option to specify which column to limit, but will likely serve your purpose.

huangapple
  • 本文由 发表于 2023年8月10日 12:36:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76872681.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定