From: | dennis <dennis(at)teltel(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Help : insert a bytea data into new table |
Date: | 2010-03-09 07:45:42 |
Message-ID: | hn4ub5$n7f$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)teltel(dot)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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Ben Morrow | 2010-03-09 11:14:10 | Re: Help : insert a bytea data into new table |
Previous Message | Ben Morrow | 2010-03-09 03:46:26 | Re: Help : insert a bytea data into new table |