citus/expected/am_load.out

43 lines
1.7 KiB
Plaintext

--
-- Test loading data into cstore_fdw tables.
--
-- COPY with incorrect delimiter
COPY contestant FROM '/Users/jefdavi/wd/cstore2/data/contestants.1.csv'
WITH DELIMITER '|'; -- ERROR
ERROR: missing data for column "birthdate"
CONTEXT: COPY contestant, line 1: "a,1990-01-10,2090,97.1,XA ,{a}"
-- COPY with invalid program
COPY contestant FROM PROGRAM 'invalid_program' WITH CSV; -- ERROR
ERROR: program "invalid_program" failed
DETAIL: command not found
-- COPY into uncompressed table from file
COPY contestant FROM '/Users/jefdavi/wd/cstore2/data/contestants.1.csv' WITH CSV;
-- COPY into uncompressed table from program
COPY contestant FROM PROGRAM 'cat /Users/jefdavi/wd/cstore2/data/contestants.2.csv' WITH CSV;
-- COPY into compressed table
set cstore.compression = 'pglz';
COPY contestant_compressed FROM '/Users/jefdavi/wd/cstore2/data/contestants.1.csv' WITH CSV;
-- COPY into uncompressed table from program
COPY contestant_compressed FROM PROGRAM 'cat /Users/jefdavi/wd/cstore2/data/contestants.2.csv'
WITH CSV;
set cstore.compression to default;
-- Test column list
CREATE TABLE famous_constants (id int, name text, value real)
USING cstore_tableam;
COPY famous_constants (value, name, id) FROM STDIN WITH CSV;
COPY famous_constants (name, value) FROM STDIN WITH CSV;
SELECT * FROM famous_constants ORDER BY id, name;
id | name | value
----+----------------+-----------
1 | pi | 3.141
2 | e | 2.718
3 | gamma | 0.577
4 | bohr radius | 5.291e-11
| avagadro | 6.022e+23
| electron mass | 9.109e-31
| proton mass | 1.672e-27
| speed of light | 2.997e+08
(8 rows)
DROP TABLE famous_constants;