Thread: Help needed in testing my code.

Help needed in testing my code.

From
Srikanth M
Date:
Dear Sir, 

I want to know the compilaiton and execution of my 
code. Suppose if i add a test printf statement in the 
src/backend/tcop/postgres.c and after compilation and 
execution i should get that statement every time i give 
a query to psql.
After running make I even added the executables 
in the /usr/bin/ directory but i couldn't see the test 
statement after giving a query to psql.
please tell me the procedure of adding a test 
printf statement in postgres.c(or in any file), and 
compiling and running it so that i get the test statement 
as an output when i give the query.

Sincerely
Srikanth M









Re: Help needed in testing my code.

From
Sailesh Krishnamurthy
Date:
Why don't you use elog(LOG, instead of printf ?

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh



Re: Help needed in testing my code.

From
"Christopher Kings-Lynne"
Date:
Hi,

This is a much better way than printf:

elog(NOTICE, "this is my test: %s", string);

Chris

----- Original Message ----- 
From: "Srikanth M" <srikanth_m@students.iiit.net>
To: <pgsql-hackers@postgresql.org>
Sent: Wednesday, May 28, 2003 3:08 PM
Subject: [HACKERS] Help needed in testing my code.


> Dear Sir, 
> 
> 
> I want to know the compilaiton and execution of my 
> code. Suppose if i add a test printf statement in the 
> src/backend/tcop/postgres.c and after compilation and 
> execution i should get that statement every time i give 
> a query to psql.
> 
> After running make I even added the executables 
> in the /usr/bin/ directory but i couldn't see the test 
> statement after giving a query to psql.
> 
> please tell me the procedure of adding a test 
> printf statement in postgres.c(or in any file), and 
> compiling and running it so that i get the test statement 
> as an output when i give the query.
> 
> Sincerely
> Srikanth M
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/docs/faqs/FAQ.html
> 



Re: Help needed in testing my code.

From
Kris Jurka
Date:
I'm guessing his problem is that he's expecting this to come out of psql
and not go to the backend's stdout.

Kris Jurka

On Wed, 28 May 2003, Christopher Kings-Lynne wrote:

> Hi,
>
> This is a much better way than printf:
>
> elog(NOTICE, "this is my test: %s", string);
>
> Chris
>
> ----- Original Message -----
> From: "Srikanth M" <srikanth_m@students.iiit.net>
> To: <pgsql-hackers@postgresql.org>
> Sent: Wednesday, May 28, 2003 3:08 PM
> Subject: [HACKERS] Help needed in testing my code.
>
>
> > Dear Sir,
> >
> >
> > I want to know the compilaiton and execution of my
> > code. Suppose if i add a test printf statement in the
> > src/backend/tcop/postgres.c and after compilation and
> > execution i should get that statement every time i give
> > a query to psql.
> >
> > After running make I even added the executables
> > in the /usr/bin/ directory but i couldn't see the test
> > statement after giving a query to psql.
> >
> > please tell me the procedure of adding a test
> > printf statement in postgres.c(or in any file), and
> > compiling and running it so that i get the test statement
> > as an output when i give the query.
> >
> > Sincerely
> > Srikanth M
> >
> >
> >
> >
> >
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/docs/faqs/FAQ.html
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>



Re: Help needed in testing my code.

From
Srikanth M
Date:
Dear SirI am new to postgres and dont know the excat procedure of 
testing my code, okay i will use elog, but please tell me the procedure 
of testing that. 

for example,pls tell what should i do after i add code, what make files 
should i run and where should i place the new executables.

Thanks for ur reply.

Srikanth.

runOn 28 May 2003, 
Sailesh Krishnamurthy wrote:

> 
> Why don't you use elog(LOG, instead of printf ?
> 
> 

-- 
big fan of not reinventing the wheel - good programmers write code,
great programmers steal code ;-)




Re: Help needed in testing my code.

From
Sailesh Krishnamurthy
Date:
>>>>> "Srikanth" == Srikanth M <Srikanth> writes:
   Srikanth> Dear Sir I am new to postgres and dont know the excat   Srikanth> procedure of testing my code, okay i
willuse elog, but   Srikanth> please tell me the procedure of testing that.
 

Srikanth 

As you're a big fan of stealing code, why don't you grep the source
for occurences of "elog(LOG" or "elog(NOTICE". 

elog(NOTICE should send NOTICE messages to the psql client (I think !)
while elog(LOG while only send it to the logfile you might have
specified while starting the postmaster 
   Srikanth> for example,pls tell what should i do after i add code,   Srikanth> what make files should i run and where
shouldi place   Srikanth> the new executables.
 

Well you sould start out by RTFM .. read how to build postgres. I run
"make install" in my postgres directory (right above src/).

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh



describe statement

From
Dave Cramer
Date:
Is anyone working on, or planning on working on the describe statement?

It is very useful for ecpg, and a project I am working on.

Depending on the amount, I may be able to get compensation for this, if
this helps motivate anyone?

-- 
Dave Cramer <dave@fastcrypt.com>
fastcrypt



Re: Help needed in testing my code.

From
Alvaro Herrera Munoz
Date:
On Wed, May 28, 2003 at 12:59:56PM +0200, Sailesh Krishnamurthy wrote:

> elog(NOTICE should send NOTICE messages to the psql client (I think !)
> while elog(LOG while only send it to the logfile you might have
> specified while starting the postmaster 

Whether a given elog level is sent to the postmaster log and to the
client, is controlled by client_min_messages and server_min_messages.
At least in recent sources, that is.

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
We take risks not to escape from life, but to prevent life escaping from us.