Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
749167cf
Commit
749167cf
authored
Apr 03, 2007
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow PL/PythonU to compile on Python 2.5. Change needed because of API
changes in Python. Marko Kreen
parent
9665dd92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
src/pl/plpython/plpython.c
src/pl/plpython/plpython.c
+27
-19
No files found.
src/pl/plpython/plpython.c
View file @
749167cf
/**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL
*
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.9
7 2007/04/02 03:49:42 tgl
Exp $
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.9
8 2007/04/03 13:37:22 momjian
Exp $
*
*********************************************************************
*/
...
...
@@ -23,6 +23,15 @@
#include <Python.h>
#endif
/*
* Py_ssize_t compat for Python <= 2.4
*/
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef
int
Py_ssize_t
;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
#include "postgres.h"
/* system stuff */
...
...
@@ -1953,11 +1962,11 @@ static void PLy_result_dealloc(PyObject *);
static
PyObject
*
PLy_result_getattr
(
PyObject
*
,
char
*
);
static
PyObject
*
PLy_result_nrows
(
PyObject
*
,
PyObject
*
);
static
PyObject
*
PLy_result_status
(
PyObject
*
,
PyObject
*
);
static
int
PLy_result_length
(
PyObject
*
);
static
PyObject
*
PLy_result_item
(
PyObject
*
,
in
t
);
static
PyObject
*
PLy_result_slice
(
PyObject
*
,
int
,
in
t
);
static
int
PLy_result_ass_item
(
PyObject
*
,
in
t
,
PyObject
*
);
static
int
PLy_result_ass_slice
(
PyObject
*
,
int
,
in
t
,
PyObject
*
);
static
Py_ssize_t
PLy_result_length
(
PyObject
*
);
static
PyObject
*
PLy_result_item
(
PyObject
*
,
Py_ssize_
t
);
static
PyObject
*
PLy_result_slice
(
PyObject
*
,
Py_ssize_t
,
Py_ssize_
t
);
static
int
PLy_result_ass_item
(
PyObject
*
,
Py_ssize_
t
,
PyObject
*
);
static
int
PLy_result_ass_slice
(
PyObject
*
,
Py_ssize_t
,
Py_ssize_
t
,
PyObject
*
);
static
PyObject
*
PLy_spi_prepare
(
PyObject
*
,
PyObject
*
);
...
...
@@ -2001,15 +2010,14 @@ static PyMethodDef PLy_plan_methods[] = {
{
NULL
,
NULL
,
0
,
NULL
}
};
static
PySequenceMethods
PLy_result_as_sequence
=
{
(
inquiry
)
PLy_result_length
,
/* sq_length */
(
binaryfunc
)
0
,
/* sq_concat */
(
intargfunc
)
0
,
/* sq_repeat */
(
intargfunc
)
PLy_result_item
,
/* sq_item */
(
intintargfunc
)
PLy_result_slice
,
/* sq_slice */
(
intobjargproc
)
PLy_result_ass_item
,
/* sq_ass_item */
(
intintobjargproc
)
PLy_result_ass_slice
,
/* sq_ass_slice */
PLy_result_length
,
/* sq_length */
NULL
,
/* sq_concat */
NULL
,
/* sq_repeat */
PLy_result_item
,
/* sq_item */
PLy_result_slice
,
/* sq_slice */
PLy_result_ass_item
,
/* sq_ass_item */
PLy_result_ass_slice
,
/* sq_ass_slice */
};
static
PyTypeObject
PLy_ResultType
=
{
...
...
@@ -2190,7 +2198,7 @@ PLy_result_status(PyObject * self, PyObject * args)
return
ob
->
status
;
}
static
in
t
static
Py_ssize_
t
PLy_result_length
(
PyObject
*
arg
)
{
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2199,7 +2207,7 @@ PLy_result_length(PyObject * arg)
}
static
PyObject
*
PLy_result_item
(
PyObject
*
arg
,
in
t
idx
)
PLy_result_item
(
PyObject
*
arg
,
Py_ssize_
t
idx
)
{
PyObject
*
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2211,7 +2219,7 @@ PLy_result_item(PyObject * arg, int idx)
}
static
int
PLy_result_ass_item
(
PyObject
*
arg
,
in
t
idx
,
PyObject
*
item
)
PLy_result_ass_item
(
PyObject
*
arg
,
Py_ssize_
t
idx
,
PyObject
*
item
)
{
int
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2222,7 +2230,7 @@ PLy_result_ass_item(PyObject * arg, int idx, PyObject * item)
}
static
PyObject
*
PLy_result_slice
(
PyObject
*
arg
,
int
lidx
,
in
t
hidx
)
PLy_result_slice
(
PyObject
*
arg
,
Py_ssize_t
lidx
,
Py_ssize_
t
hidx
)
{
PyObject
*
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
@@ -2235,7 +2243,7 @@ PLy_result_slice(PyObject * arg, int lidx, int hidx)
}
static
int
PLy_result_ass_slice
(
PyObject
*
arg
,
int
lidx
,
in
t
hidx
,
PyObject
*
slice
)
PLy_result_ass_slice
(
PyObject
*
arg
,
Py_ssize_t
lidx
,
Py_ssize_
t
hidx
,
PyObject
*
slice
)
{
int
rv
;
PLyResultObject
*
ob
=
(
PLyResultObject
*
)
arg
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment