Opened 14 years ago
Closed 14 years ago
#3291 closed defect (fixed)
Postgresql 7.x compatibility (patch included)
Reported by: | dpanech | Owned by: | pramsey |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | PostGIS Interface | Version: | 5.4 |
Severity: | normal | Keywords: | postgis PQserverVersion |
Cc: | dmorissette |
Description
The file mappostgis.c uses the function PQserverVersion, which was is absent in libpq 7.4.19 that I am using.
I think "select version();" SQL should do the same thing.
Attachments (3)
Change History (13)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Summary: | Postgresql 7.x compatibility → Postgresql 7.x compatibility (patch included) |
---|
by , 14 years ago
Attachment: | mapserver-5.4.2-pgversion.patch added |
---|
Patch for finding out server version using SQL when PQserverVersion function is unavailable
comment:3 by , 14 years ago
Cc: | added |
---|---|
Component: | Build Problems → PostGIS Interface |
Owner: | changed from | to
Moving to postgis component for Paul to review.
follow-up: 9 comment:4 by , 14 years ago
The patch is incomplete, it only has the configure routine for setting the define. BTW, this must be against a very old version of PostGIS as well... what PostGIS version are you running?
comment:5 by , 14 years ago
dmorissette has set me straight, the patch is complete but not displaying right. This line seems suspect to me:
int pgversion = atoi (PQgetvalue (pgresult, 0, 0));
When I run select version(); I get a big string:
PostgreSQL 8.4.2 on i386-apple-darwin10.2.0, compiled by GCC i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1), 64-bit
Are you saying on earlier versions you get the simple version number string? 70400?
comment:6 by , 14 years ago
Please test this version of the patch and see if it does what you want/expect.
follow-up: 8 comment:7 by , 14 years ago
Thanks, your patch works; but I found a somewhat better/safer way of getting the version string. See 3291-2.patch.
comment:8 by , 14 years ago
PQparameterStatus ("server_version") returns just the version string ("7.4.19" or some such), so we can avoid executing SQL.
comment:9 by , 14 years ago
Replying to pramsey:
The patch is incomplete, it only has the configure routine for setting the define. BTW, this must be against a very old version of PostGIS as well... what PostGIS version are you running?
I'm running version 7.4.19... but anyway, it was my mistake, "version()" does return a long "human-readable" string. See corrections in my second patch.
comment:10 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Changes committed against branch 5.4, 5.6 and trunk.
Note about the patch: it changes two files, configure.in and mappostgis.c. But the "Preview" mode on this website only shows the first file. Download the patch to see al changes, please.