Thread: Does Postgres support BLOB datatypes?
Hey All, I just migrated a MySQL database to Postgres. I used the mysql2pgsql application to convert my MySQL data into Postgres-friendly data. The BLOB data I had in the MySQL database converted into the text datatype for postgres. I'd like to know if Postgres supports BLOBs and if not, what datatype should I use in place of BLOBs? Thanks for any help, Peter
Hello, Yes PostgreSQL supports BLOBS. You are looking for \loimport within psql client. J On Tue, 8 Jan 2002, Peter E. Chen wrote: > Hey All, > > I just migrated a MySQL database to Postgres. I used the mysql2pgsql > application to convert my MySQL data into Postgres-friendly data. The BLOB > data I had in the MySQL database converted into the text datatype for > postgres. I'd like to know if Postgres supports BLOBs and if not, what > datatype should I use in place of BLOBs? > > Thanks for any help, > Peter > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > -- -- by way of pgsql-general@commandprompt.com http://www.postgresql.info/ http://www.commandprompt.com/
A quote from the mysql.com docs: "The only difference between BLOB and TEXT types is that sorting and comparison is performed in case-sensitive fashion for BLOB values and case-insensitive fashion for TEXT values. In other words, a TEXT is a case-insensitive BLOB." If I understand you correctly, you need a large space to store either binary data or text. PostgreSQL offers BYTEA and TEXT types. BYTEA is NULL-safe, so I would reccommend it if you actually have binary data. If you're just storing text, you can use the TEXT type which has no upper limit on size. Regards, Jeff On Tuesday 08 January 2002 08:25 am, you wrote: > Hey All, > > I just migrated a MySQL database to Postgres. I used the mysql2pgsql > application to convert my MySQL data into Postgres-friendly data. The BLOB > data I had in the MySQL database converted into the text datatype for > postgres. I'd like to know if Postgres supports BLOBs and if not, what > datatype should I use in place of BLOBs? > > Thanks for any help, > Peter > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly
On Tue, 8 Jan 2002, Peter E. Chen wrote: > I just migrated a MySQL database to Postgres. I used the mysql2pgsql > application to convert my MySQL data into Postgres-friendly data. The BLOB > data I had in the MySQL database converted into the text datatype for > postgres. I'd like to know if Postgres supports BLOBs and if not, what > datatype should I use in place of BLOBs? If it's a BLOB of text, the use text. If it's binary data, you can either use bytea - or PG's LO (Large Object) interface... -- Dominic J. Eidson "Baruk Khazad! Khazad ai-menu!" - Gimli ------------------------------------------------------------------------------- http://www.the-infinite.org/ http://www.the-infinite.org/~dominic/
Jeff Davis wrote: > A quote from the mysql.com docs: > > "The only difference between BLOB and TEXT types is that sorting and > comparison is performed in case-sensitive fashion for BLOB values and > case-insensitive fashion for TEXT values. In other words, a TEXT is a > case-insensitive BLOB." We do not have case-sensitive distinctions. We are always case-sensitive unless you use a case-insisitive operator or a function call. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026