vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi everyone, I'm working on a piece of code for PostGIS to allow the loading of projection configuration files from the share/postgresql directory, but I can't find a way of getting this to work under Win32. AIUI the way to do this would be to use a combination of my_exec_path and get_share_path in order to find the directory, but MingW refuses to find the my_exec_path variable during linking. Unfortunately I suspect that this because my_exec_path is not declared as DLLIMPORT in backend/utils/init/globals.c I really need to find a solution to this that can work all the way back to PostgreSQL 8.0 - can anyone think of any better ideas? Many thanks, Mark. -- ILande - Open Source Consultancy http://www.ilande.co.uk ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| |||
| Am Montag, 26. November 2007 schrieb Mark Cave-Ayland: > I'm working on a piece of code for PostGIS to allow the loading of > projection configuration files from the share/postgresql directory, but The share directory is the wrong place for configuration files anyway. And moreover, non-PostgreSQL packages have no business putting files into PostgreSQL's private directories. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Peter Eisentraut <peter_e@gmx.net> writes: > Am Montag, 26. November 2007 schrieb Mark Cave-Ayland: >> I'm working on a piece of code for PostGIS to allow the loading of >> projection configuration files from the share/postgresql directory, but > The share directory is the wrong place for configuration files anyway. And > moreover, non-PostgreSQL packages have no business putting files into > PostgreSQL's private directories. That doesn't seem logical to me. We expect tsearch configuration files to be put into $sharedir/tsearch_data, so why shouldn't PostGIS use a similar approach to dealing with external configuration data? I'm not sure why Mark's having a problem accessing my_exec_path --- it *is* declared DLLIMPORT in miscadmin.h (which is where it counts, AIUI) clear back to 8.0. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Peter Eisentraut wrote: > Am Montag, 26. November 2007 schrieb Mark Cave-Ayland: >> I'm working on a piece of code for PostGIS to allow the loading of >> projection configuration files from the share/postgresql directory, but > > The share directory is the wrong place for configuration files anyway. And > moreover, non-PostgreSQL packages have no business putting files into > PostgreSQL's private directories. > How does that work with the stuff that goes into directories relative to $libdir (per documented recommendations), without creating easy-to-break paths like $libdir/../../MyAddon/8.3/MyAddon.dll? Regards, Dave ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| Dave Page wrote: > How does that work with the stuff that goes into directories relative to > $libdir (per documented recommendations), without creating easy-to-break > paths like $libdir/../../MyAddon/8.3/MyAddon.dll? Which documented recommendation do you speak of? -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| Tom Lane wrote: > Peter Eisentraut <peter_e@gmx.net> writes: > > Am Montag, 26. November 2007 schrieb Mark Cave-Ayland: > >> I'm working on a piece of code for PostGIS to allow the loading of > >> projection configuration files from the share/postgresql directory, but > > > > The share directory is the wrong place for configuration files anyway. > > And moreover, non-PostgreSQL packages have no business putting files into > > PostgreSQL's private directories. > > That doesn't seem logical to me. We expect tsearch configuration files > to be put into $sharedir/tsearch_data, so why shouldn't PostGIS use a > similar approach to dealing with external configuration data? Well, PostGIS is not PostgreSQL. And those files are not really configuration files, in the sense that the user configures them, but data files (or else they are in the wrong place). -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| ||||
| On Mon, 2007-11-26 at 11:55 -0500, Tom Lane wrote: > I'm not sure why Mark's having a problem accessing my_exec_path --- > it *is* declared DLLIMPORT in miscadmin.h (which is where it counts, > AIUI) clear back to 8.0. Bah, I think that is the source of the problem. Having grepped the source for my_exec_path, I found the reference in globals.c and hence the code worked on Linux (my main development environment) with a simple extern declaration which was what was confusing me. Adding the #include "miscadmin.h" solves this problem and I can now access the variable on Windows aswell, so I put this down to "user error" - thanks for the advice Tom. Many thanks, Mark. -- ILande - Open Source Consultancy http://www.ilande.co.uk ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |