Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquibase does not honor deferrable and initially deferred on Primary Key #1597

Closed
siudeks opened this issue Dec 18, 2020 · 1 comment · Fixed by #1993
Closed

Liquibase does not honor deferrable and initially deferred on Primary Key #1597

siudeks opened this issue Dec 18, 2020 · 1 comment · Fixed by #1993

Comments

@siudeks
Copy link

siudeks commented Dec 18, 2020

Environment

Liquibase Version: org.liquibase:liquibase-core:jar:3.8.9

Liquibase Integration & Version: maven

Database Vendor & Version: postgres 11

Operating System Type & Version: ubuntu (wsl)

Description

PrimaryKey constraint does not honor 'deferrable' and 'initiallyDeferred' settings so that created primary key is not 'deferred'

Steps To Reproduce

Use script:

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
                   xmlns:pro="http://www.liquibase.org/xml/ns/pro"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.0.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd">
    <changeSet author="author" id="some-id">  
        <createTable tableName="abc">
            <column name="id" type="INTEGER">
                <constraints nullable="false" primaryKey="true" primaryKeyName="abc_PK" deferrable="true" initiallyDeferred="true"/>
            </column>
        </createTable>
    </changeSet>
</databaseChangeLog>

Actual Behavior

2020-12-18 09:01:19.936 [main] INFO liquibase.executor.jvm.JdbcExecutor - CREATE TABLE public.abc (id INTEGER NOT NULL, CONSTRAINT "abc_PK" PRIMARY KEY (id))

Expected/Desired Behavior

PRIMARY KEY is created with deferrable initially deferred

@siudeks siudeks changed the title 'deferred' Liquibase does not honor deferred and initially deferred on Primary Key Dec 18, 2020
@sync-by-unito sync-by-unito bot changed the title Liquibase does not honor deferred and initially deferred on Primary Key 'deferred' Dec 18, 2020
@siudeks siudeks changed the title 'deferred' Liquibase does not honor deferred and initially deferred on Primary Key Dec 18, 2020
@siudeks siudeks changed the title Liquibase does not honor deferred and initially deferred on Primary Key Liquibase does not honor defd and initially deferred on Primary Key Dec 18, 2020
@siudeks siudeks changed the title Liquibase does not honor defd and initially deferred on Primary Key Liquibase does not honor deferrable and initially deferred on Primary Key Dec 18, 2020
@molivasdat
Copy link
Contributor

Hi @siudeks Thanks for opening this issue. We will add this to our list of issues to process. And if I am reading the documentation correctly, https://www.postgresql.org/docs/9.0/sql-createtable.html, you cannot have both not null and deferrable in the same statement. This would mean that nullable=false and deferrable=true is invalid.

@molivasdat molivasdat added the BNoUpgradePath Cannot upgrade to next version label Jul 7, 2021
@molivasdat molivasdat added this to To Do in Conditioning++ via automation Jul 7, 2021
@molivasdat molivasdat added the BKeyPlatform Key Platform label Jul 7, 2021
@nvoxland nvoxland moved this from To Do to Code Review in Conditioning++ Jul 19, 2021
@suryaaki2 suryaaki2 moved this from Code Review to Ready for Handoff (In JIRA) in Conditioning++ Jul 27, 2021
Conditioning++ automation moved this from Ready for Handoff (In JIRA) to Done Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants