FAQ
Hi,

I have two questions to ask:

1. How to flush buffer in postgres? I'm not able to see the changes that I
make in my code. Sometimes the output comes and sometime it's not. What
might be the problem?

2. I have added a new field in RESDOM structure, made necessary
modifications in outfuncs.c, copy, read, equalfuncs.c ....but my prog is
behaving in a weird way, seems like some memory probs...What other
modifications needs to be done to reflect the addition of this new field?

I looked up into the archive, but not no results.

Best,
Ranbeer
Hyderabad
India

Search Discussions

  • Martijn van Oosterhout at Jun 5, 2006 at 6:03 pm

    On Mon, Jun 05, 2006 at 11:24:09PM +0530, ranbeer makin wrote:
    Hi,

    I have two questions to ask:

    1. How to flush buffer in postgres? I'm not able to see the changes that I
    make in my code. Sometimes the output comes and sometime it's not. What
    might be the problem?
    How do you mean? What kind of buffer? If you mean when does stuff in
    the buffercache hit disk, well, normally they xlogged so they may not
    appear in the actual datafiles. However, a CHECKPOINT may do it.
    2. I have added a new field in RESDOM structure, made necessary
    modifications in outfuncs.c, copy, read, equalfuncs.c ....but my prog is
    behaving in a weird way, seems like some memory probs...What other
    modifications needs to be done to reflect the addition of this new field?
    Did you remember to recompile *everything* affected? (--enable-depend
    is useful for this). You also have to initdb again.

    Hope this helps,
    --
    Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
    From each according to his ability. To each according to his ability to litigate.
  • Tom Lane at Jun 5, 2006 at 6:57 pm

    Martijn van Oosterhout writes:
    On Mon, Jun 05, 2006 at 11:24:09PM +0530, ranbeer makin wrote:
    2. I have added a new field in RESDOM structure, made necessary
    modifications in outfuncs.c, copy, read, equalfuncs.c ....but my prog is
    behaving in a weird way, seems like some memory probs...What other
    modifications needs to be done to reflect the addition of this new field?
    Did you remember to recompile *everything* affected? (--enable-depend
    is useful for this). You also have to initdb again.
    Also, if you're working on a patch you hope to someday contribute, you
    should be starting from CVS HEAD or some reasonable approximation of it.
    Resdom disappeared more than a year ago:
    http://archives.postgresql.org/pgsql-committers/2005-04/msg00060.php

    regards, tom lane
  • Ranbeer makin at Jun 6, 2006 at 4:14 pm
    hey,
    let me clarify something.....

    1. Whenever you run a query, its result or some other thing gets cached. I
    want to flush this cache? Also let me know when this cache gets flushed
    automatically.

    2. After adding a new field in Resdom structure and making necessary changes
    in outfuncs.c, createfuncs. etc files, I *sometimes* get garbage value for
    the field added. The field is initialiazed to zero in makefuns.c....

    3. **IMP*** Is there something in postgres that, only for N number of
    fields, of a structure, the memory is allocated, i.e., do I need to modify
    this "N" somewhere to reflect the addtion of a new field.

    And that *weird* thing is:

    1. I run some query, didn't get results.
    2. Then, I commented the part which I modified [ i.e., commented that new
    field in Resdom structure], again run the same query, got results.
    3. Next, I uncommented that part, and ran the same query again. I GOT THE
    RESULTS.

    That's how my prog is behaving, behaving in a *weird* way. It seems like
    some memory probs somewhere. I can't figure it out. Yes, I'm re-compiling
    and running initdb whenever I make some modifications in the code.

    I'm using release 8.03 and due to some reasons can't shift to some other
    release.

    Regds,
    Ranbeer


    On 6/6/06, Tom Lane wrote:

    Martijn van Oosterhout <kleptog@svana.org> writes:
    On Mon, Jun 05, 2006 at 11:24:09PM +0530, ranbeer makin wrote:
    2. I have added a new field in RESDOM structure, made necessary
    modifications in outfuncs.c, copy, read, equalfuncs.c ....but my prog
    is
    behaving in a weird way, seems like some memory probs...What other
    modifications needs to be done to reflect the addition of this new
    field?
    Did you remember to recompile *everything* affected? (--enable-depend
    is useful for this). You also have to initdb again.
    Also, if you're working on a patch you hope to someday contribute, you
    should be starting from CVS HEAD or some reasonable approximation of it.
    Resdom disappeared more than a year ago:
    http://archives.postgresql.org/pgsql-committers/2005-04/msg00060.php

    regards, tom lane
  • Martijn van Oosterhout at Jun 6, 2006 at 6:53 pm

    On Tue, Jun 06, 2006 at 09:44:04PM +0530, ranbeer makin wrote:
    hey,
    let me clarify something.....

    1. Whenever you run a query, its result or some other thing gets cached. I
    want to flush this cache? Also let me know when this cache gets flushed
    automatically.
    What cache? Query results are not cached, neither are plans. Please be
    specific.
    2. After adding a new field in Resdom structure and making necessary changes
    in outfuncs.c, createfuncs. etc files, I *sometimes* get garbage value for
    the field added. The field is initialiazed to zero in makefuns.c....
    Check for other places in the code that create that structure. makefunc
    is more convienience than anything else.
    3. **IMP*** Is there something in postgres that, only for N number of
    fields, of a structure, the memory is allocated, i.e., do I need to modify
    this "N" somewhere to reflect the addtion of a new field.
    Postgres uses sizeof() always, so as long as all the files are compiled
    the same way, everything will work.
    And that *weird* thing is:

    1. I run some query, didn't get results.
    2. Then, I commented the part which I modified [ i.e., commented that new
    field in Resdom structure], again run the same query, got results.
    3. Next, I uncommented that part, and ran the same query again. I GOT THE
    RESULTS.
    Did you rerun make install and restart the postmaster between each run?

    Have a nice day,
    --
    Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
    From each according to his ability. To each according to his ability to litigate.
  • Jonah H. Harris at Jun 5, 2006 at 6:05 pm

    On 6/5/06, ranbeer makin wrote:
    1. How to flush buffer in postgres? I'm not able to see the changes that I
    make in my code.
    I assume you mean an output buffer? If you're using fprintf, make
    sure to do a fflush. Otherwise, use elog(LOG or elog(DEBUG.
    2. I have added a new field in RESDOM structure, made necessary
    modifications in outfuncs.c, copy, read, equalfuncs.c ....but my prog is
    behaving in a weird way, seems like some memory probs...What other
    modifications needs to be done to reflect the addition of this new field?
    Example of *wierd*?

    --
    Jonah H. Harris, Software Architect | phone: 732.331.1300
    EnterpriseDB Corporation | fax: 732.331.1301
    33 Wood Ave S, 2nd Floor | jharris@enterprisedb.com
    Iselin, New Jersey 08830 | http://www.enterprisedb.com/
  • Alvaro Herrera at Jun 5, 2006 at 7:36 pm

    Jonah H. Harris wrote:

    2. I have added a new field in RESDOM structure, made necessary
    modifications in outfuncs.c, copy, read, equalfuncs.c ....but my prog is
    behaving in a weird way, seems like some memory probs...What other
    modifications needs to be done to reflect the addition of this new field?
    Example of *wierd*?
    http://www.m-w.com/

    wierd:

    The word you've entered isn't in the dictionary. Click on a spelling suggestion
    below or try again using the search box to the right.

    Suggestions for wierd:

    1. weird

    weird:

    Main Entry: 2weird
    Function: adjective
    1 : of, relating to, or caused by witchcraft or the supernatural : MAGICAL
    2 : of strange or extraordinary character : ODD, FANTASTIC

    (2weird, because 1weird is a noun)

    Tom said some time ago "weird is spelled weirdly".

    --
    Alvaro Herrera http://www.CommandPrompt.com/
    The PostgreSQL Company - Command Prompt, Inc.
  • Jonah H. Harris at Jun 5, 2006 at 7:42 pm

    On 6/5/06, Alvaro Herrera wrote:
    The word you've entered isn't in the dictionary.
    Thanks Alvaro... my typing sometimes gets ahead of my in-brain spellcheck.

    --
    Jonah H. Harris, Software Architect | phone: 732.331.1300
    EnterpriseDB Corporation | fax: 732.331.1301
    33 Wood Ave S, 2nd Floor | jharris@enterprisedb.com
    Iselin, New Jersey 08830 | http://www.enterprisedb.com/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJun 5, '06 at 5:54p
activeJun 6, '06 at 6:53p
posts8
users5
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2021 Grokbase