Skip site navigation (1) Skip section navigation (2)

Bug #811: Using || with char and char varying

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #811: Using || with char and char varying
Date: 2002-11-07 09:04:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
John Lim (heyjohnlim(at)yahoo(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Using || with char and char varying

Long Description
The following sql:

  select firstname||lastname from adoxyz;

generates this error:

PostgreSQL said: ERROR: Unable to identify an operator '||' for types 'character' and 'character varying' You will have to retype this query using an explicit cast 

Based on the table:

CREATE TABLE "adoxyz" (
   "id" int4,
   "firstname" char(24),
   "lastname" varchar,
   "created" date

Although this can be fixed by a typecast, porting sql (which i am doing) from other databases such as oracle/mysql is a big pain.

Thanks for looking into this.

Sample Code

No file was uploaded with this report

pgsql-bugs by date

Next:From: Fabien FischerDate: 2002-11-07 14:54:52
Subject: I can't start postgres anymore
Previous:From: LarsDate: 2002-11-07 08:25:23
Subject: like not using indexes in 7.3b5?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group