skip to Main Content

In PostgreSQL source code and its extensions like Apache/age I find Datum data type is used everywhere. I’d like to know where it’s defined and what it’s used for.

2

Answers


  1. It’s the backend-internal representation of a single value of any SQL
    data type. The code using the Datum has to know which type it is,
    since the Datum itself doesn’t contain that information. Usually,
    C code will work with a value in a "native" representation, and then
    convert to or from Datum in order to pass the value through
    data-type-independent interfaces.

    Login or Signup to reply.
  2. In simpler terms, it’s a unit of data stored in the database. When you work with SQL queries on a PostgreSQL database, you interact with Datums indirectly through SQL queries and data manipulation commands. You can perform operations on them like selecting, inserting, updating, or deleting them within tables and can even transform them using the expressions.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search