From: | David Kitzinger ARA/SWD <David(dot)Kitzinger(at)ara(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | binary bytea |
Date: | 2004-04-07 22:45:05 |
Message-ID: | 5.2.1.1.0.20040407163729.025e61e8@wanmail.ara.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
I'm confused. I have a bytea column that should be binary format (right?), yet PQfformat() says it is NOT binary (I did an insert as such: INSERT INTO tablename values (..., '\\001\\002\\000'); ). I also tried: INSERT INTO tablename values (..., '\\001\\002\\000'::bytea); .
Furthermore, my client code receives via PQgetvalue() a backslashed octet string which needs to be converted back into binary data via PQunescapeBytea() to get the binary contents, yet the documentation under PQunescapeBytea() (section 27.3.2) says its not needed when receiving binary data (implying there is a way to get binary data). How do I get/request binary data instead of text strings. My client code is connecting via TCP/IP if that makes a difference. I also noted in the documentation some sample client code that converted an int4 column to binary via: ntohl() also implying it was in binary format to begin with.
What's the secret? I would love to deal directly with binary data to avoid repetitious conversions to/from strings.
Thanks in advance for any advise!
--David Kitzinger
From | Date | Subject | |
---|---|---|---|
Next Message | David Rickard | 2004-04-07 23:28:32 | pg_dump filling up root directory |
Previous Message | Nabil Sayegh | 2004-04-07 22:13:19 | Re: Help with Select Statement |