pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dennis <dennis@teltel.com>
To: pgsql-sql@postgresql.org
Subject: Re: Help : insert a bytea data into new table
Date: Tue, 09 Mar 2010 15:45:42 +0800
Message-ID: <hn4ub5$n7f$1@news.hub.org> (raw)
In-Reply-To: <20100309034626.GA12083@osiris.mauzo.dyndns.org>
References: <hn49e1$2eob$1@news.hub.org>
	<20100309034626.GA12083@osiris.mauzo.dyndns.org>

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 <dennis@teltel.com>:
>>     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
> 
> 



view thread (9+ messages)  latest in thread

Message-ID: <hn4ub5$n7f$1@news.hub.org>
Permalink:  ../hn4ub5$n7f$1@news.hub.org/
Also on:    postgresql.org/message-id/hn4ub5$n7f$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dennis@teltel.com
  Subject: Re: Help : insert a bytea data into new table
  In-Reply-To: <hn4ub5$n7f$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox