File: [pgFoundry] / uint / uint / sql / copy.sql.in (download)
Revision 1.1, Mon Sep 29 04:54:00 2008 UTC (23 months ago) by rbrad
Branch: MAIN
CVS Tags: HEAD
Initial checking for the unsigned integer data type.
|
-- Create table.
CREATE TABLE uint_copy_test (
col1 uint4 NOT NULL,
col2 uint2 NOT NULL,
col3 uint1 NOT NULL
) WITHOUT OIDS;
-- Load copy (text) data.
COPY uint_copy_test FROM '@abs_builddir@/data/copy_text.data';
-- Verify copy (text) data.
SELECT col3, col2, col1
FROM uint_copy_test
ORDER BY col1;
-- Save the copy data to binary.
COPY uint_copy_test TO '@abs_builddir@/data/copy_binary.data' WITH BINARY;
-- Remove rows.
TRUNCATE uint_copy_test;
-- Load copy (binary) data.
COPY uint_copy_test FROM '@abs_builddir@/data/copy_binary.data' WITH BINARY;
-- Verify copy (binary) data.
SELECT col3, col2, col1
FROM uint_copy_test
ORDER BY col1;