Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Category index4025
NotesNotes
Use the DROP VIEW statement to drop views.
Be careful that the names and types of the view's columns will be assigned the way you want. For example:
CREATE VIEW vista AS SELECT 'Hello …Notes
NotesNotes
Normal cursors return data in text format, the same as a SELECT would produce. The BINARY option specifies that the cursor should return data in binary format. This reduces conversion …Notes
NotesNotes
PostgreSQL lets you reference columns of other tables in the WHERE condition by specifying the other tables in the USING clause. For example, to delete all films produced by a given pr…Notes
NotesNotes
DISCARD ALL cannot be executed inside a transaction block.Notes
NotesNotes
The procedural language to be used must already have been installed into the current database by means of CREATE EXTENSION. plpgsql is installed by default, but other languages are not…Notes
NotesNotes
DROP OWNED is often used to prepare for the removal of one or more roles. Because DROP OWNED only affects the objects in the current database, it is usually necessary to execute this c…Notes
NotesNotes
Alternative syntaxes for referencing ordered-set aggregates are described under ALTER AGGREGATE.Notes
NotesNotes
DROP DATABASE cannot be executed inside a transaction block.
This command cannot be executed while connected to the target database. Thus, it might be more convenient to use the progra…Notes
NotesNotes
DROP OPERATOR CLASS will not drop the operator family containing the class, even if there is nothing else left in the family (in particular, in the case where the family was implicitly…Notes
NotesNotes
If there is only one procedure of the given name, the argument list can be omitted. Omit the parentheses too in this case.
In PostgreSQL, it's sufficient to list the input (including I…Notes
NotesNotes
PostgreSQL includes a program dropuser that has the same functionality as this command (in fact, it calls this command) but can be run from the command shell.Notes
NotesNotes
The lookup rules used by DROP ROUTINE are fundamentally the same as for DROP PROCEDURE; in particular, DROP ROUTINE shares that command's behavior of considering an argument list that …Notes
NotesNotes
Using the CASCADE option might make the command remove objects in other schemas besides the one(s) named.Notes
NotesNotes
When dropping a subscription that is associated with a replication slot on the remote host (the normal state), DROP SUBSCRIPTION will connect to the remote host and try to drop the rep…Notes
NotesNotes
DROP TABLESPACE cannot be executed inside a transaction block.Notes
NotesNotes
Use ROLLBACK to abort a transaction.
Issuing END when not inside a transaction does no harm, but it will provoke a warning message.Notes
NotesNotes
In order to allow the PostgreSQL query planner to make reasonably informed decisions when optimizing queries, the pg_statistic data should be up-to-date for all tables used in the quer…Notes
NotesNotes
The cursor should be declared with the SCROLL option if one intends to use any variants of FETCH other than FETCH NEXT or FETCH FORWARD with a positive count. For simple queries Postgr…Notes
NotesNotes
The REVOKE command is used to revoke access privileges.
Since PostgreSQL 8.1, the concepts of users and groups have been unified into a single kind of entity called a role. It is there…Notes
NotesNotes
If the specified table is a partitioned table, each row is routed to the appropriate partition and inserted into it. If the specified table is a partition, an error will occur if one o…Notes
NotesNotes
LISTEN takes effect at transaction commit. If LISTEN or UNLISTEN is executed within a transaction that later rolls back, the set of notification channels being listened to is unchanged…Notes
NotesNotes
To lock a table, the user must have the right privilege for the specified lockmode. If the user has MAINTAIN, UPDATE, DELETE, or TRUNCATE privileges on the table, any lockmode is permi…Notes
NotesNotes
The following steps take place during the execution of MERGE.
Perform any BEFORE STATEMENT triggers for all actions specified, whether or not their WHEN clauses match. Perform a join f…Notes
NotesNotes
There is a queue that holds notifications that have been sent but not yet processed by all listening sessions. If this queue becomes full, transactions calling NOTIFY will fail at comm…Notes
NotesNotes
PREPARE TRANSACTION is not intended for use in applications or interactive sessions. Its purpose is to allow an external transaction manager to perform atomic global transactions acros…Notes
NotesNotes
A prepared statement can be executed with either a generic plan or a custom plan. A generic plan is the same across all executions, while a custom plan is generated for a specific exec…Notes
NotesNotes
REASSIGN OWNED is often used to prepare for the removal of one or more roles. Because REASSIGN OWNED does not affect objects within other databases, it is usually necessary to execute …Notes
NotesNotes
If there is an ORDER BY clause in the materialized view's defining query, the original contents of the materialized view will be ordered that way; but REFRESH MATERIALIZED VIEW does no…Notes
NotesNotes
If you suspect corruption of an index on a user table, you can simply rebuild that index, or all indexes on the table, using REINDEX INDEX or REINDEX TABLE.
Things are more difficult i…Notes
NotesNotes
Specifying a savepoint name that was not previously defined is an error.
It is not possible to release a savepoint when the transaction is in an aborted state; to do that, use ROLLBACK…Notes
NotesNotes
A user can only revoke privileges that were granted directly by that user. If, for example, user A has granted a privilege with grant option to user B, and user B has in turn granted i…Notes
NotesNotes
To roll back a prepared transaction, you must be either the same user that executed the transaction originally, or a superuser. But you do not have to be in the same session that execu…Notes
NotesNotes
Use RELEASE SAVEPOINT to destroy a savepoint without discarding the effects of commands executed after it was established.
Specifying a savepoint name that has not been established is …Notes
NotesNotes
Use COMMIT to successfully terminate a transaction.
Issuing ROLLBACK outside of a transaction block emits a warning and otherwise has no effect. ROLLBACK AND CHAIN outside of a transac…Notes
NotesNotes
Use ROLLBACK TO to rollback to a savepoint. Use RELEASE SAVEPOINT to destroy a savepoint, keeping the effects of commands executed after it was established.
Savepoints can only be esta…Notes
NotesNotes
CREATE TABLE AS is functionally similar to SELECT INTO. CREATE TABLE AS is the recommended syntax, since this form of SELECT INTO is not available in ECPG or PL/pgSQL, because they int…Notes
NotesNotes
Because PostgreSQL does not require constraint names to be unique within a schema (but only per-table), it is possible that there is more than one match for a specified constraint name…Notes
NotesNotes
Using this command, it is possible to either add privileges or restrict one's privileges. If the session user role has been granted memberships WITH INHERIT TRUE, it automatically has …Notes
NotesNotes
SET SESSION AUTHORIZATION cannot be used within a SECURITY DEFINER function.Notes
NotesNotes
If SET TRANSACTION is executed without a prior START TRANSACTION or BEGIN, it emits a warning and otherwise has no effect.
It is possible to dispense with SET TRANSACTION by instead sp…Notes
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
pg17: choose a version ex: extensions only ↑↓ select ↵ open