Re: Help : insert a bytea data into new table - Mailing list pgsql-sql

From dennis
Subject Re: Help : insert a bytea data into new table
Date
Msg-id hn4ub5$n7f$1@news.hub.org
Whole thread Raw
In response to Re: Help : insert a bytea data into new table  (Ben Morrow <ben@morrow.me.uk>)
List pgsql-sql
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
> 
> 


pgsql-sql by date:

Previous
From: John Dizaro
Date:
Subject: I, nead to capture the IP number from the PC how is running the script ...
Next
From: "Dan McFadyen"
Date:
Subject: Odd query behavior