Search code examples
databasepostgresqlsql-insertprisma

E22021: Character not in repertoire


I want to add an entry with the WebUI Prisma Studio to the database until i have set up a form to do so. The database is postgresql hosted at vercel and in version 15. The table i want to insert to is Todo with the following model:

model Todo {
  id              String   @id @default(cuid())
  title           String
  content         String?
  publicationDate DateTime @default(now())
  dueDate         String?
  finished        Boolean  @default(false)
  author          User?    @relation(fields: [authorId], references: [id])
  authorId        String?
}

However, there is a byte sequence which seems to be not valid: "0x00"

I want to enter the following data:

  • 1
  • Test
  • Test sth
  • 2023-10-09T22:00:00.000Z
  • 10.10.23
  • false
  • marian-l
  • cljop1hlc0000y8twqe4ee4ao

I can confirm that User and its related fields are not problematic because there are already entries of these in my db. so whats the problem here?


Solution

  • The documentation says:

    Regardless of the specific character set, the character with code zero (sometimes called NUL) cannot be stored.

    Zero bytes can be stored as binary data with data type bytea, but they don't make a lot of sense in strings.