
just have a quick question. What i need to do is to create a shared memory
structure (which i can do) and maintain in it a linked list which should
be in shared memory too. I found the shmemqueue in postgres, but am having
some problems using it. I just need to have the linked list store
relation OID's. I see there is an Insert before and after which takes in
an element and adds it to the queue. But the thing is - they are both
SHM_QUEUE types. How can i convert an Oid to this type? Also, am i right
in assuming that i can use this? I was looking for some examples of its
use too.
thanks

nailah

On Fri, 20 Jun 2003, Neil Conway wrote:

> Hi Nailah,
>
> I hope your summer is going well. I saw your post on -hackers regarding some
> problems with hash_search. The dynahash API can be a little bit picky -- IIRC,
> it requires you to NULL pad hash keys out to the appropriate length, rather
> than just using a regular NULL-terminated C-string. You weren't specific on
> the exact problem you were having, but perhaps taking a look at
> src/backend/commands/prepare.c (in PostgreSQL 7.3 or later) would be helpful:
> it is a simple example of manipulating a hash table of prepared statements
> that I wrote last summer. Since last I heard you guys were still working with
> 7.1, you can find the code in question here:
>
> http://developer.postgresql.org/cvsweb.cgi/~checkout~/pgsql-server/src/backend/commands/prepare.c?rev=1.18&content-type=text/plain
>
> If that doesn't help, the usual fallback of breaking of gdb and stepping
> through the troublesome code might help track down the problem.
>
> BTW, I'm not subscribed to the -hackers list temporarily (just for the summer,
> as I'm busy w/ MS work), so my response to questions posted there will
> probably be erratic (I just browse the archives on the web occaisonally).
>
> -Neil
>


Mon, 23 Jun 2003 12:13:58 -0400 (EDT)
Nailah Ogeer <ogeer@cs.queensu.ca>
SHM_QUEUE
Sorry to bother you again but i am having a real hard time getting stats
from the relation. What i have is a shared memory linked list of
relfilenodes. I simply want to get the stats of all these relations and
add them up. I was using pgstat_fetch_stat_tabentry(relid) as an sql
statement and this worked beautifully.
Now i am trying to do it at every
checkpoint before flushing all relations. BUt the above fetch
function does not work. So then i tried getting the stat info from the
relation itself but am having problems with the
RelationNodeCacheGetRelation function which always seems to give me null.
Can you tell me how i can get this info in the backend???
I can see the relation in my list and there is a matching relation in
pg_class. I just need to get the relationdesc back



Thu, 24 Jul 2003 15:21:41 -0400 (EDT)
Nailah Ogeer <ogeer@cs.queensu.ca>
Re: Postgres hash tables
Just wondering if you shut down postmaster and restart, if the contents of
the file cache are written out to disk or still in the file cache. In
other words, will the number of transactions per second change if you shut
down postmaster and restart compared to restarting the machine
thanks
nailah



Wed, 30 Jul 2003 17:03:57 -0400 (EDT)
Nailah Ogeer <ogeer@cs.queensu.ca>
File Cache