Обсуждение: How To Get Bytea Data Instead Of Its Oid

Поиск
Список
Период
Сортировка

How To Get Bytea Data Instead Of Its Oid

От
"CN LIOU"
Дата:
Greetings!

I must have missed lesson 1 of postgresql!

create table test (c1 text,c2 bytea);

Then, I probably have successfullyi nserted several records into test using C++Builder. Now I am trying to retrieve
backthe binary data in c2 I just inserted. However, the SQL statement issued by both C++Builder and psql:
 

SELECT * FROM test LIMIT 1

returns, I guess, the OID of c2 instead of the binary data to which the OID points. 

What is the correct SQL syntax for C++Builder for bytea?

Regards,
-- 
_______________________________________________
Get your free email from http://www.graffiti.net

Powered by Outblaze


Re: How To Get Bytea Data Instead Of Its Oid

От
Tom Lane
Дата:
"CN LIOU" <cnliou@graffiti.net> writes:
> SELECT * FROM test LIMIT 1
> returns, I guess, the OID of c2 instead of the binary data to which the OID points. 

I don't think so...

regression=# create table test (c1 text,c2 bytea);
CREATE TABLE
regression=# insert into test values ('some text', 'some binary data \\000\\001');
INSERT 284058 1
regression=# select * from test;   c1     |            c2
-----------+---------------------------some text | some binary data \000\001
(1 row)

I see no OID here.

Perhaps you should show us an example of what you are doing, rather than
your interpretation of what's going wrong.
        regards, tom lane