]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - sample/dist_def_pgbench.sql
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / sample / dist_def_pgbench.sql
1 -- $Header: /cvsroot/pgpool/pgpool-II/sample/dist_def_pgbench.sql,v 1.1.1.1 2006/09/08 03:36:17 t-ishii Exp $
2
3 INSERT INTO pgpool_catalog.dist_def VALUES (
4     'bench_parallel',
5     'public',
6     'branches',
7     'bid',
8     ARRAY['bid', 'bbalance', 'filler'],
9     ARRAY['integer', 'integer', 'character(88)'],
10     'pgpool_catalog.dist_def_branches'
11 );
12
13 INSERT INTO pgpool_catalog.dist_def VALUES (
14     'bench_parallel',
15     'public',
16     'tellers',
17     'tid',
18     ARRAY['tid', 'bid', 'tbalance', 'filler'],
19     ARRAY['integer', 'integer', 'integer', 'character(84)'],
20     'pgpool_catalog.dist_def_tellers'
21 );
22
23 INSERT INTO pgpool_catalog.dist_def VALUES (
24     'bench_parallel',
25     'public',
26     'accounts',
27     'aid',
28     ARRAY['aid', 'bid', 'abalance', 'filler'],
29     ARRAY['integer', 'integer', 'integer', 'character(84)'],
30     'pgpool_catalog.dist_def_accounts'
31 );
32
33 INSERT INTO pgpool_catalog.dist_def VALUES (
34     'bench_parallel',
35     'public',
36     'history',
37     'tid',
38     ARRAY['tid', 'bid', 'aid', 'delta', 'mtime', 'filler'],
39     ARRAY['integer', 'integer', 'integer', 'integer', 'timestamp without time zone', 'character(22)'],
40     'pgpool_catalog.dist_def_history'
41 );
42
43 CREATE OR REPLACE FUNCTION pgpool_catalog.dist_def_branches(anyelement)
44 RETURNS integer AS $$
45     SELECT CASE WHEN $1 > 0 AND $1 <= 1 THEN 0
46         WHEN $1 > 1 AND $1 <= 2 THEN 1
47         ELSE 2
48     END;
49 $$ LANGUAGE sql;
50
51 CREATE OR REPLACE FUNCTION pgpool_catalog.dist_def_tellers(anyelement)
52 RETURNS integer AS $$
53     SELECT CASE WHEN $1 > 0 AND $1 <= 10 THEN 0
54         WHEN $1 > 10 AND $1 <= 20 THEN 1
55         ELSE 2
56     END;
57 $$ LANGUAGE sql;
58
59 CREATE OR REPLACE FUNCTION pgpool_catalog.dist_def_accounts(anyelement)
60 RETURNS integer AS $$
61     SELECT CASE WHEN $1 > 0 AND $1 <= 100000 THEN 0
62         WHEN $1 > 100000 AND $1 <= 200000 THEN 1
63         ELSE 2
64     END;
65 $$ LANGUAGE sql;
66
67 CREATE OR REPLACE FUNCTION pgpool_catalog.dist_def_history(anyelement)
68 RETURNS integer AS $$
69     SELECT CASE WHEN $1 > 0 AND $1 <= 10 THEN 0
70         WHEN $1 > 10 AND $1 <= 20 THEN 1
71         ELSE 2
72     END;
73 $$ LANGUAGE sql;