-
Notifications
You must be signed in to change notification settings - Fork 966
Open
Labels
Description
Version
1.30.0
What happened?
I have a table with an ltree column named path. When trying to use :copyfrom to copy data into the table, I get error:
unsupported ltree version number 108
The ltree send and receive [0] functions in postgres expect the first byte to be a version number, and the only valid version number is 1. In my case, the first letter of my path is l (lowercase L), which is ASCII 108. So, the first byte of my ltree column is not being set to 1 on the wire, but rather is being set to the first byte of the contents.
[0] https://doxygen.postgresql.org/ltree__io_8c.html#a734db337a5f59ca8ea10022715958c50
Relevant log output
Database schema
CREATE TABLE organization (
id UUID PRIMARY KEY,
kind UUID REFERENCES org_kind(id),
path LTREE UNIQUE NOT NULL
);SQL queries
-- name: CopyOrgs :copyfrom
INSERT INTO organization(id, kind, path)
VALUES($1, $2, $3);Configuration
version: "2"
servers:
- engine: postgresql
uri: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"
sql:
- engine: "postgresql"
queries: "sql/queries"
schema: "sql/migrations"
gen:
go:
emit_interface: true
package: "db"
sql_package: "pgx/v5"
out: "internal/db"
database:
managed: true
rules:
- sqlc/db-preparePlayground URL
No response
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go