ALTER GROUP staff ADD USER karl, john
- Remove a user from a group
+ Remove a user from a group:
ALTER GROUP workers DROP USER beth
DROP TABLE distributors;
CREATE TABLE distributors (
did DECIMAL(3) DEFAULT 1,
- name VARCHAR(40) NOT NULL,
+ name VARCHAR(40) NOT NULL
);
INSERT INTO distributors SELECT * FROM temp;
DROP TABLE temp;
ALTER USER davide WITH PASSWORD 'hu8jmn3';
- Change a user's valid until date
+ Change a user's valid until date:
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
Change a user's valid until date, specifying that his
authorisation should expire at midday on 4th May 1998 using
- the time zone which is one hour ahead of UTC
+ the time zone which is one hour ahead of UTC:
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
- Give a user the ability to create other users and new databases.
+ Give a user the ability to create other users and new databases:
ALTER USER miriam CREATEUSER CREATEDB;
Usage
- Cluster the employees relation on the basis of its salary attribute
+ Cluster the employees relation on the basis of its salary attribute:
CLUSTER emp_ind ON emp;
The following example copies a table to standard output,
- using a vertical bar ("|") as the field
+ using a pipe (|) as the field
delimiter:
find a type conversion function automatically, the sql function has
to have the same name as the return type, and overloading is
unavoidable. The function name is overloaded by using the second
- form of the AS clause in the SQL definition
+ form of the AS clause in the SQL definition:
CREATE FUNCTION point(complex) RETURNS point
report an error because the query cycled too many times:
-
Example of a circular rewrite rule combination.
+
Example of a circular rewrite rule combination:
CREATE RULE bad_rule_combination_1 AS
ON SELECT TO emp
This attempt to select from EMP will cause
Postgres to issue an error
- because the queries cycled too many times.
+ because the queries cycled too many times:
SELECT * FROM emp;
- As of Postgres version 6.0, consistent array dimensions within an
+ Consistent array dimensions within an
attribute are not enforced. This will likely change in a future
release.
SQL92 allows absolute positioning of the cursor for
- FETCH, and allows placing the results into explicit variables.
+ FETCH, and allows placing the results into explicit variables:
FETCH ABSOLUTE #
- Do
+ Do:
$ make install
Change word "Drama" with "Dramatic" on column kind:
-UPDATE films SET kind = 'Dramatic' WHERE kind = 'Drama';
-SELECT * FROM films WHERE kind = 'Dramatic' OR kind = 'Drama';
+UPDATE films
+SET kind = 'Dramatic'
+WHERE kind = 'Drama';
+SELECT *
+FROM films
+WHERE kind = 'Dramatic' OR kind = 'Drama';
code | title | did | date_prod | kind | len
-------+---------------+-----+------------+----------+-------