· 8 years ago · Jun 18, 2018, 05:54 AM
1DROP DATABASE IF EXISTS tablewriter_tuple_test;
2
3CREATE DATABASE tablewriter_tuple_test
4 TEMPLATE template0
5 OWNER postgres
6 ENCODING 'UTF8'
7 LC_COLLATE 'C'
8;
9
10\c tablewriter_tuple_test
11
12BEGIN;
13
14 CREATE SCHEMA test_schema
15 AUTHORIZATION postgres
16 ;
17
18 CREATE TABLE test_schema.test_table
19 (
20 -- nonnull
21 id SERIAL NOT NULL,
22 text_field TEXT NOT NULL,
23 int_field INTEGER NOT NULL,
24
25 -- nullable
26 inet_field INET NULL,
27 num_field NUMERIC NULL,
28 binary_field BYTEA NULL -- not sure if this will work currently
29 )
30 ;
31
32COMMIT;
33
34\d test_schema.test_table
35SELECT * FROM test_schema.test_table;