From jnorman@alumni.utexas.net Tue Mar 25 18:27:25 2008 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-- From guy@incentre.net Tue Mar 25 20:37:48 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BBC662E003C for ; Tue, 25 Mar 2008 17:37:48 -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 71376-06 for ; Tue, 25 Mar 2008 17:37:41 -0300 (ADT) X-Greylist: delayed 00:26:14.544426 by SQLgrey-1.7.5 Received: from bach.incentre.net (bach.incentre.net [198.161.96.4]) by postgresql.org (Postfix) with ESMTP id 96A9D2E003B for ; Tue, 25 Mar 2008 17:37:40 -0300 (ADT) Received: from sigurd.incentre.net (sigurd.incentre.net [206.75.213.195]) by bach.incentre.net (8.12.9p2/8.12.9) with ESMTP id m2PKBtOH025310 for ; Tue, 25 Mar 2008 14:11:55 -0600 (MDT) (envelope-from guy@incentre.net) Message-Id: From: Guy Fraser To: PGSQL SQL In-Reply-To: <004d01c88ea4$cc9e0d30$820b010a@normanm90> Content-Type: multipart/alternative; boundary=Apple-Mail-1-535475389 Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: copy command and array of composite types? X-Priority: 3 Date: Tue, 25 Mar 2008 14:12:21 -0600 References: <004d01c88ea4$cc9e0d30$820b010a@normanm90> X-Mailer: Apple Mail (2.919.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/169 X-Sequence-Number: 30497 --Apple-Mail-1-535475389 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Try to export some data from the table using "copy from ..." to see what it looks like. On 2008-Mar-25, at 12:19, Jon Norman wrote: > 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. --Apple-Mail-1-535475389 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable

Try to export some data = from the table using "copy from ..." to see what it looks = like.

On 2008-Mar-25, at 12:19, Jon Norman = wrote:

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. 

= --Apple-Mail-1-535475389--