Re: [GENERAL] Problems with '||' concatenation operator.

From: Stuart Rison <stuart(at)ludwig(dot)ucl(dot)ac(dot)uk>
To: Beth Strohmayer <strohmayer(at)itd(dot)nrl(dot)navy(dot)mil>, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Problems with '||' concatenation operator.
Date: 1999-05-18 16:50:22
Message-ID: v04020a06b36746d83f4f@[128.40.242.190]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>Beth Strohmayer wrote
>
>>cgh=> select chromosome || arm as locus from experiment;
>>ERROR: There is more than one possible operator '||' for types 'varchar'
>>and 'b
>>pchar'
>> You will have to retype this query using an explicit cast
>>cgh=>
>
>Try select chromosome || varchar(arm) as locus from experiment;
>

Doesn't work for me,

cgh=> select chromosome || varchar(arm) as locus from experiments;
ERROR: parser: Syntax error at or near "arm"

neither does select chromosome || arm::varchar as locus from experiment;

but the solution is clearly in some form of casting!

I'm using PG 6.4, perhaps it's a version thing?

regards,

S.

+-------------------------+--------------------------------------+
| Stuart Rison | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street |
| Tel. (0171) 878 4041 | London, W1P 8BT, UNITED KINGDOM. |
| Fax. (0171) 878 4040 | stuart(at)ludwig(dot)ucl(dot)ac(dot)uk |
+-------------------------+--------------------------------------+

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ross J. Reedstrom 1999-05-18 17:20:55 Re: [GENERAL] select from into question
Previous Message Stuart Rison 1999-05-18 15:29:05 Problems with '||' concatenation operator.