Skip to content

Datum #2

Open
Open
@thehydroimpulse

Description

@thehydroimpulse

Need to figure out a good story here. A datum is simply a pointer stored as a uint. Then casted to an appropriate type (in C). Text, for example, is allocated onto the heap using the custom pg_malloc allocator that allocates memory in contexts (regions). This enables it to easily clean up after a misbehaving extension, for example, in one whole swoop, instead of keeping track of a bunch of independent allocations that could never be freed.

Ideally, one could simply do:

Datum::new("foobar");
Datum::new(5i);
Datum::new(true);

Postgres has the concept of:

  • Pass by-value using a fixed length.
  • Pass by-reference using a fixed length.
  • Pass by-reference using a variable length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions