【发布时间】:2021-04-19 04:48:56
【问题描述】:
如何在字符中保留空格? 我创建了 2 个表,
create table test_1 (a int, b char(10)) ;
create table test_2 (a int, b varchar(255));
并在 test_1 中插入一行
insert into test_1 values (1 ,' ');
insert into test_2 select * from test_1;
select a, length(b) from test_2;
然后它返回
| a | length(b) |
| -------- | -------------- |
| 1 | 0 |
我预计会像 oracle 一样崩溃
| a | length(b) |
| -------- | -------------- |
| 1 | 10 |
有什么办法可以试试吗?
【问题讨论】:
标签: postgresql spaces trailing-whitespace