Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B56412E0069 for ; Tue, 25 Mar 2008 15:27:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 27442-03-3 for ; Tue, 25 Mar 2008 15:27:14 -0300 (ADT) X-Greylist: delayed 00:07:39.864073 by SQLgrey-1.7.5 Received: from smtpauth15.mail.atl.earthlink.net (smtpauth15.mail.atl.earthlink.net [209.86.89.75]) by postgresql.org (Postfix) with ESMTP id 832432E008B for ; Tue, 25 Mar 2008 15:27:14 -0300 (ADT) Received: from [12.191.89.68] (helo=normanm90) by smtpauth15.mail.atl.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1JeDkD-0000Yr-8J for pgsql-sql@postgresql.org; Tue, 25 Mar 2008 14:19:33 -0400 Message-ID: <004d01c88ea4$cc9e0d30$820b010a@normanm90> From: "Jon Norman" To: Subject: copy command and array of composite types? Date: Tue, 25 Mar 2008 13:19:41 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004A_01C88E7A.E2A2BF10" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-ELNK-Trace: d43b1c40e4339a3a946d4f1007b05511e9c7218ab0f5e41d5f98d146dfdcfebd2e795d201fd677cefb54eacf4b01f354350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 12.191.89.68 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200803/168 X-Sequence-Number: 30496 This is a multi-part message in MIME format. ------=_NextPart_000_004A_01C88E7A.E2A2BF10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm using PostgreSQL 8.3.1. I've created the following composite type: CREATE TYPE expression_event_type AS ( event_id varchar(10), expr_indices smallint[] ); which is used with the following table definition: CREATE TABLE boolean_expr_table( expr_id smallint PRIMARY KEY, expr_name varchar(100) NOT NULL, expression varchar(256) NOT NULL, event_indices expression_event_type[] NOT NULL, true_cases smallint[] NOT NULL ); Question: What is the correct way to load the event_indices column using = the copy command and a external file? I've tried: {(1,{1,2,3})} without success. ------=_NextPart_000_004A_01C88E7A.E2A2BF10 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm using PostgreSQL = 8.3.1.
 
I've created the following composite=20 type:
 
CREATE TYPE expression_event_type AS = (
event_id=20 varchar(10),
expr_indices smallint[]
);
 
which is used with the following table=20 definition:
 
CREATE TABLE = boolean_expr_table(
expr_id=20 smallint PRIMARY KEY,
expr_name varchar(100) NOT NULL,
expression=20 varchar(256) NOT NULL,
event_indices expression_event_type[] NOT=20 NULL,
true_cases smallint[] NOT NULL
);
 
Question: What is the correct way to = load the=20 event_indices column using the copy command and a external = file?
 
I've tried: {(1,{1,2,3})} without=20 success. 
------=_NextPart_000_004A_01C88E7A.E2A2BF10--