Re: Best Type to use

From: Ketema Harris <ketema(at)gmail(dot)com>
To: Kevin Crenshaw <kcrenshaw(at)viscient(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Best Type to use
Date: 2006-01-05 20:27:24
Message-ID: 983b67500601051227s3581fe91o7cb497efc0b6faa7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ok, I'll consider that approach, but what about the binary types? Is there
a difference between them? lo, bytea, or oid? What are their strengths an
weaknesses, what exactly do they mean?

On 1/5/06, Kevin Crenshaw <kcrenshaw(at)viscient(dot)com> wrote:
>
> You can also use the TEXT data type. Just convert your binary data to
> base64 and write it to a field in your database like you would any other
> type of text. This method takes up more space than the other methods but
> it avoids some of the headaches of dealing with bytea.
>
>
>
> CREATE OR REPLACE FUNCTION SAVE_TCP_DUMP(TEXT) RETURNS VOID AS $$
>
> BEGIN
>
> INSERT INTO mytable(tcpdump) VALUES($1);
>
> END;
>
> $$ LANGUAGE 'plpgsql';
>
>
>
>
>
> HTH,
>
> Kevin
>
>
>
>
>
>
> ------------------------------
>
> *From:* pgsql-novice-owner(at)postgresql(dot)org [mailto:
> pgsql-novice-owner(at)postgresql(dot)org] *On Behalf Of *Ketema Harris
> *Sent:* Thursday, January 05, 2006 2:19 PM
> *To:* pgsql-novice(at)postgresql(dot)org
> *Subject:* [NOVICE] Best Type to use
>
>
>
> Hi, I would like to store binary data from a tcpdump (libpcap) file in a
> table. What is the best type to use? i have read posts saying lo, oid, and
> bytea. Which one would be best for this scenario? Depending on the type
> can a sample insert and select statement be given as well?
>
> Thanks,
>
> ketema
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andrew Chambers 2006-01-05 20:51:02 Re: sending N selects with begin and commit and get the result
Previous Message Jaime Casanova 2006-01-05 20:23:04 Re: index over boolean fields?