Re: postgresMain() function - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: postgresMain() function
Date
Msg-id 00ea01ce7b89$462ea0c0$d28be240$@kapila@huawei.com
Whole thread Raw
In response to postgresMain() function  (mohsen soodkhah mohammadi <mohsensoodkhah@gmail.com>)
List pgsql-hackers
On Sunday, July 07, 2013 3:46 PM mohsen soodkhah mohammadi wrote:

> hello .
> In Postgres.c we have a switch for firstchar .  one of case of them is :
case 'Q' that is for simple queries.
> I want to know the other cases were for what operations .
> and:
> is the case with  'Q' parameter for DDL and DML commands?

SQL Commands can be executed using 2 sub-protocols, 'simple query' ,
'extended query'

In 'simple query' protocol, the frontend just sends a textual query string,
which is parsed and immediately executed by the backend.
In 'extended query' protocol, processing of queries is separated into
multiple steps: parsing, binding of parameter values, and execution.

'Q' message is used for 'simple query'. It can be used for any SQL command
'P', 'B', 'E' are most important messages for 'extended query', these are
used for prepared statements.

You can read the below link for detailed message flow description:
http://www.postgresql.org/docs/devel/static/protocol.html

With Regards,
Amit Kapila.




pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]
Next
From: Hari Babu
Date:
Subject: Re: WAL