need help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

need help

Vamsi Krishna-11
hi,
   i want to know how CREATE table (creating a
relation)

works in Postgres.where can i find this in source
code.

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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org
Reply | Threaded
Open this post in threaded view
|

Re: need help

Neil Conway-2
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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [hidden email] so that your
      message can get through to the mailing list cleanly