使用以下查询时,我无法从 bnrcno 列获取数据。
select 'insert into table values('||id||','||bnrcno||','||chargetype||','||domno||','||coa_id||','||liability_gl||','||revenue_gl||','||taxno||')'
from bill_charges_map where domno=5
该brcno
列为整数类型,其中大部分值为空。
使用以下查询时,我无法从 bnrcno 列获取数据。
select 'insert into table values('||id||','||bnrcno||','||chargetype||','||domno||','||coa_id||','||liability_gl||','||revenue_gl||','||taxno||')'
from bill_charges_map where domno=5
该brcno
列为整数类型,其中大部分值为空。
我的任务是更新数据库中的几行。有两列,一列是,一列ID
是CURRENCY
。我已使用以下更新语句更新了这些行:
update account set currency = 'INR' where id =15;
update account set currency = 'EURO' where id =12;
update account set currency = 'DOLLAR' where id =18;
update account set currency = 'Pound' where id =13;
-- and so on.
实际上,在这种情况下,由于行数相对较少,我可以使用这些更新语句轻松完成此操作,但是如果有数千或数十万行怎么办?这是更新它们的唯一方法,还是有任何替代方法或脚本?
我收到以下错误:
pg_restore: [archiver (db)] Error while INITIALIZING:
pg_restore: [archiver (db)] could not execute query: ERROR: unrecognized configuration parameter "idle_in_transaction_session_timeout"
命令是:SET idle_in_transaction_session_timeout = 0;
当我尝试使用恢复数据时
pg_restore -h 172.16.0.70 -U postgres -d newdb05aug19 -1 dirfrmt;
postgres 版本是 PostgreSQL 9.3.23
pg_dump 版本是 pg_dump (PostgreSQL) 9.3.23
pg_restore 版本是 pg_restore (PostgreSQL) 9.3.23