adding new field
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
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/
Show quoted text
From each according to his ability. To each according to his ability to litigate.
On 6/5/06, ranbeer makin <ranbeer@gmail.com> 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/
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
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*?
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.
On 6/5/06, Alvaro Herrera <alvherre@commandprompt.com> 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/
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
Show quoted text
On 6/6/06, Tom Lane <tgl@sss.pgh.pa.us> 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 progis
behaving in a weird way, seems like some memory probs...What other
modifications needs to be done to reflect the addition of this newfield?
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.phpregards, tom lane
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/
Show quoted text
From each according to his ability. To each according to his ability to litigate.