Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2930E635AF1 for ; Tue, 9 Mar 2010 03:55:59 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 33151-09 for ; Tue, 9 Mar 2010 07:55:45 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 60DED635988 for ; Tue, 9 Mar 2010 03:55:42 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id o297tdl5027272 for ; Tue, 9 Mar 2010 03:55:39 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id o297jfYf023799 for pgsql-sql@postgresql.org; Tue, 9 Mar 2010 03:45:41 -0400 (AST) (envelope-from news) From: dennis X-Newsgroups: pgsql.sql Subject: Re: Help : insert a bytea data into new table Date: Tue, 09 Mar 2010 15:45:42 +0800 Organization: Hub.Org Networking Services Lines: 55 Message-ID: References: <20100309034626.GA12083@osiris.mauzo.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org User-Agent: Thunderbird 2.0.0.23 (X11/20090817) In-Reply-To: <20100309034626.GA12083@osiris.mauzo.dyndns.org> To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201003/82 X-Sequence-Number: 33789 here is example table name is "mail": column | type ------------------------- sender |char subject |char content |bytea I want copy some record into new table 'mail_new'. sql: create table mail_new as select * from mail sender='dennis' result has an error: operator does not exist: text || bytea But if my sql statement has no column "content" the sql works. sql: create table mail_new as select sender,subject from mail sender='dennis' Ben Morrow 提到: > Quoth dennis : >> I need to copy some data to new table. >> But I encounter some error message. >> the table structure >> Table A: >> c1 char >> c2 bytea >> >> Table B: >> c1 char >> c2 bytea >> >> >> My sql command: >> insert into B as select * from a where c1=xxx > > 'AS' isn't valid there. What is xxx? Is it a field you haven't shown us, > or is it a quoted string? > >> error: >> operator does not exist: text || bytea > > That command (with 'xxx' quoted and the AS removed) doesn't give that > error with those table definitions, so you will need to show us your > actual query. > > Ben > >