【问题标题】:could not write to hash-join temporary file: No space left on device无法写入散列连接临时文件:设备上没有剩余空间
【发布时间】:2015-06-18 14:11:34
【问题描述】:

我正在执行 PostgreSQL 函数来更新具有大量数据的表,并且每天更新大约 100000 条记录。在更新期间,我收到一条错误消息:

"could not write to hash-join temporary file: No space left on device"

我还没有真正能够得到有用的东西来克服这个错误。我得到了一些东西,上面写着要设置一个临时表空间。但我无法找到如何创建一个临时表空间,在执行更新过程期间存储数据。

【问题讨论】:

  • 你的 PostgreSQL 数据所在的磁盘空间是否空间不足?
  • 不,磁盘有很多可用空间。

标签: performance postgresql space tablespace


【解决方案1】:

我遇到了同样的问题,但我正在使用 docker。

以防万一你也在使用 docker,请转到:

Docker Preferences > Disk Panel > Disk image size 并增加它。

它解决了我的问题。

【讨论】:

    【解决方案2】:
    1. SQL> create tablespace temp_tbs location '/some/big/disk';
    2. 在 postgresql.conf 中更改 temp_tablespaces = 'temp_tbs'
    3. select pg_reload_conf();
    4. 享受

    【讨论】:

    • SET temp_tablespaces = temp_tbs;也可以用
    • 我们如何知道正在执行的函数将使用这个特定的临时表空间?
    • @YousufSultan 它使用 temp_tablespaces 中提到的任何内容...因此,如果您在逗号内指定严重,它会按照您提供的顺序使用其中的任何内容。如果您只指定一个 - 它使用它,如果没有设置,它使用 pg_default
    • 我没有postgres配置权限,也无法创建临时表空间,还有其他方法吗?
    • no - 如果您没有使用大磁盘的权限,则无法使用它...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-07
    • 1970-01-01
    • 1970-01-01
    • 2018-11-12
    • 1970-01-01
    • 2017-09-07
    • 1970-01-01
    相关资源
    最近更新 更多