Class PgDatabaseMetaData
- java.lang.Object
-
- org.postgresql.jdbc.PgDatabaseMetaData
-
- All Implemented Interfaces:
DatabaseMetaData,Wrapper
public class PgDatabaseMetaData extends Object implements DatabaseMetaData
-
-
Field Summary
Fields Modifier and Type Field Description protected PgConnectionconnection-
Fields inherited from interface java.sql.DatabaseMetaData
attributeNoNulls, attributeNullable, attributeNullableUnknown, bestRowNotPseudo, bestRowPseudo, bestRowSession, bestRowTemporary, bestRowTransaction, bestRowUnknown, columnNoNulls, columnNullable, columnNullableUnknown, functionColumnIn, functionColumnInOut, functionColumnOut, functionColumnResult, functionColumnUnknown, functionNoNulls, functionNoTable, functionNullable, functionNullableUnknown, functionResultUnknown, functionReturn, functionReturnsTable, importedKeyCascade, importedKeyInitiallyDeferred, importedKeyInitiallyImmediate, importedKeyNoAction, importedKeyNotDeferrable, importedKeyRestrict, importedKeySetDefault, importedKeySetNull, procedureColumnIn, procedureColumnInOut, procedureColumnOut, procedureColumnResult, procedureColumnReturn, procedureColumnUnknown, procedureNoNulls, procedureNoResult, procedureNullable, procedureNullableUnknown, procedureResultUnknown, procedureReturnsResult, sqlStateSQL, sqlStateSQL99, sqlStateXOpen, tableIndexClustered, tableIndexHashed, tableIndexOther, tableIndexStatistic, typeNoNulls, typeNullable, typeNullableUnknown, typePredBasic, typePredChar, typePredNone, typeSearchable, versionColumnNotPseudo, versionColumnPseudo, versionColumnUnknown
-
-
Constructor Summary
Constructors Constructor Description PgDatabaseMetaData(PgConnection conn)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.DatabaseMetaData
supportsSharding
-
-
-
-
Field Detail
-
connection
protected final PgConnection connection
-
-
Constructor Detail
-
PgDatabaseMetaData
public PgDatabaseMetaData(PgConnection conn)
-
-
Method Detail
-
getMaxIndexKeys
protected int getMaxIndexKeys() throws SQLException- Throws:
SQLException
-
getMaxNameLength
protected int getMaxNameLength() throws SQLException- Throws:
SQLException
-
allProceduresAreCallable
public boolean allProceduresAreCallable() throws SQLException- Specified by:
allProceduresAreCallablein interfaceDatabaseMetaData- Throws:
SQLException
-
allTablesAreSelectable
public boolean allTablesAreSelectable() throws SQLException- Specified by:
allTablesAreSelectablein interfaceDatabaseMetaData- Throws:
SQLException
-
getURL
public String getURL() throws SQLException
- Specified by:
getURLin interfaceDatabaseMetaData- Throws:
SQLException
-
getUserName
public String getUserName() throws SQLException
- Specified by:
getUserNamein interfaceDatabaseMetaData- Throws:
SQLException
-
isReadOnly
public boolean isReadOnly() throws SQLException- Specified by:
isReadOnlyin interfaceDatabaseMetaData- Throws:
SQLException
-
nullsAreSortedHigh
public boolean nullsAreSortedHigh() throws SQLException- Specified by:
nullsAreSortedHighin interfaceDatabaseMetaData- Throws:
SQLException
-
nullsAreSortedLow
public boolean nullsAreSortedLow() throws SQLException- Specified by:
nullsAreSortedLowin interfaceDatabaseMetaData- Throws:
SQLException
-
nullsAreSortedAtStart
public boolean nullsAreSortedAtStart() throws SQLException- Specified by:
nullsAreSortedAtStartin interfaceDatabaseMetaData- Throws:
SQLException
-
nullsAreSortedAtEnd
public boolean nullsAreSortedAtEnd() throws SQLException- Specified by:
nullsAreSortedAtEndin interfaceDatabaseMetaData- Throws:
SQLException
-
getDatabaseProductName
public String getDatabaseProductName() throws SQLException
Retrieves the name of this database product. We hope that it is PostgreSQL, so we return that explicitly.- Specified by:
getDatabaseProductNamein interfaceDatabaseMetaData- Returns:
- "PostgreSQL"
- Throws:
SQLException
-
getDatabaseProductVersion
public String getDatabaseProductVersion() throws SQLException
- Specified by:
getDatabaseProductVersionin interfaceDatabaseMetaData- Throws:
SQLException
-
getDriverName
public String getDriverName()
- Specified by:
getDriverNamein interfaceDatabaseMetaData
-
getDriverVersion
public String getDriverVersion()
- Specified by:
getDriverVersionin interfaceDatabaseMetaData
-
getDriverMajorVersion
public int getDriverMajorVersion()
- Specified by:
getDriverMajorVersionin interfaceDatabaseMetaData
-
getDriverMinorVersion
public int getDriverMinorVersion()
- Specified by:
getDriverMinorVersionin interfaceDatabaseMetaData
-
usesLocalFiles
public boolean usesLocalFiles() throws SQLExceptionDoes the database store tables in a local file? No - it stores them in a file on the server.- Specified by:
usesLocalFilesin interfaceDatabaseMetaData- Returns:
- true if so
- Throws:
SQLException- if a database access error occurs
-
usesLocalFilePerTable
public boolean usesLocalFilePerTable() throws SQLExceptionDoes the database use a file for each table? Well, not really, since it doesn't use local files.- Specified by:
usesLocalFilePerTablein interfaceDatabaseMetaData- Returns:
- true if so
- Throws:
SQLException- if a database access error occurs
-
supportsMixedCaseIdentifiers
public boolean supportsMixedCaseIdentifiers() throws SQLExceptionDoes the database treat mixed case unquoted SQL identifiers as case sensitive and as a result store them in mixed case? A JDBC-Compliant driver will always return false.- Specified by:
supportsMixedCaseIdentifiersin interfaceDatabaseMetaData- Returns:
- true if so
- Throws:
SQLException- if a database access error occurs
-
storesUpperCaseIdentifiers
public boolean storesUpperCaseIdentifiers() throws SQLException- Specified by:
storesUpperCaseIdentifiersin interfaceDatabaseMetaData- Throws:
SQLException
-
storesLowerCaseIdentifiers
public boolean storesLowerCaseIdentifiers() throws SQLException- Specified by:
storesLowerCaseIdentifiersin interfaceDatabaseMetaData- Throws:
SQLException
-
storesMixedCaseIdentifiers
public boolean storesMixedCaseIdentifiers() throws SQLException- Specified by:
storesMixedCaseIdentifiersin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsMixedCaseQuotedIdentifiers
public boolean supportsMixedCaseQuotedIdentifiers() throws SQLExceptionDoes the database treat mixed case quoted SQL identifiers as case sensitive and as a result store them in mixed case? A JDBC compliant driver will always return true.- Specified by:
supportsMixedCaseQuotedIdentifiersin interfaceDatabaseMetaData- Returns:
- true if so
- Throws:
SQLException- if a database access error occurs
-
storesUpperCaseQuotedIdentifiers
public boolean storesUpperCaseQuotedIdentifiers() throws SQLException- Specified by:
storesUpperCaseQuotedIdentifiersin interfaceDatabaseMetaData- Throws:
SQLException
-
storesLowerCaseQuotedIdentifiers
public boolean storesLowerCaseQuotedIdentifiers() throws SQLException- Specified by:
storesLowerCaseQuotedIdentifiersin interfaceDatabaseMetaData- Throws:
SQLException
-
storesMixedCaseQuotedIdentifiers
public boolean storesMixedCaseQuotedIdentifiers() throws SQLException- Specified by:
storesMixedCaseQuotedIdentifiersin interfaceDatabaseMetaData- Throws:
SQLException
-
getIdentifierQuoteString
public String getIdentifierQuoteString() throws SQLException
What is the string used to quote SQL identifiers? This returns a space if identifier quoting isn't supported. A JDBC Compliant driver will always use a double quote character.- Specified by:
getIdentifierQuoteStringin interfaceDatabaseMetaData- Returns:
- the quoting string
- Throws:
SQLException- if a database access error occurs
-
getSQLKeywords
public String getSQLKeywords() throws SQLException
From PostgreSQL 9.0+ return the keywords from pg_catalog.pg_get_keywords()
- Specified by:
getSQLKeywordsin interfaceDatabaseMetaData- Returns:
- a comma separated list of keywords we use
- Throws:
SQLException- if a database access error occurs
-
getNumericFunctions
public String getNumericFunctions() throws SQLException
- Specified by:
getNumericFunctionsin interfaceDatabaseMetaData- Throws:
SQLException
-
getStringFunctions
public String getStringFunctions() throws SQLException
- Specified by:
getStringFunctionsin interfaceDatabaseMetaData- Throws:
SQLException
-
getSystemFunctions
public String getSystemFunctions() throws SQLException
- Specified by:
getSystemFunctionsin interfaceDatabaseMetaData- Throws:
SQLException
-
getTimeDateFunctions
public String getTimeDateFunctions() throws SQLException
- Specified by:
getTimeDateFunctionsin interfaceDatabaseMetaData- Throws:
SQLException
-
getSearchStringEscape
public String getSearchStringEscape() throws SQLException
- Specified by:
getSearchStringEscapein interfaceDatabaseMetaData- Throws:
SQLException
-
getExtraNameCharacters
public String getExtraNameCharacters() throws SQLException
Postgresql allows any high-bit character to be used in an unquoted identifier, so we can't possibly list them all.
From the file src/backend/parser/scan.l, an identifier is ident_start [A-Za-z\200-\377_] ident_cont [A-Za-z\200-\377_0-9\$] identifier {ident_start}{ident_cont}*
- Specified by:
getExtraNameCharactersin interfaceDatabaseMetaData- Returns:
- a string containing the extra characters
- Throws:
SQLException- if a database access error occurs
-
supportsAlterTableWithAddColumn
public boolean supportsAlterTableWithAddColumn() throws SQLException- Specified by:
supportsAlterTableWithAddColumnin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 6.1+
- Throws:
SQLException
-
supportsAlterTableWithDropColumn
public boolean supportsAlterTableWithDropColumn() throws SQLException- Specified by:
supportsAlterTableWithDropColumnin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.3+
- Throws:
SQLException
-
supportsColumnAliasing
public boolean supportsColumnAliasing() throws SQLException- Specified by:
supportsColumnAliasingin interfaceDatabaseMetaData- Throws:
SQLException
-
nullPlusNonNullIsNull
public boolean nullPlusNonNullIsNull() throws SQLException- Specified by:
nullPlusNonNullIsNullin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsConvert
public boolean supportsConvert() throws SQLException- Specified by:
supportsConvertin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsConvert
public boolean supportsConvert(int fromType, int toType) throws SQLException- Specified by:
supportsConvertin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsTableCorrelationNames
public boolean supportsTableCorrelationNames() throws SQLException- Specified by:
supportsTableCorrelationNamesin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsDifferentTableCorrelationNames
public boolean supportsDifferentTableCorrelationNames() throws SQLException- Specified by:
supportsDifferentTableCorrelationNamesin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsExpressionsInOrderBy
public boolean supportsExpressionsInOrderBy() throws SQLException- Specified by:
supportsExpressionsInOrderByin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsOrderByUnrelated
public boolean supportsOrderByUnrelated() throws SQLException- Specified by:
supportsOrderByUnrelatedin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 6.4+
- Throws:
SQLException
-
supportsGroupBy
public boolean supportsGroupBy() throws SQLException- Specified by:
supportsGroupByin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsGroupByUnrelated
public boolean supportsGroupByUnrelated() throws SQLException- Specified by:
supportsGroupByUnrelatedin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 6.4+
- Throws:
SQLException
-
supportsGroupByBeyondSelect
public boolean supportsGroupByBeyondSelect() throws SQLException- Specified by:
supportsGroupByBeyondSelectin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsLikeEscapeClause
public boolean supportsLikeEscapeClause() throws SQLException- Specified by:
supportsLikeEscapeClausein interfaceDatabaseMetaData- Throws:
SQLException
-
supportsMultipleResultSets
public boolean supportsMultipleResultSets() throws SQLException- Specified by:
supportsMultipleResultSetsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsMultipleTransactions
public boolean supportsMultipleTransactions() throws SQLException- Specified by:
supportsMultipleTransactionsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsNonNullableColumns
public boolean supportsNonNullableColumns() throws SQLException- Specified by:
supportsNonNullableColumnsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsMinimumSQLGrammar
public boolean supportsMinimumSQLGrammar() throws SQLExceptionThis grammar is defined at: http://www.microsoft.com/msdn/sdk/platforms/doc/odbc/src/intropr.htm
In Appendix C. From this description, we seem to support the ODBC minimal (Level 0) grammar.
- Specified by:
supportsMinimumSQLGrammarin interfaceDatabaseMetaData- Returns:
- true
- Throws:
SQLException
-
supportsCoreSQLGrammar
public boolean supportsCoreSQLGrammar() throws SQLExceptionDoes this driver support the Core ODBC SQL grammar. We need SQL-92 conformance for this.- Specified by:
supportsCoreSQLGrammarin interfaceDatabaseMetaData- Returns:
- false
- Throws:
SQLException- if a database access error occurs
-
supportsExtendedSQLGrammar
public boolean supportsExtendedSQLGrammar() throws SQLExceptionDoes this driver support the Extended (Level 2) ODBC SQL grammar. We don't conform to the Core (Level 1), so we can't conform to the Extended SQL Grammar.- Specified by:
supportsExtendedSQLGrammarin interfaceDatabaseMetaData- Returns:
- false
- Throws:
SQLException- if a database access error occurs
-
supportsANSI92EntryLevelSQL
public boolean supportsANSI92EntryLevelSQL() throws SQLExceptionDoes this driver support the ANSI-92 entry level SQL grammar? All JDBC Compliant drivers must return true. We currently report false until 'schema' support is added. Then this should be changed to return true, since we will be mostly compliant (probably more compliant than many other databases) And since this is a requirement for all JDBC drivers we need to get to the point where we can return true.- Specified by:
supportsANSI92EntryLevelSQLin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.3+
- Throws:
SQLException- if a database access error occurs
-
supportsANSI92IntermediateSQL
public boolean supportsANSI92IntermediateSQL() throws SQLException- Specified by:
supportsANSI92IntermediateSQLin interfaceDatabaseMetaData- Returns:
- false
- Throws:
SQLException
-
supportsANSI92FullSQL
public boolean supportsANSI92FullSQL() throws SQLException- Specified by:
supportsANSI92FullSQLin interfaceDatabaseMetaData- Returns:
- false
- Throws:
SQLException
-
supportsIntegrityEnhancementFacility
public boolean supportsIntegrityEnhancementFacility() throws SQLException- Specified by:
supportsIntegrityEnhancementFacilityin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsOuterJoins
public boolean supportsOuterJoins() throws SQLException- Specified by:
supportsOuterJoinsin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.1+
- Throws:
SQLException
-
supportsFullOuterJoins
public boolean supportsFullOuterJoins() throws SQLException- Specified by:
supportsFullOuterJoinsin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.1+
- Throws:
SQLException
-
supportsLimitedOuterJoins
public boolean supportsLimitedOuterJoins() throws SQLException- Specified by:
supportsLimitedOuterJoinsin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.1+
- Throws:
SQLException
-
getSchemaTerm
public String getSchemaTerm() throws SQLException
PostgreSQL doesn't have schemas, but when it does, we'll use the term "schema".
- Specified by:
getSchemaTermin interfaceDatabaseMetaData- Returns:
"schema"- Throws:
SQLException
-
getProcedureTerm
public String getProcedureTerm() throws SQLException
- Specified by:
getProcedureTermin interfaceDatabaseMetaData- Returns:
"function"- Throws:
SQLException
-
getCatalogTerm
public String getCatalogTerm() throws SQLException
- Specified by:
getCatalogTermin interfaceDatabaseMetaData- Returns:
"database"- Throws:
SQLException
-
isCatalogAtStart
public boolean isCatalogAtStart() throws SQLException- Specified by:
isCatalogAtStartin interfaceDatabaseMetaData- Throws:
SQLException
-
getCatalogSeparator
public String getCatalogSeparator() throws SQLException
- Specified by:
getCatalogSeparatorin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsSchemasInDataManipulation
public boolean supportsSchemasInDataManipulation() throws SQLException- Specified by:
supportsSchemasInDataManipulationin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.3+
- Throws:
SQLException
-
supportsSchemasInProcedureCalls
public boolean supportsSchemasInProcedureCalls() throws SQLException- Specified by:
supportsSchemasInProcedureCallsin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.3+
- Throws:
SQLException
-
supportsSchemasInTableDefinitions
public boolean supportsSchemasInTableDefinitions() throws SQLException- Specified by:
supportsSchemasInTableDefinitionsin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.3+
- Throws:
SQLException
-
supportsSchemasInIndexDefinitions
public boolean supportsSchemasInIndexDefinitions() throws SQLException- Specified by:
supportsSchemasInIndexDefinitionsin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.3+
- Throws:
SQLException
-
supportsSchemasInPrivilegeDefinitions
public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException- Specified by:
supportsSchemasInPrivilegeDefinitionsin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.3+
- Throws:
SQLException
-
supportsCatalogsInDataManipulation
public boolean supportsCatalogsInDataManipulation() throws SQLException- Specified by:
supportsCatalogsInDataManipulationin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsCatalogsInProcedureCalls
public boolean supportsCatalogsInProcedureCalls() throws SQLException- Specified by:
supportsCatalogsInProcedureCallsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsCatalogsInTableDefinitions
public boolean supportsCatalogsInTableDefinitions() throws SQLException- Specified by:
supportsCatalogsInTableDefinitionsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsCatalogsInIndexDefinitions
public boolean supportsCatalogsInIndexDefinitions() throws SQLException- Specified by:
supportsCatalogsInIndexDefinitionsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsCatalogsInPrivilegeDefinitions
public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException- Specified by:
supportsCatalogsInPrivilegeDefinitionsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsPositionedDelete
public boolean supportsPositionedDelete() throws SQLExceptionWe support cursors for gets only it seems. I dont see a method to get a positioned delete.- Specified by:
supportsPositionedDeletein interfaceDatabaseMetaData- Returns:
- false
- Throws:
SQLException- if a database access error occurs
-
supportsPositionedUpdate
public boolean supportsPositionedUpdate() throws SQLException- Specified by:
supportsPositionedUpdatein interfaceDatabaseMetaData- Throws:
SQLException
-
supportsSelectForUpdate
public boolean supportsSelectForUpdate() throws SQLException- Specified by:
supportsSelectForUpdatein interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 6.5+
- Throws:
SQLException
-
supportsStoredProcedures
public boolean supportsStoredProcedures() throws SQLException- Specified by:
supportsStoredProceduresin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsSubqueriesInComparisons
public boolean supportsSubqueriesInComparisons() throws SQLException- Specified by:
supportsSubqueriesInComparisonsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsSubqueriesInExists
public boolean supportsSubqueriesInExists() throws SQLException- Specified by:
supportsSubqueriesInExistsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsSubqueriesInIns
public boolean supportsSubqueriesInIns() throws SQLException- Specified by:
supportsSubqueriesInInsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsSubqueriesInQuantifieds
public boolean supportsSubqueriesInQuantifieds() throws SQLException- Specified by:
supportsSubqueriesInQuantifiedsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsCorrelatedSubqueries
public boolean supportsCorrelatedSubqueries() throws SQLException- Specified by:
supportsCorrelatedSubqueriesin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.1+
- Throws:
SQLException
-
supportsUnion
public boolean supportsUnion() throws SQLException- Specified by:
supportsUnionin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 6.3+
- Throws:
SQLException
-
supportsUnionAll
public boolean supportsUnionAll() throws SQLException- Specified by:
supportsUnionAllin interfaceDatabaseMetaData- Returns:
- true if connected to PostgreSQL 7.1+
- Throws:
SQLException
-
supportsOpenCursorsAcrossCommit
public boolean supportsOpenCursorsAcrossCommit() throws SQLExceptionIn PostgreSQL, Cursors are only open within transactions.- Specified by:
supportsOpenCursorsAcrossCommitin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsOpenCursorsAcrossRollback
public boolean supportsOpenCursorsAcrossRollback() throws SQLException- Specified by:
supportsOpenCursorsAcrossRollbackin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsOpenStatementsAcrossCommit
public boolean supportsOpenStatementsAcrossCommit() throws SQLExceptionCan statements remain open across commits? They may, but this driver cannot guarantee that. In further reflection. we are talking a Statement object here, so the answer is yes, since the Statement is only a vehicle to ExecSQL()
- Specified by:
supportsOpenStatementsAcrossCommitin interfaceDatabaseMetaData- Returns:
- true
- Throws:
SQLException
-
supportsOpenStatementsAcrossRollback
public boolean supportsOpenStatementsAcrossRollback() throws SQLExceptionCan statements remain open across rollbacks? They may, but this driver cannot guarantee that. In further contemplation, we are talking a Statement object here, so the answer is yes, since the Statement is only a vehicle to ExecSQL() in Connection
- Specified by:
supportsOpenStatementsAcrossRollbackin interfaceDatabaseMetaData- Returns:
- true
- Throws:
SQLException
-
getMaxCharLiteralLength
public int getMaxCharLiteralLength() throws SQLException- Specified by:
getMaxCharLiteralLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxBinaryLiteralLength
public int getMaxBinaryLiteralLength() throws SQLException- Specified by:
getMaxBinaryLiteralLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxColumnNameLength
public int getMaxColumnNameLength() throws SQLException- Specified by:
getMaxColumnNameLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxColumnsInGroupBy
public int getMaxColumnsInGroupBy() throws SQLException- Specified by:
getMaxColumnsInGroupByin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxColumnsInIndex
public int getMaxColumnsInIndex() throws SQLException- Specified by:
getMaxColumnsInIndexin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxColumnsInOrderBy
public int getMaxColumnsInOrderBy() throws SQLException- Specified by:
getMaxColumnsInOrderByin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxColumnsInSelect
public int getMaxColumnsInSelect() throws SQLException- Specified by:
getMaxColumnsInSelectin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxColumnsInTable
public int getMaxColumnsInTable() throws SQLExceptionWhat is the maximum number of columns in a table? From the CREATE TABLE reference page..."The new class is created as a heap with no initial data. A class can have no more than 1600 attributes (realistically, this is limited by the fact that tuple sizes must be less than 8192 bytes)..."
- Specified by:
getMaxColumnsInTablein interfaceDatabaseMetaData- Returns:
- the max columns
- Throws:
SQLException- if a database access error occurs
-
getMaxConnections
public int getMaxConnections() throws SQLExceptionHow many active connection can we have at a time to this database? Well, since it depends on postmaster, which just does a listen() followed by an accept() and fork(), its basically very high. Unless the system runs out of processes, it can be 65535 (the number of aux. ports on a TCP/IP system). I will return 8192 since that is what even the largest system can realistically handle,- Specified by:
getMaxConnectionsin interfaceDatabaseMetaData- Returns:
- the maximum number of connections
- Throws:
SQLException- if a database access error occurs
-
getMaxCursorNameLength
public int getMaxCursorNameLength() throws SQLException- Specified by:
getMaxCursorNameLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxIndexLength
public int getMaxIndexLength() throws SQLException- Specified by:
getMaxIndexLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxSchemaNameLength
public int getMaxSchemaNameLength() throws SQLException- Specified by:
getMaxSchemaNameLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxProcedureNameLength
public int getMaxProcedureNameLength() throws SQLException- Specified by:
getMaxProcedureNameLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxCatalogNameLength
public int getMaxCatalogNameLength() throws SQLException- Specified by:
getMaxCatalogNameLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxRowSize
public int getMaxRowSize() throws SQLException- Specified by:
getMaxRowSizein interfaceDatabaseMetaData- Throws:
SQLException
-
doesMaxRowSizeIncludeBlobs
public boolean doesMaxRowSizeIncludeBlobs() throws SQLException- Specified by:
doesMaxRowSizeIncludeBlobsin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxStatementLength
public int getMaxStatementLength() throws SQLException- Specified by:
getMaxStatementLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxStatements
public int getMaxStatements() throws SQLException- Specified by:
getMaxStatementsin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxTableNameLength
public int getMaxTableNameLength() throws SQLException- Specified by:
getMaxTableNameLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxTablesInSelect
public int getMaxTablesInSelect() throws SQLException- Specified by:
getMaxTablesInSelectin interfaceDatabaseMetaData- Throws:
SQLException
-
getMaxUserNameLength
public int getMaxUserNameLength() throws SQLException- Specified by:
getMaxUserNameLengthin interfaceDatabaseMetaData- Throws:
SQLException
-
getDefaultTransactionIsolation
public int getDefaultTransactionIsolation() throws SQLException- Specified by:
getDefaultTransactionIsolationin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsTransactions
public boolean supportsTransactions() throws SQLException- Specified by:
supportsTransactionsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsTransactionIsolationLevel
public boolean supportsTransactionIsolationLevel(int level) throws SQLExceptionWe only support TRANSACTION_SERIALIZABLE and TRANSACTION_READ_COMMITTED before 8.0; from 8.0 READ_UNCOMMITTED and REPEATABLE_READ are accepted aliases for READ_COMMITTED.
- Specified by:
supportsTransactionIsolationLevelin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsDataDefinitionAndDataManipulationTransactions
public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException- Specified by:
supportsDataDefinitionAndDataManipulationTransactionsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsDataManipulationTransactionsOnly
public boolean supportsDataManipulationTransactionsOnly() throws SQLException- Specified by:
supportsDataManipulationTransactionsOnlyin interfaceDatabaseMetaData- Throws:
SQLException
-
dataDefinitionCausesTransactionCommit
public boolean dataDefinitionCausesTransactionCommit() throws SQLExceptionDoes a data definition statement within a transaction force the transaction to commit? It seems to mean something like:
CREATE TABLE T (A INT); INSERT INTO T (A) VALUES (2); BEGIN; UPDATE T SET A = A + 1; CREATE TABLE X (A INT); SELECT A FROM T INTO X; COMMIT;
Does the CREATE TABLE call cause a commit? The answer is no.
- Specified by:
dataDefinitionCausesTransactionCommitin interfaceDatabaseMetaData- Returns:
- true if so
- Throws:
SQLException- if a database access error occurs
-
dataDefinitionIgnoredInTransactions
public boolean dataDefinitionIgnoredInTransactions() throws SQLException- Specified by:
dataDefinitionIgnoredInTransactionsin interfaceDatabaseMetaData- Throws:
SQLException
-
escapeQuotes
protected String escapeQuotes(String s) throws SQLException
Turn the provided value into a valid string literal for direct inclusion into a query. This includes the single quotes needed around it.- Parameters:
s- input value- Returns:
- string literal for direct inclusion into a query
- Throws:
SQLException- if something wrong happens
-
getProcedures
public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException
- Specified by:
getProceduresin interfaceDatabaseMetaData- Throws:
SQLException
-
getProcedureColumns
public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException
- Specified by:
getProcedureColumnsin interfaceDatabaseMetaData- Throws:
SQLException
-
getTables
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException
- Specified by:
getTablesin interfaceDatabaseMetaData- Throws:
SQLException
-
getSchemas
public ResultSet getSchemas() throws SQLException
- Specified by:
getSchemasin interfaceDatabaseMetaData- Throws:
SQLException
-
getSchemas
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException
- Specified by:
getSchemasin interfaceDatabaseMetaData- Throws:
SQLException
-
getCatalogs
public ResultSet getCatalogs() throws SQLException
PostgreSQL does not support multiple catalogs from a single connection, so to reduce confusion we only return the current catalog.- Specified by:
getCatalogsin interfaceDatabaseMetaData- Throws:
SQLException
-
getTableTypes
public ResultSet getTableTypes() throws SQLException
- Specified by:
getTableTypesin interfaceDatabaseMetaData- Throws:
SQLException
-
getColumns
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- Specified by:
getColumnsin interfaceDatabaseMetaData- Throws:
SQLException
-
getColumnPrivileges
public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException
- Specified by:
getColumnPrivilegesin interfaceDatabaseMetaData- Throws:
SQLException
-
getTablePrivileges
public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
- Specified by:
getTablePrivilegesin interfaceDatabaseMetaData- Throws:
SQLException
-
parseACL
public Map<String,Map<String,List<String[]>>> parseACL(String aclArray, String owner)
Take the a String representing an array of ACLs and return a Map mapping the SQL permission name to a List of usernames who have that permission. For instance:SELECT -> user1 -> list of [grantor, grantable]- Parameters:
aclArray- ACL arrayowner- owner- Returns:
- a Map mapping the SQL permission name
-
getBestRowIdentifier
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException
- Specified by:
getBestRowIdentifierin interfaceDatabaseMetaData- Throws:
SQLException
-
getVersionColumns
public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException
- Specified by:
getVersionColumnsin interfaceDatabaseMetaData- Throws:
SQLException
-
getPrimaryKeys
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException
- Specified by:
getPrimaryKeysin interfaceDatabaseMetaData- Throws:
SQLException
-
getImportedExportedKeys
protected ResultSet getImportedExportedKeys(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
- Parameters:
primaryCatalog- primary catalogprimarySchema- primary schemaprimaryTable- if provided will get the keys exported by this tableforeignCatalog- foreign catalogforeignSchema- foreign schemaforeignTable- if provided will get the keys imported by this table- Returns:
- ResultSet
- Throws:
SQLException- if something wrong happens
-
getImportedKeys
public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException
- Specified by:
getImportedKeysin interfaceDatabaseMetaData- Throws:
SQLException
-
getExportedKeys
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException
- Specified by:
getExportedKeysin interfaceDatabaseMetaData- Throws:
SQLException
-
getCrossReference
public ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
- Specified by:
getCrossReferencein interfaceDatabaseMetaData- Throws:
SQLException
-
getTypeInfo
public ResultSet getTypeInfo() throws SQLException
- Specified by:
getTypeInfoin interfaceDatabaseMetaData- Throws:
SQLException
-
getIndexInfo
public ResultSet getIndexInfo(String catalog, String schema, String tableName, boolean unique, boolean approximate) throws SQLException
- Specified by:
getIndexInfoin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsResultSetType
public boolean supportsResultSetType(int type) throws SQLException- Specified by:
supportsResultSetTypein interfaceDatabaseMetaData- Throws:
SQLException
-
supportsResultSetConcurrency
public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException- Specified by:
supportsResultSetConcurrencyin interfaceDatabaseMetaData- Throws:
SQLException
-
ownUpdatesAreVisible
public boolean ownUpdatesAreVisible(int type) throws SQLException- Specified by:
ownUpdatesAreVisiblein interfaceDatabaseMetaData- Throws:
SQLException
-
ownDeletesAreVisible
public boolean ownDeletesAreVisible(int type) throws SQLException- Specified by:
ownDeletesAreVisiblein interfaceDatabaseMetaData- Throws:
SQLException
-
ownInsertsAreVisible
public boolean ownInsertsAreVisible(int type) throws SQLException- Specified by:
ownInsertsAreVisiblein interfaceDatabaseMetaData- Throws:
SQLException
-
othersUpdatesAreVisible
public boolean othersUpdatesAreVisible(int type) throws SQLException- Specified by:
othersUpdatesAreVisiblein interfaceDatabaseMetaData- Throws:
SQLException
-
othersDeletesAreVisible
public boolean othersDeletesAreVisible(int i) throws SQLException- Specified by:
othersDeletesAreVisiblein interfaceDatabaseMetaData- Throws:
SQLException
-
othersInsertsAreVisible
public boolean othersInsertsAreVisible(int type) throws SQLException- Specified by:
othersInsertsAreVisiblein interfaceDatabaseMetaData- Throws:
SQLException
-
updatesAreDetected
public boolean updatesAreDetected(int type) throws SQLException- Specified by:
updatesAreDetectedin interfaceDatabaseMetaData- Throws:
SQLException
-
deletesAreDetected
public boolean deletesAreDetected(int i) throws SQLException- Specified by:
deletesAreDetectedin interfaceDatabaseMetaData- Throws:
SQLException
-
insertsAreDetected
public boolean insertsAreDetected(int type) throws SQLException- Specified by:
insertsAreDetectedin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsBatchUpdates
public boolean supportsBatchUpdates() throws SQLException- Specified by:
supportsBatchUpdatesin interfaceDatabaseMetaData- Throws:
SQLException
-
getUDTs
public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException
- Specified by:
getUDTsin interfaceDatabaseMetaData- Throws:
SQLException
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceDatabaseMetaData- Throws:
SQLException
-
createMetaDataStatement
protected Statement createMetaDataStatement() throws SQLException
- Throws:
SQLException
-
getMaxLogicalLobSize
public long getMaxLogicalLobSize() throws SQLException- Specified by:
getMaxLogicalLobSizein interfaceDatabaseMetaData- Throws:
SQLException
-
supportsRefCursors
public boolean supportsRefCursors() throws SQLException- Specified by:
supportsRefCursorsin interfaceDatabaseMetaData- Throws:
SQLException
-
getRowIdLifetime
public RowIdLifetime getRowIdLifetime() throws SQLException
- Specified by:
getRowIdLifetimein interfaceDatabaseMetaData- Throws:
SQLException
-
supportsStoredFunctionsUsingCallSyntax
public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException- Specified by:
supportsStoredFunctionsUsingCallSyntaxin interfaceDatabaseMetaData- Throws:
SQLException
-
autoCommitFailureClosesAllResultSets
public boolean autoCommitFailureClosesAllResultSets() throws SQLException- Specified by:
autoCommitFailureClosesAllResultSetsin interfaceDatabaseMetaData- Throws:
SQLException
-
getClientInfoProperties
public ResultSet getClientInfoProperties() throws SQLException
- Specified by:
getClientInfoPropertiesin interfaceDatabaseMetaData- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
getFunctions
public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException
- Specified by:
getFunctionsin interfaceDatabaseMetaData- Throws:
SQLException
-
getFunctionColumns
public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException
- Specified by:
getFunctionColumnsin interfaceDatabaseMetaData- Throws:
SQLException
-
getPseudoColumns
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- Specified by:
getPseudoColumnsin interfaceDatabaseMetaData- Throws:
SQLException
-
generatedKeyAlwaysReturned
public boolean generatedKeyAlwaysReturned() throws SQLException- Specified by:
generatedKeyAlwaysReturnedin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsSavepoints
public boolean supportsSavepoints() throws SQLException- Specified by:
supportsSavepointsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsNamedParameters
public boolean supportsNamedParameters() throws SQLException- Specified by:
supportsNamedParametersin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsMultipleOpenResults
public boolean supportsMultipleOpenResults() throws SQLException- Specified by:
supportsMultipleOpenResultsin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsGetGeneratedKeys
public boolean supportsGetGeneratedKeys() throws SQLException- Specified by:
supportsGetGeneratedKeysin interfaceDatabaseMetaData- Throws:
SQLException
-
getSuperTypes
public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException
- Specified by:
getSuperTypesin interfaceDatabaseMetaData- Throws:
SQLException
-
getSuperTables
public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
- Specified by:
getSuperTablesin interfaceDatabaseMetaData- Throws:
SQLException
-
getAttributes
public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException
- Specified by:
getAttributesin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsResultSetHoldability
public boolean supportsResultSetHoldability(int holdability) throws SQLException- Specified by:
supportsResultSetHoldabilityin interfaceDatabaseMetaData- Throws:
SQLException
-
getResultSetHoldability
public int getResultSetHoldability() throws SQLException- Specified by:
getResultSetHoldabilityin interfaceDatabaseMetaData- Throws:
SQLException
-
getDatabaseMajorVersion
public int getDatabaseMajorVersion() throws SQLException- Specified by:
getDatabaseMajorVersionin interfaceDatabaseMetaData- Throws:
SQLException
-
getDatabaseMinorVersion
public int getDatabaseMinorVersion() throws SQLException- Specified by:
getDatabaseMinorVersionin interfaceDatabaseMetaData- Throws:
SQLException
-
getJDBCMajorVersion
public int getJDBCMajorVersion()
- Specified by:
getJDBCMajorVersionin interfaceDatabaseMetaData
-
getJDBCMinorVersion
public int getJDBCMinorVersion()
- Specified by:
getJDBCMinorVersionin interfaceDatabaseMetaData
-
getSQLStateType
public int getSQLStateType() throws SQLException- Specified by:
getSQLStateTypein interfaceDatabaseMetaData- Throws:
SQLException
-
locatorsUpdateCopy
public boolean locatorsUpdateCopy() throws SQLException- Specified by:
locatorsUpdateCopyin interfaceDatabaseMetaData- Throws:
SQLException
-
supportsStatementPooling
public boolean supportsStatementPooling() throws SQLException- Specified by:
supportsStatementPoolingin interfaceDatabaseMetaData- Throws:
SQLException
-
-