Re: libpq, PQExecParams and the inserting of binary data

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "David Hinkle" <drachs(at)gmail(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq, PQExecParams and the inserting of binary data
Date: 2005-06-03 19:20:00
Message-ID: 20050603211559.5392884@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

David Hinkle wrote:

> I will try this. Out of curiosity, where does the value of 17 for the
> OID field come from?

From the pg_type table:

template1=# select oid from pg_type where typname='bytea';
oid
-----
17
(1 row)

Alternatively, there's the server/catalog/pg_type.h include file
which has #defines for built-in datatypes:

$ grep BYTEA server/catalog/pg_type.h
#define BYTEAOID 17

--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Daniel Verite 2005-06-03 19:29:14 Re: libpq, PQExecParams and the inserting of binary data
Previous Message Tom Lane 2005-06-03 19:11:22 Re: libpq, PQExecParams and the inserting of binary data