Skip to content

Add an input timestamp parameter to ulid_generate #7

Description

@budarin

To generate a check constraint for partitioning tables, it is necessary to be able to create an ulid for a specific datetime like so:

CREATE TABLE "table" (
  id uuid primary key not null default ulid_generate(),
  ...
) partition by range (id);


CREATE TABLE table_2021 partition of "table" for values
  from 
        ulid_generate('2021-01-01 00:00:00')     --0176bb3e-7000-0000-0000-000000000000
  to 
        ulid_generate('2022-01-01 00:00:00');    --017e12ef-9c00-0000-0000-000000000000

(it is also possible with the random part of ulid - it does not matter much)

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