Help needed in testing my code.

Started by Srikanth Mover 22 years ago8 messages
#1Srikanth M
srikanth_m@students.iiit.net

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

#2Sailesh Krishnamurthy
sailesh@cs.berkeley.edu
In reply to: Srikanth M (#1)
Re: Help needed in testing my code.

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

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

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Srikanth M (#1)
Re: Help needed in testing my code.

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.

Show quoted text

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

#4Kris Jurka
books@ejurka.com
In reply to: Christopher Kings-Lynne (#3)
Re: Help needed in testing my code.

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:

Show quoted text

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

#5Srikanth M
srikanth_m@students.iiit.net
In reply to: Sailesh Krishnamurthy (#2)
Re: Help needed in testing my code.

Dear Sir
I 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 ;-)

#6Sailesh Krishnamurthy
sailesh@cs.berkeley.edu
In reply to: Srikanth M (#5)
Re: Help needed in testing my code.

"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 will use 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 should i 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

#7Dave Cramer
dave@fastcrypt.com
In reply to: Sailesh Krishnamurthy (#6)
describe statement

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

#8Alvaro Herrera Munoz
alvherre@dcc.uchile.cl
In reply to: Sailesh Krishnamurthy (#6)
Re: Help needed in testing my code.

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.