Skip to content

byte-vector-to-hexstring don't strip leading "x" #1758

Closed

Description

@autowp
create table users
(
  ...
  uuid binary(16) null,
)
CAST
  column users.uuid to uuid drop typemod using byte-vector-to-hexstring,

Result:

ERROR: invalid input syntax for type uuid: "xa3cda7d500a64111814659127a8d5e42"
  Where: COPY users, line 1, column uuid: "xa3cda7d500a64111814659127a8d5e42"

Activity

  1. dimitri commented on Jul 15, 2026

    @dimitri
    Owner

    PR #1761 adds two fixes for this:

    1. byte-vector-to-hexstring is fixed — it now strips the bare X prefix that MySQL binary columns produce, so the existing cast in the issue will work once the fix is in.

    2. New binary-to-uuid transform — produces the canonical hyphenated UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) directly, which is cleaner:

    CAST
      column users.uuid to uuid drop typemod using binary-to-uuid,

    Once the PR is merged, CI will automatically publish an updated pgloader.jar at:

    https://github.com/dimitri/pgloader/releases/download/v4-dev/pgloader.jar

    You can download and run it with:

    wget https://github.com/dimitri/pgloader/releases/download/v4-dev/pgloader.jar
    java -jar pgloader.jar your.load

    See install.rst for full installation details including the Java version requirement (17+).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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