diff options
author | Asko Oja | 2009-05-04 14:02:39 +0000 |
---|---|---|
committer | Marko Kreen | 2009-06-01 07:49:44 +0000 |
commit | 9cbd16ab343c28c55012127a1cb643b793547416 (patch) | |
tree | 6a5b351db839396c8d6912d2a0eb90fe1c94d734 /scripts/table_dispatcher.py | |
parent | 16e20c4daccb4f0e95249d8fcfe32e89bae41882 (diff) |
python scripts: Move template config to docstring.
* Template config is now in docstring to make to more
easy to keep up-to-date.
* dbscript: --ini option to show template config.
Diffstat (limited to 'scripts/table_dispatcher.py')
-rwxr-xr-x | scripts/table_dispatcher.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/table_dispatcher.py b/scripts/table_dispatcher.py index 5b01370e..b4fd2d10 100755 --- a/scripts/table_dispatcher.py +++ b/scripts/table_dispatcher.py @@ -2,6 +2,37 @@ """It loads urlencoded rows for one trable from queue and inserts them into actual tables, with optional partitioning. + +--ini +[table_dispatcher] +job_name = test_move + +src_db = dbname=sourcedb_test +dst_db = dbname=dataminedb_test + +pgq_queue_name = OrderLog + +logfile = ~/log/%(job_name)s.log +pidfile = ~/pid/%(job_name)s.pid + +# where to put data. when partitioning, will be used as base name +dest_table = orders + +# date field with will be used for partitioning +# special value: _EVTIME - event creation time +part_column = start_date + +#fields = * +#fields = id, name +#fields = id:newid, name, bar:baz + + +# template used for creating partition tables +# _DEST_TABLE +part_template = + create table _DEST_TABLE () inherits (orders); + alter table only _DEST_TABLE add constraint _DEST_TABLE_pkey primary key (id); + grant select on _DEST_TABLE to group reporting; """ import sys, os, pgq, skytools |