Re: need help

From: Neil Conway <neilc(at)samurai(dot)com>
To: vamsi krishna <gvkbtech(at)yahoo(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: need help
Date: 2005-06-04 04:27:03
Message-ID: 42A12D97.1090804@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

vamsi krishna wrote:
> hi,
> i want to know how CREATE table (creating a
> relation)

See DefineRelation() in backend/commands/tablecmds.c, and the routines
it calls.

> also i want to know how postgres parser the
> input(create table) and how is this connected to the
> create table source code files.

See the CreateStmt production in backend/parser/gram.y (circa line 1509
in current sources). CREATE TABLE is a utility statement, so a
high-level view of the processing is:

- the query string is scanned (scan.l) and parsed (gram.y), producing a
raw parse tree
- in the analysis phase, transformCreateStmt() does a few simple
transformations of the raw parse tree and produces a Query representing
the CREATE TABLE utility statement
- ProcessUtility() in backend/tcop/utility.c invokes DefineRelation()

-Neil

In response to

  • need help at 2005-06-02 15:43:26 from vamsi krishna

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-06-04 04:37:35 Re: Precedence of %
Previous Message Bruce Momjian 2005-06-04 03:56:46 Precedence of %