首页 > 解决方案 > Sails.js 蓝图查询与排序引发错误,因为 PostgreSQL 的“无法创建临时目录”

问题描述

在尝试排序时遇到 Sails.js 蓝图上的查询/查找问题。

我们正在尝试将数据库从 DigitalOcean 迁移到 Azure,并且该问题仅发生在 Azure 端数据查询上。

应用了所需的 SQL 安装脚本,其中包含创建表、默认值、PK、FK、序列等。从 DigitalOcean 备份并在 Azure 上恢复完全没问题,没有错误。此外,尝试了Sails > config > model'migrate选项 from safeto alterORdrop让 ORM 创建所需的数据库模式,但错误仍然存​​在。

我检查了数据库安装脚本和 Sails 模型,以确保所有配置正确匹配,对于 NOT NULL 表示法等。还对不正确的数据应用了数据清理过程。

样品请求;

Request: {{LOCAL}}/foo?skip=0&where={"some_id":"-1","createdAt":{"!=":null}}&limit=30&sort=createdAt DESC

错误是;

Response: AdapterError: Unexpected error from database adapter: cannot create temporary directory
"pg_tblspc/16386/PG_13_202007201/pgsql_tmp": No such file or directory
at Object.findRecords
at routeTargetFnWrapper
at Layer.handle [as handle_request]
at Route.dispatch
at Layer.handle [as handle_request]
at Function.process_params
at process._tickCallback (internal/process/next_tick.js:68:7)

技术栈:

标签: postgresqlazuresails.jsdigital-ocean

解决方案


推荐阅读