Unix Technical Forum

Re: [HACKERS] contrib/pg_buffercache

This is a discussion on Re: [HACKERS] contrib/pg_buffercache within the Pgsql Patches forums, part of the PostgreSQL category; --> I have confirmed that the attached patch works on Cygwin as well as Windows. Please apply. cheers andrew Andrew ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:12 AM
Andrew Dunstan
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache


I have confirmed that the attached patch works on Cygwin as well as
Windows. Please apply.

cheers

andrew

Andrew Dunstan wrote:

>It fixes the build error on Windows - haven't tried because i don't have
>time, but I know it won't work on Cygwin, because WIN32 isn't (usually)
>defined on Cygwin - see previous almost endless discussions.
>
>cheers
>
>andrew
>
>Mark Kirkwood wrote:
>
>
>
>>Andrew Dunstan wrote:
>>
>>
>>
>>>... is apparently broken for Windows and Cygwin. See for example
>>>http://www.pgbuildfarm.org/cgi-bin/s...-16%2001:55:33
>>>
>>>
>>>
>>>

>>Andrew,
>>
>>The attached patch seems to sort it for me, can you give it try on
>>win32 and cygwin?
>>
>>cheers
>>
>>Mark
>>
>>
>>

>
>



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:12 AM
Neil Conway
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache

Andrew Dunstan wrote:
> I have confirmed that the attached patch works on Cygwin as well as
> Windows. Please apply.


Applied, thanks.

-Neil

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:12 AM
Mark Kirkwood
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache

Neil Conway wrote:
> Andrew Dunstan wrote:
>
>> I have confirmed that the attached patch works on Cygwin as well as
>> Windows. Please apply.

>
>
> Applied, thanks.
>


Great that it fixes it... however, I had submitted a tidier patch that
puts the macro in the header (probably after asking Andrew to test the
first one, oops - sorry Andrew). I have tested it on win32 native.

Do you want to back out the first one and use this instead?

regards

Mark


*** pg_buffercache_pages.h.orig Thu Mar 17 10:12:20 2005
--- pg_buffercache_pages.h Thu Mar 17 13:44:45 2005
***************
*** 15,18 ****
--- 15,24 ----

extern Datum pg_buffercache_pages(PG_FUNCTION_ARGS);

+ /* A little hackery for Windows and Cygwin */
+ #if defined (WIN32) || defined (__CYGWIN__)
+ extern DLLIMPORT BufferDesc *BufferDescriptors;
+ extern DLLIMPORT volatile uint32 InterruptHoldoffCount;
+ #endif
+
#endif /* PG_BUFFERCACHE_PAGES_H */



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:12 AM
Neil Conway
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache

Mark Kirkwood wrote:
> Great that it fixes it... however, I had submitted a tidier patch that
> puts the macro in the header


How is this tidier?

(I don't see a reason for pg_buffercache_pages.h at all, actually.)

-Neil

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 12:12 AM
Mark Kirkwood
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache

Neil Conway wrote:
> Mark Kirkwood wrote:
>
>> Great that it fixes it... however, I had submitted a tidier patch that
>> puts the macro in the header

>
>
> How is this tidier?
>


err... puts the macro in the header....

> (I don't see a reason for pg_buffercache_pages.h at all, actually.)
>

(chuckles) - well, that puts a different complexion on it, best leave it
as is then! (in fact, feel free to move the declaration from
pg_buffercache_pages.h to pg_buffercache_pages.c, and eliminate the
header altogether)

cheers

Mark

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 12:12 AM
Andrew Dunstan
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache



Mark Kirkwood wrote:

> Neil Conway wrote:
>
>> Andrew Dunstan wrote:
>>
>>> I have confirmed that the attached patch works on Cygwin as well as
>>> Windows. Please apply.

>>
>>
>>
>> Applied, thanks.
>>

>
>
> Great that it fixes it... however, I had submitted a tidier patch that
> puts the macro in the header (probably after asking Andrew to test the
> first one, oops - sorry Andrew). I have tested it on win32 native.
>
> Do you want to back out the first one and use this instead?
>
>
>


I didn't see the original of the later patch, which is why I sent in
mine. I honestly don't care that much either way, although I'm inclined
to agree that the header file is just unnecessary noise.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 12:12 AM
Mark Kirkwood
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache

Andrew Dunstan wrote:
>
> I didn't see the original of the later patch, which is why I sent in
> mine. I honestly don't care that much either way, although I'm inclined
> to agree that the header file is just unnecessary noise.
>


Well, looks like a strong feeling for no header :-). I didn't really
think about *not* having one to be honest. So, anyway - instead of
inviting Neil to spend valuable time eliminating it, I should do it
myself...

So, please ignore my previous patch to the header file, and consider
this one - which eliminates it completely.

best wishes

Mark

diff -Nacr pg_buffercache.orig/pg_buffercache_pages.c pg_buffercache/pg_buffercache_pages.c
*** pg_buffercache.orig/pg_buffercache_pages.c Fri Apr 1 11:25:49 2005
--- pg_buffercache/pg_buffercache_pages.c Fri Apr 1 11:28:22 2005
***************
*** 12,18 ****
#include "storage/buf_internals.h"
#include "storage/bufmgr.h"
#include "utils/relcache.h"
- #include "pg_buffercache_pages.h"


#define NUM_BUFFERCACHE_PAGES_ELEM 6
--- 12,17 ----
***************
*** 21,26 ****
--- 20,27 ----
extern DLLIMPORT BufferDesc *BufferDescriptors;
extern DLLIMPORT volatile uint32 InterruptHoldoffCount;
#endif
+
+ Datum pg_buffercache_pages(PG_FUNCTION_ARGS);


/*
diff -Nacr pg_buffercache.orig/pg_buffercache_pages.h pg_buffercache/pg_buffercache_pages.h
*** pg_buffercache.orig/pg_buffercache_pages.h Fri Apr 1 11:25:49 2005
--- pg_buffercache/pg_buffercache_pages.h Thu Jan 1 12:00:00 1970
***************
*** 1,18 ****
- /*-------------------------------------------------------------------------
- *
- * pg_buffercache_pages.h
- * Prototypes for pg_buffercache_pages
- *
- *
- * $PostgreSQL: pgsql/contrib/pg_buffercache/pg_buffercache_pages.h,v 1.1 2005/03/12 15:36:24 neilc Exp $
- *
- *-------------------------------------------------------------------------
- */
-
-
- #ifndef PG_BUFFERCACHE_PAGES_H
- #define PG_BUFFERCACHE_PAGES_H
-
- extern Datum pg_buffercache_pages(PG_FUNCTION_ARGS);
-
- #endif /* PG_BUFFERCACHE_PAGES_H */
--- 0 ----


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 12:12 AM
Neil Conway
 
Posts: n/a
Default Re: [HACKERS] contrib/pg_buffercache

Mark Kirkwood wrote:
> So, please ignore my previous patch to the header file, and consider
> this one - which eliminates it completely.


Thanks, applied.

-Neil

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com