GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.postgresql.org — ALTER DATABASE November 19, 2026: PostgreSQL 19 Released!
Development Versions:
devel
ALTER DATABASEALTER DATABASE — change a database SynopsisALTER DATABASE Description
The first form changes certain per-database settings. (See below for details.) Only the database owner or a superuser can change these settings. The second form changes the name of the database. Only the database owner or a superuser can rename a database; non-superuser owners must also have the The third form changes the owner of the database. To alter the owner, you must be able to The fourth form changes the default tablespace of the database. Only the database owner or a superuser can do this; you must also have create privilege for the new tablespace. This command physically moves any tables or indexes in the database's old default tablespace to the new tablespace. The new default tablespace must be empty for this database, and no one can be connected to the database. Tables and indexes in non-default tablespaces are unaffected. The method used to copy files to the new tablespace is affected by the file_copy_method setting. The remaining forms change the session default for a run-time configuration variable for a PostgreSQL database. Whenever a new session is subsequently started in that database, the specified value becomes the session default value. The database-specific default overrides whatever setting is present in Parameters
NotesIt is also possible to tie a session default to a specific role rather than to a database; see ALTER ROLE. Role-specific settings override database-specific ones if there is a conflict. ExamplesTo disable index scans by default in the database ALTER DATABASE test SET enable_indexscan TO off; CompatibilityThe See AlsoCREATE DATABASE, DROP DATABASE, SET, CREATE TABLESPACESubmit correctionIf you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |