我有这个表,我使用 pgLoader 从 MySQL 迁移而来
CREATE TABLE IF NOT EXISTS schema.example
(
"ExampleID" integer NOT NULL,
"Name" character varying(255) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "idx_43997_PRIMARY" PRIMARY KEY ("ExampleID"),
)
Run Code Online (Sandbox Code Playgroud)
我正在尝试将 ExampleID 转换为序列号,以便它将使用以下方法自动递增: 将主键 int 类型更改为序列号
所以我正在做
CREATE SEQUENCE example_id_seq MINVALUE 3
Run Code Online (Sandbox Code Playgroud)
效果很好,但是然后
ALTER TABLE example ALTER "ExampleID" SET DEFAULT nextval('example_id_seq')
Run Code Online (Sandbox Code Playgroud)
给出错误:
ERROR: cannot use column reference in DEFAULT expression
SQL state: 0A000
Run Code Online (Sandbox Code Playgroud)
但是如果我删除“”并像这样输入ExampleID:
ALTER TABLE example ALTER ExampleID SET DEFAULT nextval('example_id_seq')
Run Code Online (Sandbox Code Playgroud)
我会得到错误
ERROR: column "exampleid" of relation "example" does not …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 is nextjs 应用程序获取“版本” package.json。
我已经尝试过process.env.npm_package_version像节点应用程序一样,但它正在返回undefined。
我正在尝试迁移到 S3,现在我通过 URL 向其他主机提供图像,我可以下载它,在使用时更改它的大小(以节省大小并更快地提供它们),然后将其上传到 S3在我的机器上保存副本吗?
javascript ×2
amazon-s3 ×1
next.js ×1
node-fetch ×1
node.js ×1
postgresql ×1
reactjs ×1
sharp ×1
typescript ×1