307 parse_schema_name(
string nname, reference<string> schema, reference<string> name);
351 list<hash<auto>> getTypeList();
354 list<string> getModifySql(
PgsqlType old, *hash opt);
387 constructor(
string n_name,
bool n_unique, hash n_cols, *
string n_tablespace) ;
426 softlist getRenameSql(
string table_name,
string new_name);
450 list getRenameSql(
string table_name,
string new_name);
472 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, *
int scale) ;
542 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm, softint bs, softint
scale) ;
631 list<auto> getRenameSql(
string table_name,
string new_name);
700 constructor(
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
724 constructor(
string n_name,
string n_src, *
string n_schemaname, *
string n_viewowner)
817 constructor(
string n,
string n_src,
string n_trigger) ;
829 const PGSQL_TempSavepoint =
"qore_pgsql_tmp_savepoint";
843 list<string> featuresImpl();
854 PgsqlSequence makeSequenceImpl(
string name, number start = 1, number increment = 1, *softnumber end, *hash
opts);
859 *AbstractSequence getSequenceImpl(
string name);
864 *AbstractView getViewImpl(
string name);
879 *AbstractFunction getFunctionImpl(
string name);
884 AbstractFunction getProcedureImpl(
string name);
888 static *
string getFunctionArgs(
string err, reference<string> src);
893 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
898 list getAlignSqlImpl(hash schema_hash, *hash opt);
927 list<string> listSequencesImpl();
932 list<string> listViewsImpl();
1022 *
string getDbName();
1045 static auto tryExecArgs(AbstractDatasource
ds,
string sql, *softlist<auto> args);
1073 const PgsqlColumnDescOptions = AbstractTable::ColumnDescOptions;
1075 const PgsqlIndexOptions = AbstractTable::IndexOptions;
1077 const PgsqlConstraintOptions = ...;
1080 const PgsqlTableCreationOptions = ...;
1083 const PgsqlAlignTableOptions = AbstractTable::AlignTableOptions + PgsqlTableCreationOptions;
1147 PgsqlFunction addTriggerFunction(
string tfname,
string src,
string trigger);
1183 code getUpsertAuto(Columns cols, hash<auto> row, *hash<auto> opt);
1188 PgsqlFunction addTriggerFunctionUnlocked(
string tfname,
string src,
string trigger);
1197 hash getTableCreationOptions();
1202 hash getTableDescriptionHashOptions();
1207 hash getColumnDescOptions();
1212 hash getIndexOptions();
1217 hash getConstraintOptions();
1222 hash getAlignTableOptions();
1249 bool checkExistenceImpl();
1254 Columns describeImpl();
1264 Indexes getIndexesImpl();
1269 ForeignConstraints getForeignConstraintsImpl(*hash<auto>
opts);
1274 Constraints getConstraintsImpl();
1279 Triggers getTriggersImpl();
1290 *list getCreateMiscSqlImpl(*hash opt,
bool cache);
1295 *list getAlignSqlImpl(AbstractTable table, *hash<auto> opt);
1306 string getRenameSqlImpl(
string new_name);
1311 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable = True);
1316 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1321 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1326 AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash<auto> ch,
string table, hash<auto> tch, *hash<auto> opt);
1331 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1336 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1341 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1346 bool tryInsertImpl(
string sql, hash<auto> row);
1359 hash<auto> getQoreTypeMapImpl();
1364 hash<auto> getTypeMapImpl();
1388 softlist getDropSqlImpl();
1393 setupTableImpl(hash<auto> desc, *hash<auto> opt);
1446 *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
1451 list<auto> getGroupOrderByListUnlocked(hash<QueryInfo> info,
string key, list<auto> coll);
represents a PostgreSQL-specific check constraint
Definition PgsqlSqlUtilBase.qm.dox.h:435
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
constructor(string n, string n_src)
creates the constraint from the supplied arguments
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
string getCreateSql(string name, string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
represents a PostgreSQL-specific column
Definition PgsqlSqlUtilBase.qm.dox.h:459
int byte_size
byte size of the column
Definition PgsqlSqlUtilBase.qm.dox.h:463
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, *int scale)
creates the column from the supplied arguments
string getNativeTypeString()
returns a string giving the native type of the column
constructor()
empty constructor for subclasses
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt)
returns a list of sql strings that can be used to modify the column to the new definition
list getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
provides the PostgreSQL-specific implementation of the AbstractDatabase interface
Definition PgsqlSqlUtilBase.qm.dox.h:822
auto tryExecRawImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
ListIterator materializedViewIterator()
returns an iterator listing the string materialized view names in the database
const PgsqlReservedWords
hash (set) of reserved words
Definition PgsqlSqlUtilBase.qm.dox.h:836
ListIterator typeIterator()
returns an iterator listing the string type names in the database
hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
const PgsqlReclaimSpaceOptions
Options for reclaimSpace()
Definition PgsqlSqlUtilBase.qm.dox.h:832
list< string > listFunctionsImpl()
returns a list of string function names in the database
bool supportsTypesImpl()
returns True if the database supports named types
list< string > listTablesImpl()
returns a list of string table names in the database
list< string > listMaterializedViews()
returns a list of string materialized view names in the database
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
list< string > listProceduresImpl()
since PostgreSQL only supports functions, this method is identical to listFunctionsImpl()
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
static string getCreateSql(list l)
returns a string that can be used to create the schema in the database
int getPhysicalSizeImpl()
SqlUtil::AbstractDatabase::getPhysicalSize()
bool supportsSequencesImpl()
returns True if the database supports sequences
hash getReclaimSpaceOptions()
returns driver-specific options to the base abstract class
string getCreateSqlImpl(list l)
returns a string that can be used to create the schema in the database
bool supportsPackagesImpl()
returns True if the database supports packages
const PgsqlSchemaDescriptionOptions
PostgreSQL-specific schema description keys.
Definition PgsqlSqlUtilBase.qm.dox.h:826
static auto tryExecRaw(AbstractDatasource ds, string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
static auto tryExecArgs(AbstractDatasource ds, string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
list< string > listTypes()
returns a list of string type names in the database
represents a PostgreSQL-specific foreign constraint
Definition PgsqlSqlUtilBase.qm.dox.h:411
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the constraint in the database
constructor(string n, Columns c, ForeignConstraintTarget t)
creates the constraint from the supplied arguments
string getCreateSql(string name, string table_name, *hash< auto > opt)
returns a string that can be used to create the constraint in the database
represents a PostgreSQL-specific function
Definition PgsqlSqlUtilBase.qm.dox.h:773
setName(string new_name)
sets the new name of the function
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
softlist< string > getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the function in the database
softlist< string > getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
represents a PostgreSQL-specific index
Definition PgsqlSqlUtilBase.qm.dox.h:380
constructor(string n_name, bool n_unique, hash n_cols, *string n_tablespace)
creates the object from the arguments
*string tablespace
the tablespace name of the index
Definition PgsqlSqlUtilBase.qm.dox.h:384
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
string getDropSql(string table_name)
returns a string that can be used to drop the index from the database
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
the data type for PostgreSQL NUMBER columns
Definition PgsqlSqlUtilBase.qm.dox.h:299
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents a PostgreSQL-specific numeric column
Definition PgsqlSqlUtilBase.qm.dox.h:538
string getNativeTypeString()
returns a string giving the native type of the column
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint scale)
creates the column from the supplied arguments
represents a PostgreSQL-specific primary key constraint
Definition PgsqlSqlUtilBase.qm.dox.h:648
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the constraint
string getCreateSql(string table_name, *hash< auto > opts)
returns a string that can be used to create the constraint
PgsqlColumn memberGate(string k)
returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
constructor(string n, *hash c, *string ts)
creates the object with the given attributes
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
constructor()
creates an empty primary key object
PostgreSQL savepoint helper.
Definition PgsqlSqlUtilBase.qm.dox.h:311
constructor(AbstractDatasource ds, *string savepoint)
Creates the object.
deleteSavepointImpl()
Deletes the savepoint.
createSavepointImpl()
Creates the savepoint.
rollbackImpl()
Rolls back to the savepoint.
class for PostgreSQL sequences
Definition PgsqlSqlUtilBase.qm.dox.h:696
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the sequence in the database
provides the PostgreSQL-specific implementation of the SqlUtil::AbstractTable interface
Definition PgsqlSqlUtilBase.qm.dox.h:1052
const PgsqlNameMap
maps from verbose type names to simple type names
Definition PgsqlSqlUtilBase.qm.dox.h:1060
copyImpl(AbstractTable old)
db-specific copy actions
int server_version_sub
PostgreSQL server version.
Definition PgsqlSqlUtilBase.qm.dox.h:1128
hash< auto > getExpressionMap()
Returns the expression map for PostgreSQL.
const PgsqlIopMap
a hash of default value operator descriptions for PostgreSQL
Definition PgsqlSqlUtilBase.qm.dox.h:1098
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema,...
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
const PgsqlUopMap
a hash of default update operator definitions for PostgreSQL
Definition PgsqlSqlUtilBase.qm.dox.h:1102
hash getInsertOperatorMap()
returns the insert operator map for this object
bool has_atomic_merge
Set based on the postgreSQL server version.
Definition PgsqlSqlUtilBase.qm.dox.h:1116
int server_version_major
PostgreSQL server major version.
Definition PgsqlSqlUtilBase.qm.dox.h:1122
constructor(AbstractDatasource nds, string nname, *hash opts)
Creates the object from the arguments.
doSelectLimitOnlyInternImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
AbstractDataProviderType getNumericTypeImpl(string native_type, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
const PgsqlCopMap
column operator specializations for PostgreSQL
Definition PgsqlSqlUtilBase.qm.dox.h:1090
doSelectOrderByWithOffsetSqlInternImpl(reference< hash< QueryInfo > > info, reference< string > sql, list< auto > coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
string getSchemaName()
returns the schema name
bool hasArrayBind()
returns False because the pgsql driver does not support array binds / bulk DML operations
const PgsqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions with "functions"
Definition PgsqlSqlUtilBase.qm.dox.h:1070
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
string getCreateSqlImpl(list l)
returns a string that can be used to create the table in the database
bool supportsTablespacesImpl()
returns True if the database support tablespaces
string getCreateTableSqlImpl(*hash opt)
returns a string that can be used to create the table in the database
int server_version_minor
PostgreSQL server minor version.
Definition PgsqlSqlUtilBase.qm.dox.h:1125
const PgsqlTypeMap
maps PostgreSQL type names to type configurations
Definition PgsqlSqlUtilBase.qm.dox.h:1056
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
string schema
schema name for the table
Definition PgsqlSqlUtilBase.qm.dox.h:1110
transient Mutex pg_state()
Lock for atomicity for setting state info.
clearImpl()
clears PostgreSQL-specific table information
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure for performing upserts
getServerVersion()
Sets the internal PostgreSQL server version.
auto tryExecRawImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
const PgsqlTruncDate
Map SqlUtil::cop_trunc_date() constants to PostgreSQL internal masks.
Definition PgsqlSqlUtilBase.qm.dox.h:1094
bool hasAtomicUpsert()
Returns True if the server supports atomic upsert/merge operations.
*string getTablespaceName()
returns the data tablespace name for the table or NOTHING if none is known
int server_version
PostgreSQL server full version code.
Definition PgsqlSqlUtilBase.qm.dox.h:1119
list< auto > getColumnSqlNames(softlist< auto > cols)
returns a list of column names for use in SQL strings
hash getColumnOperatorMapImpl()
returns the column operator map for this object
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition PgsqlSqlUtilBase.qm.dox.h:1113
const QoreTypeMap
maps qore type names to PostgreSQL type names
Definition PgsqlSqlUtilBase.qm.dox.h:1064
hash getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const PgsqlExpressionMap
Expression map for PostgreSQL.
Definition PgsqlSqlUtilBase.qm.dox.h:1086
*string tablespace
tablespace name for the table, if known
Definition PgsqlSqlUtilBase.qm.dox.h:1107
represents a PostgreSQL-specific trigger function
Definition PgsqlSqlUtilBase.qm.dox.h:811
string trigger
trigger name
Definition PgsqlSqlUtilBase.qm.dox.h:815
represents a PostgreSQL-specific trigger
Definition PgsqlSqlUtilBase.qm.dox.h:742
softlist< string > getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
string getNormalizedSource(string src)
returns normalized source for comparisons
softlist< string > getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
softlist< string > getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
represents a PostgreSQL type
Definition PgsqlSqlUtilBase.qm.dox.h:338
string getDropSql(*hash opt)
returns a string that can be used to drop the function from the database
string name
the name of the type
Definition PgsqlSqlUtilBase.qm.dox.h:342
string getCreateSql(*hash opt)
returns a string that can be used to create the type in the database
string getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename a type
constructor(string n_name, string n_src)
creates the type from the supplied arguments
string src
the source of the type
Definition PgsqlSqlUtilBase.qm.dox.h:345
bool equal(PgsqlType type)
returns True if the types are equal
common base class for unique constraints
Definition PgsqlSqlUtilBase.qm.dox.h:551
bool setIndexBase(string ix)
sets the supporting index name
getIndexSql(reference< string > sql, string name, *hash opts)
adds index options onto the sql creation string
clearIndex()
clears any index base for the constraint
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
constructor(*string ts)
creates the constraint with an optional tablespace name
setTablespace(*string ts)
sets or clears the tablespace name
*string getTablespace()
returns the tablespace name used for this constraint, if known
*string tablespace
any tablespace for the unique key index
Definition PgsqlSqlUtilBase.qm.dox.h:556
class modeling a unique constraint
Definition PgsqlSqlUtilBase.qm.dox.h:590
constructor(string n, hash n_cols, bool e=True, *string ts)
creates the object with the given attributes
bool isEnabled()
returns True if the constraint is enabled, False if not
string getCreateSql(string name, string table_name, *hash< auto > opts)
returns a string that can be used to rename the constraint
PgsqlColumn memberGate(string k)
returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
string getCreateSql(string table_name, *hash opts)
returns a string that can be used to create the constraint
bool enabled
True if the constraint is enabled, False if not
Definition PgsqlSqlUtilBase.qm.dox.h:595
represents a PostgreSQL view
Definition PgsqlSqlUtilBase.qm.dox.h:717
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the view in the database
constructor(string n_name, string n_src, *string n_schemaname, *string n_viewowner)
creates the object from the arguments
*string viewowner
Owner of the view.
Definition PgsqlSqlUtilBase.qm.dox.h:721
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
transient AbstractDatasource ds
cache(*hash< auto > opts)
the PgsqlSqlUtilBase namespace contains all the objects in the PgsqlSqlUtilBase module
Definition PgsqlSqlUtilBase.qm.dox.h:289
PgsqlTable get_table(AbstractDatasource nds, string nname, *hash< auto > opts)
returns a PgsqlTable object corresponding to the arguments
PgsqlDatabase get_database(AbstractDatasource nds, *hash< auto > opts)
returns a PgsqlDatabase object corresponding to the arguments