Re: [HACKERS] adding new field

2006-06-06 Thread ranbeer makin
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,RanbeerOn 6/6/06, Tom Lane [EMAIL PROTECTED] 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


Re: [HACKERS] adding new field

2006-06-06 Thread Martijn van Oosterhout
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.


signature.asc
Description: Digital signature


Re: [HACKERS] adding new field

2006-06-05 Thread Martijn van Oosterhout
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.


signature.asc
Description: Digital signature


Re: [HACKERS] adding new field

2006-06-05 Thread Jonah H. Harris

On 6/5/06, ranbeer makin [EMAIL PROTECTED] 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| [EMAIL PROTECTED]
Iselin, New Jersey 08830| http://www.enterprisedb.com/

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


Re: [HACKERS] adding new field

2006-06-05 Thread Tom Lane
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

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


Re: [HACKERS] adding new field

2006-06-05 Thread Alvaro Herrera
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 Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(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


Re: [HACKERS] adding new field

2006-06-05 Thread Jonah H. Harris

On 6/5/06, Alvaro Herrera [EMAIL PROTECTED] 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| [EMAIL PROTECTED]
Iselin, New Jersey 08830| http://www.enterprisedb.com/

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly