question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: operator does not exist: uuid = character varying Or ERROR: column "mediaType" is of type medias_mediatype_enum but expression is of type character varying

See original GitHub issue

I am using

  • Node [14]
  • Server-less [2.41.1]
  • Database Engine: [aws-aurora-postgres]
  • TypeORM Version: [0.2.32]
  • Driver Version [2.1.0]

I am getting this error “ERROR: operator does not exist: uuid = character varying” When i try to find a record or try to save the record. If I downgrade the driver to “2.0.0” i dont get this error but then i started getting errors abount enum type casting. Error is “ERROR: column “mediaType” is of type medias_mediatype_enum but expression is of type character varying”.

It worked fine with node and express project but started causing issues on Server-less Project which is using Typescript, and Webpack

I have set the formatOptions in connection options as

formatOptions: {
    // additional format options to pass to the Data API client
    castParameters: true,
}

This is my Root Entity

import {
  Column,
  CreateDateColumn,
  DeleteDateColumn,
  ManyToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';
import { Brand, Nullable } from '../types';
import { EntityUsers } from './users.entity';

export abstract class RootEntity<X extends Brand<string, string>> {
  @PrimaryGeneratedColumn('uuid')
  id!: X;

  @ManyToOne('EntityUsers')
  createdBy!: EntityUsers;

  @Column({ nullable: false })
  createdById!: EntityUsers['id'];

  @CreateDateColumn()
  createdAt!: Date;

  @DeleteDateColumn()
  deletedDate!: Date;
}

export interface IRootHistory<
  U extends Brand<string, string>,
  T extends RootEntity<U>
> {
  recordId: U;
}

here it is my actual entitiy

import { Column, Entity, PrimaryGeneratedColumn, VersionColumn } from 'typeorm';
import { ONE_LINK_STAN_LENGTH } from '../constants/db-constants';
import { Brand } from '../types';
import { RootEntity } from './root-entity';

export type EntityOneLinkStanCountersId = Brand<
  string,
  'OneLinkStanCountersId'
>;

abstract class EntityOneLinkStanCountersBase {
  @PrimaryGeneratedColumn('uuid')
  id!: EntityOneLinkStanCountersId;

  @Column({ type: 'date', nullable: false })
  date!: Date;

  @Column({ type: 'integer', width: ONE_LINK_STAN_LENGTH, nullable: false })
  counter!: number;
}

@Entity('oneLinkStanCounters')
export class EntityOneLinkStanCounters extends EntityOneLinkStanCountersBase {
  @VersionColumn()
  version!: number;
}

This is how i am trying to get data

import { getRepository } from 'typeorm';


const StanRepository = getRepository(EntityOneLinkStanCounters);
  const stan = await StanRepository.findOne({ id });
  if (!stan) return null;
  return stan;

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghanievcommented, Jun 22, 2021

@feroz-shamsi go ahead and contribute, whats problem?

0reactions
ejaz1977pkcommented, Jul 6, 2021

@ghaniev Hi Ghaniev

First, thank you for informing about the value for contributions to open source projects as well as the role of ownership, however the underlying question here is pertaining to the possible fix of the issue, if it is part of ay of the release.

If it isn’t, the answer is a simple no.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR: operator does not exist: character varying = uuid - ...
Try defining the type for the field as Hibernate unable to understand the type by annotating field with @Type(type="org.hibernate.type.
Read more >
Problem using UUID parameter in PostgreSQL SQL ...
PSQLException: ERROR: operator does not exist: uuid = character varying. Hint: No operator matches the given name and argument type(s).
Read more >
operator does not exist: uuid = text) - Questions
Hello everyone! Faced the following problem in Postgres node. This query works: SELECT wt.uuid AS wt_uuid, ct.uuid AS ct_uuid, ...
Read more >
org.postgresql.util.psqlexception: error: operator does not ...
PSQLException: ERROR: operator does not exist: character varying = bytea Hint: No operator matches the given name and argument types. You might need...
Read more >
RPostgreSQL and DBI: "operator does not exist: uuid = text"
You can see the code they're using to generate this error here ... ERROR: column "a" is of type uuid but expression is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found