public class PostgresUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PGCRYPTO |
static Double |
PGCRYPTO_VERSION |
static Double |
POSTGRES_VERSION |
| Constructor and Description |
|---|
PostgresUtils() |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
checkCleanPermissions(Connection connection)
Check if the current user has permissions to run a clean on existing
database.
|
protected static Double |
getPgcryptoAvailableVersion(Connection connection)
Get version of pgcrypto extension available.
|
protected static Double |
getPgcryptoInstalledVersion(Connection connection)
Get version of pgcrypto extension installed in the DSpace database.
|
static boolean |
isPgcryptoInSchema(String schema)
Check if the pgcrypto extension is installed into a particular schema
|
static boolean |
isPgcryptoUpToDate()
Check if the pgcrypto extension is BOTH installed AND up-to-date.
|
public static final String PGCRYPTO
public static final Double PGCRYPTO_VERSION
public static final Double POSTGRES_VERSION
protected static Double getPgcryptoAvailableVersion(Connection connection)
The pgcrypto extension is required for Postgres databases
connection - database connectionprotected static Double getPgcryptoInstalledVersion(Connection connection)
The pgcrypto extension is required for Postgres databases to support UUIDs.
connection - database connectionpublic static boolean isPgcryptoUpToDate()
This requirement is only needed for PostgreSQL databases. It doesn't matter what schema pgcrypto is installed in, as long as it exists.
public static boolean isPgcryptoInSchema(String schema)
This allows us to check if pgcrypto needs to be REMOVED prior to running a 'clean' on this database. If pgcrypto is in the same schema as the dspace database, a 'clean' will require removing pgcrypto FIRST.
schema - name of schemaprotected static boolean checkCleanPermissions(Connection connection)
Mostly this just checks if you need to remove pgcrypto, and if so, whether you have permissions to do so.
connection - database connectionCopyright © 2016 DuraSpace. All rights reserved.