Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PostgreSQL: clean doesn't unlink referenced LOBs in pg_largeobject #1934

@zinnchen

Description

@zinnchen
Which version and edition of Flyway are you using?

5.0.2

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Don't know. I can't use 5.0.7 because there is another issue where some classes can't be found.

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Java API

Which database are you using (type & version)?

Postgres 9.6

Which operating system are you using?

Windows

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
I have two schemas in postgres database. First the default one 'postgres' and separate schema for application tables ('app_schema'). I store blobs in my application schema which are stored as large object. These large objects are stored in table 'pg_largeobject' in catalog 'pg_catalog'.

I run the following Java code test preparation:
// prepare database
Schema schema;
try (Database database = DatabaseFactory.createDatabase(migrator, false)) {
schema = database.getMainConnection().getSchema("app_schema");
if (schema.exists()) {
schema.clean();
} else {
schema.create();
}
}

What did you expect to see?

I expect that schema.clean() does clean the 'app_schema' AND the referenced entries in 'pg_catalog' catalog.
In my case I expect that the entries in 'pg_largeobject' which are referenced by entries in 'app_schema' will be deleted.

What did you see instead?

I see remaining entries in catalog 'pg_catalog'.'pg_largeobject' which not referenced anymore.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions