Re: postgresMain() function

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: "'mohsen soodkhah mohammadi'" <mohsensoodkhah(at)gmail(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgresMain() function
Date: 2013-07-08 03:14:34
Message-ID: 00ea01ce7b89$462ea0c0$d28be240$@kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hari Babu 2013-07-08 04:08:47 Re: WAL
Previous Message David Fetter 2013-07-08 01:37:26 Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]