DROP USER

NameDROP USER -- remove a database role Synopsis DROP USER [ IF EXISTS ] name [, ...] Description DROP USER is simply an alternate spelling of DROP ROLE. Compatibility The DROP USER statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation. See Also DROP ROLE Prev Next DROP TYPE Up DROP USER MAPPING

DROP VIEW

NameDROP VIEW -- remove a view Synopsis DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] Description DROP VIEW drops an existing view. To execute this command you must be the owner of the view. Parameters IF EXISTS Do not throw an error if the view does not exist. A notice is issued in this case. name The name (optionally schema-qualified) of the view to remove. CASCADE Automatically drop objects that depend on the view (such as other views), and in turn all object

2. Architectural Fundamentals

Before we proceed, you should understand the basic PostgreSQL system architecture. Understanding how the parts of PostgreSQL interact will make this chapter somewhat clearer. In database jargon, PostgreSQL uses a client/server model. A PostgreSQL session consists of the following cooperating processes (programs): A server process, which manages the database files, accepts connections to the database from client applications, and performs database actions on behalf of the clients. The database

1. Introduction

In the previous chapter we have covered the basics of using SQL to store and access your data in PostgreSQL. We will now discuss some more advanced features of SQL that simplify management and prevent loss or corruption of your data. Finally, we will look at some PostgreSQL extensions. This chapter will on occasion refer to examples found in Chapter 2 to change or improve them, so it will be useful to have read that chapter. Some examples from this chapter can also be found in advanced.sql in t

ALTER TRIGGER

NameALTER TRIGGER -- change the definition of a trigger Synopsis ALTER TRIGGER name ON table_name RENAME TO new_name ALTER TRIGGER name ON table_name DEPENDS ON EXTENSION extension_name Description ALTER TRIGGER changes properties of an existing trigger. The RENAME clause changes the name of the given trigger without otherwise changing the trigger definition. The DEPENDS ON EXTENSION clause marks the trigger as dependent on an extension, such that if the extension is dropped, the trig

DROP FUNCTION

NameDROP FUNCTION -- remove a function Synopsis DROP FUNCTION [ IF EXISTS ] name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) [ CASCADE | RESTRICT ] Description DROP FUNCTION removes the definition of an existing function. To execute this command the user must be the owner of the function. The argument types to the function must be specified, since several different functions can exist with the same name and different argument lists. Parameters IF EXISTS Do not throw an er

ALTER DEFAULT PRIVILEGES

NameALTER DEFAULT PRIVILEGES -- define default access privileges Synopsis ALTER DEFAULT PRIVILEGES [ FOR { ROLE | USER } target_role [, ...] ] [ IN SCHEMA schema_name [, ...] ] abbreviated_grant_or_revoke where abbreviated_grant_or_revoke is one of: GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER } [, ...] | ALL [ PRIVILEGES ] } ON TABLES TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ] GRANT { { USAGE | SELECT | UP

Bit String Types

Bit strings are strings of 1's and 0's. They can be used to store or visualize bit masks. There are two SQL bit types: bit(n) and bit varying(n), where n is a positive integer. bit type data must match the length n exactly; it is an error to attempt to store shorter or longer bit strings. bit varying data is of variable length up to the maximum length n; longer strings will be rejected. Writing bit without a length is equivalent to bit(1), while bit varying without a length specification means

Catalogs: pg_operator

The catalog pg_operator stores information about operators. See CREATE OPERATOR and Section 36.12 for more information. Table 50-34. pg_operator Columns Name Type References Description oid oid Row identifier (hidden attribute; must be explicitly selected) oprname name Name of the operator oprnamespace oid pg_namespace.oid The OID of the namespace that contains this operator oprowner oid pg_authid.oid Owner of the operator oprkind char b = infix ("both"), l = prefix ("left"), r = postf

Catalogs: pg_auth_members

The catalog pg_auth_members shows the membership relations between roles. Any non-circular set of relationships is allowed. Because user identities are cluster-wide, pg_auth_members is shared across all databases of a cluster: there is only one copy of pg_auth_members per cluster, not one per database. Table 50-9. pg_auth_members Columns Name Type References Description roleid oid pg_authid.oid ID of a role that has a member member oid pg_authid.oid ID of a role that is a member of roleid gr