英文:
Limit the visual column width display in PostgreSQL
问题
如何在PostgreSQL中在视觉上限制列的显示,同时仍允许该列存储值达到其最大长度?
我的意思不是截断它,因为那只是临时的。当你再次加载表时,它将显示列的值的最大字符数。
例如,列access_token的最大字符数可以是100。但我不希望每次运行查询的时候都将这100个字符全部可视化显示出来。我希望只能看到其中的10个字符。这就像缩写一个单词一样。
我记得以前做过这个,但我已经忘记了如何做。此外,我正在使用pgAdmin4版本7.4和PostgreSQL版本15.3。请参见下面的屏幕截图。
不想要的效果:
想要的效果:
英文:
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
What I want
答案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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论