Thread: how many changes about backend mode from 7.2.2 to 8.4.0?

how many changes about backend mode from 7.2.2 to 8.4.0?

From
土卜皿
Date:
<div dir="ltr"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida
Grande',sans-serif;font-size:16px">hi,all</span><div id="yui_3_16_0_1_1405040717423_9995"
style="color:rgb(0,0,0);font-family:HelveticaNeue,'HelveticaNeue',Helvetica,Arial,'Lucida
Grande',sans-serif;font-size:16px">NOTE: fedora 17 x86_64, 7.2.2 can not be compiled in the env, I choose 8.4.0 because
Ithink old version is easier to understand than newer version! </div><div id="yui_3_16_0_1_1405040717423_10009"
style="color:rgb(0,0,0);font-family:HelveticaNeue,'HelveticaNeue',Helvetica,Arial,'Lucida
Grande',sans-serif;font-size:16px"><br/><div class="" id="yiv7777781553"><div class=""><div class=""
style="font-size:12pt"><divclass="" id="yiv7777781553yui_3_16_0_1_1405031754114_4352"></div></div></div></div><div
class=""id="yui_3_16_0_1_1405040717423_10010"> I want to study pg's external sort (in tuplesort.c )through 8.4.0's
sourcecode, and use ddd to do it, according to <a class=""
href="http://www-inst.eecs.berkeley.edu/~cs186/fa04/usingddd.pdf"rel="nofollow"
style="margin:0px;padding:0px;background-color:rgba(0,0,0,0);color:rgb(25,106,212);outline:none"
target="_blank">usingddd-postgres</a> 'sdescription:</div><div class="" id="yui_3_16_0_1_1405040717423_10011"><br
/></div><divclass="" id="yui_3_16_0_1_1405040717423_10012"> In the backend mode, you <span class=""
style="font-size:12pt">don’tcreate a separate postmaster process and don’t use psql at all. Instead, you start up
postgresfrom the</span></div><div class="" id="yui_3_16_0_1_1405040717423_10015">command line and directly interact
withit.</div><div class="" id="yui_3_16_0_1_1405040717423_10016"><br class="" /></div><div class=""
id="yui_3_16_0_1_1405040717423_10017">and after starting  postgres in ddd, a backend interactive interface works as
doc'sFigure 5, and I found version 7.2.2's source postgres'c has backend interactive interface, but my version is
8.4.0,which seemly has not backend interactive interface, so I want to ask </div><div class=""
id="yui_3_16_0_1_1405040717423_10018"><br/></div><div class="" id="yui_3_16_0_1_1405040717423_10019">(1) whether I must
useanother method to debug relative external sort code (in tuplesort.c ), as some post said that I can execute "psql,
select <spanclass="" id="yui_3_16_0_1_1405040717423_10020"
style="font-weight:bold;color:rgb(84,84,84);font-family:arial,sans-serif;font-size:13px;line-height:18.200000762939453px">select
pg_backend_pid</span><spanclass="" id="yui_3_16_0_1_1405040717423_10026"
style="color:rgb(84,84,84);font-family:arial,sans-serif;font-size:13px;line-height:18.200000762939453px">(),and gdb
pid"</span><spanclass="" style="font-size:12pt">  , any advice will be appreciated! </span></div><div class=""
id="yui_3_16_0_1_1405040717423_10021"><spanclass="" style="font-size:12pt"><br /></span></div><div class=""
id="yui_3_16_0_1_1405040717423_10023"><spanclass="" id="yui_3_16_0_1_1405040717423_10022" style="font-size:12pt">BEST
REGARDS</span></div><divclass="" id="yui_3_16_0_1_1405040717423_10024">Dillon Peng</div></div></div> 

Re: how many changes about backend mode from 7.2.2 to 8.4.0?

From
Michael Paquier
Date:
On Fri, Jul 11, 2014 at 10:50 AM, 土卜皿 <pengcz.nwpu@gmail.com> wrote:
> NOTE: fedora 17 x86_64, 7.2.2 can not be compiled in the env, I choose 8.4.0
> because I think old version is easier to understand than newer version!
Are you aware that Postgres 7.2 has been released in 2002? It is EOL
(end-of-life) since 2005 by looking at the release notes.

