在将Oracle触发器转换为PostgreSQL时需要帮助

时间:2019-06-09 13:54:43

标签: oracle postgresql postgresql-9.1 database-trigger

在将以下查询转换为postgres时,我需要帮助。任何帮助将不胜感激

<header>
    <a class="d-flex justify-content-center" href="/">
        <img src="/images/logo-ideastudio.png" height="50" class="d-inline-block align-top m-1" alt="">
    </a>
    <nav class="navbar navbar-expand-lg navbar-light bg-transparent">
        <div class="container">
            <button class="navbar-toggler" type="button" data-toggle="collapse"
                    data-target="#navbarSupportedContent"
                    aria-controls="navbarSupportedContent"
                    aria-expanded="false"
                    aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <div class="navbar-nav">
                    <a class="nav-item nav-link" href="/">Accueil</a>
                    <a class="nav-item nav-link" href="/go/olymp">Olymp</a>
                    <a class="nav-item nav-link" href="/go/team">&Eacute;quipe</a>
                    <a class="nav-item nav-link" href="/go/expertises">Expertises</a>
                    <a class="nav-item nav-link" href="/go/trainings">Formations</a>
                    <a class="nav-item nav-link" href="/go/projects">Clients</a>
                    <a class="nav-item nav-link" href="/go/press">Presse</a>
                    <a class="nav-item nav-link" href="/go/about">About</a>
                </div>
            </div>
        </div>
    </nav>
</header>

2 个答案:

答案 0 :(得分:2)

如果要在Postgres中使用所需的序列,可以这样做。

create sequence REQUESTOR_SEQ;
create table REQUESTOR ( id int DEFAULT NEXTVAL('requestor_seq') )

否则,serial列就足够了。

答案 1 :(得分:1)

在Postgres中,您无需为此使用序列。只需使用serial列并省去触发器:

create table requestor (
    id serial primary key,
    . . .
);