Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Development Guide Postgres

Austin Bonander edited this page Mar 30, 2020 · 1 revision

There's two main places to get important implementation details for Postgres types:

https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat

This is the seed data for the pg_catalog.pg_type table which contains the OIDs for built-in types as well as the routines used to [de]serialize them. You want to look for the typreceive and typsend keys for the type; these are the names of functions, usually implemented in C code, used to marshall and unmarshall types for the binary protocol.

https://github.com/postgres/postgres/tree/master/src/backend/utils/adt

This is where a bunch of building-block functions reside for all the built-in types, including stuff like the implementation of arithmetic for the NUMERIC fixed-point decimal type, as well as routines for marshalling and unmarshalling all the built-in types. The latter are usually named [type name]_send and [type name]_receive, respectively.

Clone this wiki locally

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /