我有一个现有列类型的表varchar
。我需要将此列类型转换为新类型jsonb
。问题是,如果列已经有数据'str1:str2'
,那么在将类型转换为jsonb
列之后,JSON 字符串无效'str1:str2'
。
我想像以前一样/在转换列类型时将现有字符串迁移'str1:str2'
到带有键的正确 JSON 字符串。是否可以使用子句或其他方式
来做到这一点。'{"key1":"str1","key2":"str2"}'
ALTER TABLE ALTER COLUMN....Using function()
主页
/
user-177270
Neeraj Bansal's questions
Neeraj Bansal
Asked:
2019-07-12 23:33:35 +0800 CST
我看到许多 pg_log 文件充满了以下错误
2019-07-08 00:04:06 CEST DETAIL: The failed archive command was: copy "pg_xlog\000000010000002100000025" "D:/Programme/OmniBack/server/db80/pg/pg_xlog_archive/000000010000002100000025"
2019-07-08 00:04:07 CEST LOG: archive command failed with exit code 1
2019-07-08 00:04:07 CEST DETAIL: The failed archive command was: copy "pg_xlog\000000010000002100000025" "D:/Programme/OmniBack/server/db80/pg/pg_xlog_archive/000000010000002100000025"
2019-07-08 00:04:07 CEST WARNING: transaction log file "000000010000002100000025" could not be archived: too many failures
2019-07-08 00:05:07 CEST LOG: archive command failed with exit code 1**
postgres.conf 有设置
checkpoint_segments = 256
wal_buffers = 256MB
wal_level = archive
archive_mode = on
port = 7112
work_mem = 128MB
shared_buffers = 512MB
effective_cache_size = 32719MB
listen_addresses = '*'
logging_collector = on
log_line_prefix = '%t '
archive_command = 'copy "%p" "D:/Programme/OmniBack/server/db80/pg/pg_xlog_archive/%f"'**
我已经检查pg_xlog
了这个文件的文件夹。此文件不存在,pg_xlog
但pg_xlog\archive_status
具有以下权限
pg/pg_xlog\archive_status\000000010000002100000025.ready
KDLF\adminkdlf:(I)(F)
VORDEFINIERT\Administratoren:(I)(F)
NT-AUTORITŽT\SYSTEM:(I)(F)
VORDEFINIERT\Benutzer:(I)(RX)
我的磁盘快满了。请说明为什么会出现此问题,因为其他日志仍未存档。我不确定我是否在这里遗漏了什么。