2013-03-25 12:26:23 +04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
PATH='/usr/bin:/bin'
|
|
|
|
|
|
|
|
create0='
|
|
|
|
CREATE TABLE TEST.test_table0 (
|
2013-03-27 12:49:10 +04:00
|
|
|
foo smallint NOT NULL,
|
|
|
|
foo_bar integer NOT NULL,
|
2013-03-29 16:19:50 +04:00
|
|
|
par_ent integer NOT NULL,
|
2013-03-27 12:49:10 +04:00
|
|
|
bar date,
|
|
|
|
bar_baz text,
|
|
|
|
baz VARCHAR(10),
|
2013-03-25 12:26:23 +04:00
|
|
|
|
2013-03-27 12:49:10 +04:00
|
|
|
PRIMARY KEY(foo_bar)
|
2013-03-25 12:26:23 +04:00
|
|
|
)
|
|
|
|
'
|
|
|
|
|
2013-04-22 05:06:52 +04:00
|
|
|
create1='
|
|
|
|
CREATE TABLE TEST.test_table1 (
|
|
|
|
foo integer NOT NULL,
|
|
|
|
|
|
|
|
PRIMARY KEY (foo)
|
|
|
|
)
|
|
|
|
'
|
|
|
|
|
2013-03-25 12:26:23 +04:00
|
|
|
set -x
|
|
|
|
|
|
|
|
psql -c "CREATE SCHEMA TEST" testdb
|
|
|
|
psql -c "$create0" testdb
|
2013-04-22 05:06:52 +04:00
|
|
|
psql -c "$create1" testdb
|
2013-03-25 12:26:23 +04:00
|
|
|
|
2013-04-22 05:06:52 +04:00
|
|
|
psql -c "INSERT INTO TEST.test_table1 (foo) VALUES (1)" testdb
|