blob: 36e9a925ecf3ab69fba1fc7468faa5519d74354b [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
CREATE TABLE foo (col1 INT,
col2 LONG,
col3 DOUBLE,
col4 FLOAT,
col5 CHAR(5));
CREATE TABLE foo2 (col1 INT,
col2 LONG,
col3 DOUBLE,
col4 FLOAT,
averyverylongcolumnnamefortest CHAR(5));
CREATE TABLE foo3 (col1 INT,
col2 LONG,
col3 DOUBLE,
col4 FLOAT,
col5 CHAR(5));
CREATE INDEX foo3_index_1 ON foo3 (col1) USING CSBTREE;
CREATE TABLE foo4 (col1 INT,
col2 LONG,
col3 DOUBLE,
col4 FLOAT,
col5 CHAR(5));
CREATE INDEX foo4_index_1 ON foo4 (col1, col2) USING CSBTREE;
CREATE INDEX foo4_index_2 ON foo4 (col3, col4) USING CSBTREE;
CREATE TABLE foo_hash_part (col1 INT,
col2 FLOAT)
PARTITION BY HASH(col1) PARTITIONS 4;
INSERT INTO foo_hash_part
SELECT i, i * 3.0 FROM generate_series(1, 100) AS gs(i);
CREATE TABLE averylongtablenamethatseemstoneverend (col1 INT);
DROP TABLE TEST;
INSERT INTO averylongtablenamethatseemstoneverend VALUES (1);
INSERT INTO averylongtablenamethatseemstoneverend VALUES (2);
INSERT INTO averylongtablenamethatseemstoneverend VALUES (3);
INSERT INTO foo values(1, 1, 1.0, 1.0, 'XYZ');
INSERT INTO foo values(2, 1, 1.0, 1.0, 'XYZ');
INSERT INTO foo values(3, 1, 1.0, 1.0, 'XYZ');
INSERT INTO foo values(4, 1, 1.0, 1.0, 'XYZ');
INSERT INTO foo values(5, 1, 1.0, 1.0, 'XYZ');
INSERT INTO foo2 values(5, 1, 1.0, 1.0, 'XYZ');
INSERT INTO foo2 values(5, 1, 1.0, 1.0, 'XYZ');
INSERT INTO foo3 values(5, 1, 1.0, 1.0, 'XYZZ');
--
==
\d foo
--
Table "foo"
Column | Type
+-------+--------+
col1 | Int
col2 | Long
col3 | Double
col4 | Float
col5 | Char(5)
==
\d foo2
--
Table "foo2"
Column | Type
+-------------------------------+--------+
col1 | Int
col2 | Long
col3 | Double
col4 | Float
averyverylongcolumnnamefortest | Char(5)
==
\d foo3
--
Table "foo3"
Column | Type
+-------+--------+
col1 | Int
col2 | Long
col3 | Double
col4 | Float
col5 | Char(5)
Indexes
"foo3_index_1" CSB_TREE (col1)
==
\d foo4
--
Table "foo4"
Column | Type
+-------+--------+
col1 | Int
col2 | Long
col3 | Double
col4 | Float
col5 | Char(5)
Indexes
"foo4_index_2" CSB_TREE (col3, col4)
"foo4_index_1" CSB_TREE (col1, col2)
==
\d foo_hash_part
--
Table "foo_hash_part"
Column | Type
+-------+-------+
col1 | Int
col2 | Float
Partition Info
PARTITION BY HASH ( col1 ) PARTITIONS 4
| 1 | 1 | 1 | 1 |
==
\d
--
List of relations
Name | Type | Blocks
+--------------------------------------+-------+---------+
foo | table | 1
foo2 | table | 1
foo3 | table | 1
foo4 | table | 0
foo_hash_part | table | 4
averylongtablenamethatseemstoneverend | table | 1
==
\d invalidtable
--
ERROR: Unrecognized relation invalidtable (1 : 4)
\d invalidtable
^