1ALTER TYPE()                     SQL Commands                     ALTER TYPE()
2
3
4

NAME

6       ALTER TYPE - change the definition of a type
7
8

SYNOPSIS

10       ALTER TYPE name OWNER TO new_owner
11       ALTER TYPE name SET SCHEMA new_schema
12
13
14

DESCRIPTION

16       ALTER  TYPE  changes the definition of an existing type.  The only cur‐
17       rently available capabilities are changing the owner and  schema  of  a
18       type.
19
20       You  must  own  the  type to use ALTER TYPE.  To change the schema of a
21       type, you must also have CREATE privilege on the new schema.  To  alter
22       the owner, you must also be a direct or indirect member of the new own‐
23       ing role, and that role  must  have  CREATE  privilege  on  the  type's
24       schema.  (These restrictions enforce that altering the owner doesn't do
25       anything you couldn't do by dropping and recreating the type.  However,
26       a superuser can alter ownership of any type anyway.)
27

PARAMETERS

29       name   The  name  (possibly  schema-qualified)  of  an existing type to
30              alter.
31
32       new_owner
33              The user name of the new owner of the type.
34
35       new_schema
36              The new schema for the type.
37

EXAMPLES

39       To change the owner of the user-defined type email to joe:
40
41       ALTER TYPE email OWNER TO joe;
42
43
44
45       To change the schema of the user-defined type email to customers:
46
47       ALTER TYPE email SET SCHEMA customers;
48
49
50

COMPATIBILITY

52       There is no ALTER TYPE statement in the SQL standard.
53
54
55
56SQL - Language Statements         2008-06-08                      ALTER TYPE()
Impressum