pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How To Get Bytea Data Instead Of Its Oid
2+ messages / 2 participants
[nested] [flat]

* How To Get Bytea Data Instead Of Its Oid
@ 2002-09-19 14:11 CN LIOU <cnliou@graffiti.net>
  2002-09-19 16:46 ` Re: How To Get Bytea Data Instead Of Its Oid Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: CN LIOU @ 2002-09-19 14:11 UTC (permalink / raw)
  To: pgsql-sql

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 back the 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How To Get Bytea Data Instead Of Its Oid
  2002-09-19 14:11 How To Get Bytea Data Instead Of Its Oid CN LIOU <cnliou@graffiti.net>
@ 2002-09-19 16:46 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2002-09-19 16:46 UTC (permalink / raw)
  To: CN LIOU <cnliou@graffiti.net>; +Cc: pgsql-sql

"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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-09-19 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-19 14:11 How To Get Bytea Data Instead Of Its Oid CN LIOU <cnliou@graffiti.net>
2002-09-19 16:46 ` Tom Lane <tgl@sss.pgh.pa.us>

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