> I want to study pg's external sort (in tuplesort.c )through 8.4.0's source
> code, and use ddd to do it, according to usingddd-postgres 's description:
If you are planning to do some development in the future with or for
Postgres, you would get a better insight by looking at more recent
code. Here are some guidelines for example to use git, which is really
helpful as a base infrastructure when studying the code:
https://wiki.postgresql.org/wiki/Working_with_GIT

Hope this helps.
Regards,
--
Michael



Re: how many changes about backend mode from 7.2.2 to 8.4.0?

From
土卜皿
Date:
hi,
  thanks a lot!


2014-07-11 10:10 GMT+08:00 Michael Paquier <michael.paquier@gmail.com>:
On Fri, Jul 11, 2014 at 10:50 AM, 土卜皿 <pengcz.nwpu@gmail.com> wrote:
> NOTE: fedora 17 x86_64, 7.2.2 can not be compiled in the env, I choose 8.4.0
> because I think old version is easier to understand than newer version!
Are you aware that Postgres 7.2 has been released in 2002? It is EOL
(end-of-life) since 2005 by looking at the release notes.
I know the released time.
 

> I want to study pg's external sort (in tuplesort.c )through 8.4.0's source
> code, and use ddd to do it, according to usingddd-postgres 's description:
If you are planning to do some development in the future with or for
Postgres, you would get a better insight by looking at more recent
code. Here are some guidelines for example to use git, which is really
helpful as a base infrastructure when studying the code:
https://wiki.postgresql.org/wiki/Working_with_GIT

seemly the wiki you said has no information about debug
 
I am sorry, maybe I should make my question clearer, I only want to know, in 8.4.0 or newer version,
 whether I can debug posgres in the bare backend mode (in  usingddd-postgres, he said that "
There are two ways to debug postgres (a) in the interactive mode and (b) in the bare backend mode"
), if yes, what should I do?  thanks in advance!

BEST REGARDS
Dillon

Re: how many changes about backend mode from 7.2.2 to 8.4.0?

From
Tom Lane
Date:
土卜皿 <pengcz.nwpu@gmail.com> writes:
> I am sorry, maybe I should make my question clearer, I only want to know,
> in 8.4.0 or newer version,
>  whether I can debug posgres in the bare backend mode (in  usingddd-postgres
> <http://www-inst.eecs.berkeley.edu/~cs186/fa04/usingddd.pdf>, he said that "
> There are two ways to debug postgres (a) in the interactive mode and (b) in
> the bare backend mode"

Yeah, that still works as well or poorly as it ever did, though the
startup process is a bit different: you need to say "postgres --single"
to launch a standalone backend.

But really, nobody does it that way anymore.  There is no advantage to it,
unless maybe you're trying to debug a startup-time crash.  The standalone
backend interface is very unpleasant to use compared to psql: no readline
command editing, no nice formatting of output, no tab completion or help,
etc etc.  For debugging of normal query operation it's far better to fire
up a psql session and then gdb the connected backend process.

There's more info here:
https://wiki.postgresql.org/wiki/Developer_FAQ#gdb

and if gdb isn't giving you useful symbolic information, see
the setup tips here:
https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD
        regards, tom lane



Re: how many changes about backend mode from 7.2.2 to 8.4.0?

From
土卜皿
Date:
hi, tom
  thank you very much! this is what I wanted! 

Dillon


2014-07-11 10:59 GMT+08:00 Tom Lane <tgl@sss.pgh.pa.us>:
土卜皿 <pengcz.nwpu@gmail.com> writes:
> I am sorry, maybe I should make my question clearer, I only want to know,
> in 8.4.0 or newer version,
>  whether I can debug posgres in the bare backend mode (in  usingddd-postgres
> <http://www-inst.eecs.berkeley.edu/~cs186/fa04/usingddd.pdf>, he said that "
> There are two ways to debug postgres (a) in the interactive mode and (b) in
> the bare backend mode"

Yeah, that still works as well or poorly as it ever did, though the
startup process is a bit different: you need to say "postgres --single"
to launch a standalone backend.

But really, nobody does it that way anymore.  There is no advantage to it,
unless maybe you're trying to debug a startup-time crash.  The standalone
backend interface is very unpleasant to use compared to psql: no readline
command editing, no nice formatting of output, no tab completion or help,
etc etc.  For debugging of normal query operation it's far better to fire
up a psql session and then gdb the connected backend process.

There's more info here:
https://wiki.postgresql.org/wiki/Developer_FAQ#gdb

and if gdb isn't giving you useful symbolic information, see
the setup tips here:
https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD

                        regards, tom lane