-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathschemas.sql
More file actions
78 lines (54 loc) · 1.44 KB
/
schemas.sql
File metadata and controls
78 lines (54 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
-- create_schema
create schema myschema;
create schema s authorization foo;
create schema s authorization current_role;
create schema s authorization current_user;
create schema s authorization session_user;
create schema authorization foo;
create schema if not exists s;
create schema if not exists s authorization bar;
create schema if not exists authorization bar;
create schema s
create table t (a int, b text)
create table t1 (z int8);
table schema.table;
table database.schema.table;
drop schema myschema;
drop schema myschema cascade;
drop schema if exists myschema restrict;
drop schema if exists a, b, c;
create schema schema_name authorization user_name;
-- create_schema_with_sequence
create schema s
create sequence s;
-- create_schema_with_trigger
create schema s
create trigger t after insert
on u
execute function f();
-- search_path
show search_path;
set search_path to myschema,public;
set search_path to myschema;
set foo = bar;
set schema 'foo';
set xml option document;
set xml option content;
set role foo;
set time zone 'America/Los_Angeles';
set time zone default;
set time zone local;
set foo from current;
set foo.bar from current;
set foo = default;
set foo to a, 10.0, 1, 'foo', true, false;
set foo to default;
-- operator
-- binary
select 3 operator(pg_catalog.+) 4;
select 3 operator(+) 4;
select 1 operator(a.&&) 2;
-- unary
select operator(pg_catalog.-) 4;
select operator(-) 4;
select operator(a.b.-) 4;