Sylvain
Sylvain

Reputation: 552

Which part of PostgreSQL code is handling type definition?

In PostgreSQL when I call NUMERIC(10,2) to define a variable type. Which part of the PostgreSQL C code is handling it?

I am interested in knowing where the precision and scale are handled.

Upvotes: 0

Views: 29

Answers (1)

Craig Ringer
Craig Ringer

Reputation: 325141

Lots of parts.

The lexer and parser transforms it into a type name and type modifier.

The system catalogs and syscache look up numeric to find the matching type oid.

The numeric.c code handles the actual type input/output and operators, and interprets the type modifier.

The index access methods and index operator classes handle selection of operators for comparisons etc.

Upvotes: 2

Related Questions