From: Billy G. A. <bal...@us...> - 2002-02-04 02:09:56
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv1981 Modified Files: pg_types.h libpqmodule.c libpqmodule.h Log Message: 03FEB2002 bga Added support for two missing OID types: aclitem and macaddr. Index: pg_types.h =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pg_types.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pg_types.h 2001/09/24 07:10:56 1.3 --- pg_types.h 2002/02/04 02:09:52 1.4 *************** *** 1,2 **** --- 1,30 ---- + #ident "@(#) $Id$" + #ifndef Pg_TYPES_H + #define Pg_TYPES_H + #ifdef __cplusplus + extern "C" { + #endif + + /***********************************************************************\ + | Copyright 2001 by Billy G. Allie | + | All rights Reserved. | + | | + | Permission to use, copy, modify, and distribute this software and its | + | documentation for any purpose and without fee is hereby granted, pro- | + | vided that the above copyright notice appear in all copies and that | + | both that copyright notice and this permission notice appear in sup- | + | porting documentation, and that the copyright owner's name not be | + | used in advertising or publicity pertaining to distribution of the | + | software without specific, written prior permission. | + | | + | THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | + | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | + | NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR | + | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | + | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE | + | OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE | + | USE OR PERFORMANCE OF THIS SOFTWARE. | + \***********************************************************************/ + /* Character String */ #define PG_TEXT 25 *************** *** 13,16 **** --- 41,45 ---- #define PG_INTEGER PG_INT4 #define PG_INT2 21 + #define PG_SMALLINT PG_INT2 #define PG_INT8 20 #define PG_BIGINT PG_INT8 *************** *** 52,55 **** --- 81,85 ---- /* Network */ + #define PG_MACADDR 829 #define PG_INET 869 #define PG_CIDR 650 *************** *** 64,65 **** --- 94,101 ---- #define PG_OIDVECTOR 30 #define PG_UNKNOWN 705 + #define PG_ACLITEM 1033 + + #ifdef __cplusplus + } + #endif + #endif /* !Pg_TYPES_H */ Index: libpqmodule.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/libpqmodule.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libpqmodule.c 2002/02/01 22:57:02 1.21 --- libpqmodule.c 2002/02/04 02:09:52 1.22 *************** *** 32,35 **** --- 32,37 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 03FEB2002 bga Added code to support the PG_ACLTIEM and PG_MACADDR oid | + | numbers [Bug #510244]. | | 21JAN2002 bga Applied patch by Chris Bainbridge [Patch #505941]. | | 13OCT2001 bga Added support for the pickling of libpq objects. In | *************** *** 727,730 **** --- 729,733 ---- { case PG_ABSTIME: desc = "abstime"; break; + case PG_ACLITEM: desc = "aclitem"; break; case PG_BLOB: desc = "blob"; break; case PG_BOOL: desc = "bool"; break; *************** *** 748,751 **** --- 751,755 ---- case PG_LINE: desc = "line" ; break; case PG_LSEG: desc = "lseg"; break; + case PG_MACADDR: desc = "macaddr"; break; case PG_NAME: desc = "name"; break; case PG_NUMERIC: desc = "numeric"; break; *************** *** 1070,1073 **** --- 1074,1079 ---- PyDict_SetItemString(d, "PG_ABSTIME", Py_BuildValue("i", PG_ABSTIME)); + PyDict_SetItemString(d, "PG_ACLITEM", Py_BuildValue("i", PG_ACLITEM)); + PyDict_SetItemString(d, "PG_BIGINT", Py_BuildValue("i", PG_INT8)); PyDict_SetItemString(d, "PG_BLOB", Py_BuildValue("i", PG_BLOB)); PyDict_SetItemString(d, "PG_BOOL", Py_BuildValue("i", PG_BOOL)); *************** *** 1075,1078 **** --- 1081,1085 ---- PyDict_SetItemString(d, "PG_BPCHAR", Py_BuildValue("i", PG_BPCHAR)); PyDict_SetItemString(d, "PG_BYTEA", Py_BuildValue("i", PG_BYTEA)); + PyDict_SetItemString(d, "PG_CASH", Py_BuildValue("i", PG_CASH)); PyDict_SetItemString(d, "PG_CHAR", Py_BuildValue("i", PG_CHAR)); PyDict_SetItemString(d, "PG_CID", Py_BuildValue("i", PG_CID)); *************** *** 1080,1083 **** --- 1087,1091 ---- PyDict_SetItemString(d, "PG_CIRCLE", Py_BuildValue("i", PG_CIRCLE)); PyDict_SetItemString(d, "PG_DATE", Py_BuildValue("i", PG_DATE)); + PyDict_SetItemString(d, "PG_FLOAT", Py_BuildValue("i", PG_FLOAT8)); PyDict_SetItemString(d, "PG_FLOAT4", Py_BuildValue("i", PG_FLOAT4)); PyDict_SetItemString(d, "PG_FLOAT8", Py_BuildValue("i", PG_FLOAT8)); *************** *** 1087,1093 **** --- 1095,1103 ---- PyDict_SetItemString(d, "PG_INT4", Py_BuildValue("i", PG_INT4)); PyDict_SetItemString(d, "PG_INT8", Py_BuildValue("i", PG_INT8)); + PyDict_SetItemString(d, "PG_INTEGER", Py_BuildValue("i", PG_INT4)); PyDict_SetItemString(d, "PG_INTERVAL", Py_BuildValue("i", PG_INTERVAL)); PyDict_SetItemString(d, "PG_LINE", Py_BuildValue("i", PG_LINE)); PyDict_SetItemString(d, "PG_LSEG", Py_BuildValue("i", PG_LSEG)); + PyDict_SetItemString(d, "PG_MACADDR", Py_BuildValue("i", PG_MACADDR)); PyDict_SetItemString(d, "PG_MONEY", Py_BuildValue("i", PG_CASH)); PyDict_SetItemString(d, "PG_NAME", Py_BuildValue("i", PG_NAME)); *************** *** 1101,1104 **** --- 1111,1115 ---- PyDict_SetItemString(d, "PG_RELTIME", Py_BuildValue("i", PG_RELTIME)); PyDict_SetItemString(d, "PG_ROWID", Py_BuildValue("i", PG_ROWID)); + PyDict_SetItemString(d, "PG_SMALLINT", Py_BuildValue("i", PG_INT2)); PyDict_SetItemString(d, "PG_TEXT", Py_BuildValue("i", PG_TEXT)); PyDict_SetItemString(d, "PG_TID", Py_BuildValue("i", PG_TID)); Index: libpqmodule.h =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/libpqmodule.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libpqmodule.h 2001/10/05 08:22:18 1.7 --- libpqmodule.h 2002/02/04 02:09:52 1.8 *************** *** 54,57 **** --- 54,63 ---- /***********************************************************************\ + | The following 'MAGIC' number defines that last reserved OID. | + \***********************************************************************/ + + #define MAX_RESERVED_OID 16383 /* 2^14 - 1 */ + + /***********************************************************************\ | It appears that versions of PostgreSQL prior to version 7.1 do not | | define InvalidOid, at least not in an area accessable to external | |