mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
Include catalog/pg_type.h instead of manually extracting the interesting
oid values.
This commit is contained in:
parent
a8dbe428de
commit
31fe394cd8
@ -1,11 +0,0 @@
|
|||||||
#! /usr/bin/env python
|
|
||||||
|
|
||||||
import string
|
|
||||||
|
|
||||||
# change this if you have it somewhere else
|
|
||||||
for l in open("/usr/local/pgsql/src/include/catalog/pg_type.h").readlines():
|
|
||||||
tokens = string.split(l)
|
|
||||||
if len(tokens) == 0 or tokens[0] != "#define": continue
|
|
||||||
|
|
||||||
if tokens[1] in ('CASHOID', 'INT2OID', 'INT4OID', 'OIDOID', 'FLOAT4OID', 'FLOAT8OID', 'NUMERICOID'):
|
|
||||||
print l,
|
|
@ -27,24 +27,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#include <postgres.h>
|
#include "postgres.h"
|
||||||
#include <libpq-fe.h>
|
#include "libpq-fe.h"
|
||||||
#include <libpq/libpq-fs.h>
|
#include "libpq/libpq-fs.h"
|
||||||
|
#include "catalog/pg_type.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* really bad stuff here - I'm so naughty */
|
|
||||||
/* If you need to you can run mkdefines to get */
|
|
||||||
/* current defines but it should not have changed */
|
|
||||||
#define INT2OID 21
|
|
||||||
#define INT4OID 23
|
|
||||||
#define OIDOID 26
|
|
||||||
#define FLOAT4OID 700
|
|
||||||
#define FLOAT8OID 701
|
|
||||||
#define CASHOID 790
|
|
||||||
#define NUMERICOID 1700
|
|
||||||
|
|
||||||
static PyObject *PGError;
|
static PyObject *PGError;
|
||||||
static const char *PyPgVersion = "3.2";
|
static const char *PyPgVersion = "3.2";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user