小编Ole*_*leg的帖子

PostgreSQL ALTER SEQUENCE功能

我有触发功能:

CREATE OR REPLACE FUNCTION update_aaa() RETURNS TRIGGER AS $$
DECLARE maxid INTEGER;
BEGIN
    SELECT MAX(id) INTO maxid FROM aaa;
    ALTER SEQUENCE aaa_id_seq RESTART WITH maxid;
END;
$$ LANGUAGE plpgsql;
Run Code Online (Sandbox Code Playgroud)

并有错误:

ERROR:  syntax error at or near "$1"
Line 1: ALTER SEQUENCE aaa_id_seq RESTART WITH  $1 
Run Code Online (Sandbox Code Playgroud)

为什么1美元?
什么错误?

postgresql sequence

2
推荐指数
1
解决办法
2368
查看次数

如何编写 .gitlab-ci.yml 作业以仅在合并请求中运行

仅在合并请求中运行时如何在 .gitlab-ci.yml 中正确写入作业?

test_c:
  stage: test
  script:
    - echo "This job tests something. It will only run when all jobs in the"
    - echo "build stage are complete."
  only:
    - merge_requests
Run Code Online (Sandbox Code Playgroud)

此作业不在合并请求中运行,但不在 master 或 develop 中运行和提交。

continuous-integration gitlab gitlab-ci

1
推荐指数
3
解决办法
2784
查看次数