Skip site navigation (1) Skip section navigation (2)

Toast, Text, blob bytea Huh?

From: jason(dot)ory(at)ndchealth(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Toast, Text, blob bytea Huh?
Date: 2001-08-23 17:47:01
Message-ID: 758E226E2CFDD211961C0060080752308C155A@exchanger.ndcorp.com (view raw or flat)
Thread:
Lists: pgsql-hackers
I'm trying my best to convert from MySQL to PgSQL but I cant get a good
clear answer about 
certian issures.Mainly  TEXT, TOAST,BLOB , BYTEA etc.
It was an easy task in mysql but everything in the archives about , text ,
toast and bytea is just
confusing me with postgresql. I have Bruces's book and I've searched the
archives years back with all the right keywords with not luck.Here is my
situation-->


WHAT I WAS DOING IN MYSQL
Via the web my clients are uploading basic  text/data files, sometimes >
than 30MB. In the past ,via CGI I have been parsing the file
into one STL string, using mysql_escape_string to escape it and then using
an INSERT  to place the 
   ,\'+"stlstring+"\' ,    into a BLOB column. 
"dont want to use a temp. file or files in general anywhere. The data will
always be passed via the database and buffers for certian reasons."Thus no
OID's


THIS IS WHAT I CANT SEEM TO FIGURE OUT IN POSTGRESQL
1. I cant get a clear answer on what kind of data type to use for my large
text string?  TEXT, ???, ??? or something about TOAST
I have seen in the e-mail archive but cant find any documentaion?

2. I've written my own escape method ,("cant find one for Pgsql") , BUT i
don't know what 
to escape and not to escape. So it keeps failing. I cand find any docs. on
what to escape either?


SUMMARY
What is the best datatype to use, for large raw text and/or  binary if i
choose? 
Once I know this,how Im a supposed to escape my string and get it through
the parser correctly so i can retrieve it correctly?

Thanks for your time.

PS: Using RedHat.



Jason H. Ory
Medprint+
Software Developer
jason(dot)ory(at)ndchealth(dot)com


Responses

pgsql-hackers by date

Next:From: Christopher MastoDate: 2001-08-23 18:09:24
Subject: Re: Escaping strings for inclusion into SQL queries
Previous:From: Ned WolpertDate: 2001-08-23 17:42:35
Subject: New backend functions? [was Re: JDBC changes for 7.2... some questions...]

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group