Re: [HACKERS] session id and global storage
It seems MyProcID is what I was searching for... David Hoksza DH Something like this would be maybe possible, but this select can DH return more rows, when the user is connected with more instances... DH David Hoksza DH Hi, I cant find any function, which tells me something like session id. Is there something like that? I need it in my AM, because I need to know, if something which I wrote in file was written in this current session or previously. AL How about AL select procpid||' '||backend_start from pg_stat_activity; AL Yours, AL Laurenz Albe DH ---(end of DH broadcast)--- DH TIP 5: don't forget to increase your free space map settings ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [HACKERS] session id and global storage
Something like this would be maybe possible, but this select can return more rows, when the user is connected with more instances... David Hoksza Hi, I cant find any function, which tells me something like session id. Is there something like that? I need it in my AM, because I need to know, if something which I wrote in file was written in this current session or previously. AL How about AL select procpid||' '||backend_start from pg_stat_activity; AL Yours, AL Laurenz Albe ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
[HACKERS] session id and global storage
Hi, I cant find any function, which tells me something like session id. Is there something like that? I need it in my AM, because I need to know, if something which I wrote in file was written in this current session or previously. And second thing - it would be great if I could save pointer in some global storage, because I would like to access my dynamically created tree in more subsequent scans, which is impossible with void pointer stored just in opaque scan structure:( Thnaks, David Hoksza ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
[HACKERS] using dll in am
Hi, I'm trying to implement my own access method, which uses c++ framework for saving tuples. The framework consists of set of functions, which are implemented in win32 dll. All the functions which are desired by PG (ambuild, aminsert, ...) are implemented and functional. But when I want to use any of the functions from dll so there's problem when loading the dll in dynloader. It says that function can't be found (in the time of loading the dll). I do following steps: 1. Compiling the dll in Microsoft Visual Studio. 2. Creating the def file (in mingw32): impdef rtreewrapper.def rtreewrapper.dll which yealds in the folowing def file: LIBRARY RTREEWRAPPER.DLL EXPORTS f_cRTreeItem_GetSize = [EMAIL PROTECTED] f_cRTreeLeafItem_GetSize = [EMAIL PROTECTED] f_cRTreeLeafItem_size = [EMAIL PROTECTED] f_header = [EMAIL PROTECTED] f_header_ComputeNodeSize = [EMAIL PROTECTED] f_header_CreateSpaceDescriptor= [EMAIL PROTECTED] f_header_GetSpaceDescriptor_GetDimension= [EMAIL PROTECTED] f_header_GetSpaceDescriptor_SetBitSize= [EMAIL PROTECTED] f_header_SetLeafNodeItemSize = [EMAIL PROTECTED] f_header_SetNodeItemSize = [EMAIL PROTECTED] f_leafitem1 = [EMAIL PROTECTED] f_leafitem= [EMAIL PROTECTED] f_leafitem_GetTuple_GetValue_GenerateRandom= [EMAIL PROTECTED] f_leafitem_Resize = [EMAIL PROTECTED] f_timer = [EMAIL PROTECTED] f_timer_Print = [EMAIL PROTECTED] f_timer_Start = [EMAIL PROTECTED] f_timer_Stop = [EMAIL PROTECTED] f_tree= [EMAIL PROTECTED] f_tree_Close = [EMAIL PROTECTED] f_tree_Create = [EMAIL PROTECTED] f_tree_Find = [EMAIL PROTECTED] f_tree_GetQueryStatistics_GetCounter_GetValue= [EMAIL PROTECTED] f_tree_GetQueryStatistics_GetCounter_Reset= [EMAIL PROTECTED] f_tree_Insert = [EMAIL PROTECTED] f_tree_PrintInfo = [EMAIL PROTECTED] 3. Creating the .a file from dll by using: dlltool --dllname rtreewrapper.dll --def rtreewrapper.def --output-lib rtreewrapper.a 4. Compiling the whole AM module with makefile containing following line: OBJS = atomrtget.o atomrtree.o atomrtscan.o atomrtcostestimate.o rtreewrapper.a 5. Copy the dll to the bin directory (when I let it in the contrib directory, where also the libatomrtree.dll file with the AM functions is, so it writes out, that the modul can't be found, when loading it). 6. When there is void *header = f_header() anywhere in the source, so when trying to load the dll (when I try to create the index), it writes out, that function can't be found (I got czech version, so I'm not sure, what the message is in english). Does anybody got any hint, where the problem could be? I really can't find it:(( Thanks. David Hoksza ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] using dll in am
Yes, you got me right. I'm just trying the 2) and it doesn't work. So I'll try the depends tool. Thx, David 23. dubna 2006, 20:05:00, napsal jste: 5. Copy the dll to the bin directory (when I let it in the contrib directory, where also the libatomrtree.dll file with the AM functions is, so it writes out, that the modul can't be found, when loading it). 6. When there is void *header = f_header() anywhere in the source, so when trying to load the dll (when I try to create the index), it writes out, that function can't be found (I got czech version, so I'm not sure, what the message is in english). Does anybody got any hint, where the problem could be? I really can't find it:(( MH If I get you right, you have *two* DLLs? One in mingw that in turn loads MH another one that's in VC++? If so, a couple of hints: MH 1) Run depends on the mingw DLL. It will list symbols that can't be MH resolved. depends is a part of the Windows Support Tools, on your MH windows CD. MH 2) Check that you can create a mingw *exe* that uses the functions in MH the VC++ DLL. If not, make sure that works first, because that should be MH easier to tweak. MH //Magnus ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [HACKERS] using dll in am
Uff, I finally got it. It's very simple. I was trying to use dlltool all the time, but the solution is much simplier - just use directly the .lib file with gcc and it will handle it. So easy that it didn't cross my mind:) gcc . atomrtget.o atomrtree.o atomrtscan.o atomrtcostestimate.o rtreewrapper.lib Thanks, David 23. dubna 2006, 20:05:00, napsal jste: 5. Copy the dll to the bin directory (when I let it in the contrib directory, where also the libatomrtree.dll file with the AM functions is, so it writes out, that the modul can't be found, when loading it). 6. When there is void *header = f_header() anywhere in the source, so when trying to load the dll (when I try to create the index), it writes out, that function can't be found (I got czech version, so I'm not sure, what the message is in english). Does anybody got any hint, where the problem could be? I really can't find it:(( MH If I get you right, you have *two* DLLs? One in mingw that in turn loads MH another one that's in VC++? If so, a couple of hints: MH 1) Run depends on the mingw DLL. It will list symbols that can't be MH resolved. depends is a part of the Windows Support Tools, on your MH windows CD. MH 2) Check that you can create a mingw *exe* that uses the functions in MH the VC++ DLL. If not, make sure that works first, because that should be MH easier to tweak. MH //Magnus ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match