I'm in the process of finishing a native Protocol 3 PostgreSQL driver
written in Pike.
And while trying to make it make intelligent decisions regarding binary
or text encoding of different columns and parameters, I run into the
OIDs of types.

In looking through the specs, I decided that the following OIDtypes will
be (automatically) binary passed (both as results and as parameters),
all others will be passed as text:

    case 16:   // _bool
    case 17:   // _bytea
    case 18:   // _char
    case 20:   // _int8
    case 21:   // _int2
    case 23:   // _int4
    case 25:   // _text
    case 142:  // _xml
    case 829:  // _macaddr
    case 869:  // _inet
    case 1042: // _bpchar
    case 1043: // _varchar
    case 1700: // _numeric
    case 2950: // _uuid

How large is the probability of these numbers ever changing?
Should I extract them from a query at the beginning of the connection?
Or can I leave them hardcoded in the driver?
-- 
Sincerely,
           Stephen R. van den Berg.

A truly wise man never plays leapfrog with a unicorn.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to