BUG #6295: Update fails on empty concatenated strings - Mailing list pgsql-bugs

From Jonas Forsman
Subject BUG #6295: Update fails on empty concatenated strings
Date
Msg-id 201111160847.pAG8lCdx067272@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #6295: Update fails on empty concatenated strings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      6295
Logged by:          Jonas Forsman
Email address:      jfo123@hotmail.com
PostgreSQL version: 8.4.9
Operating system:   Ubuntu 10.04 LTS
Description:        Update fails on empty concatenated strings
Details:

Field description (note the field name is "comment") :
comment character varying(2048)

sql:
UPDATE user SET comment= E'[2011-11-16] Note to myself no: 171\\n' ||
comment WHERE userid=1

This query fails if comment is an empty string or null.

This works:

UPDATE user SET comment= E'[2011-11-16] Note to myself no: 171\\n' ||
comment || '' WHERE userid=1

pgsql-bugs by date:

Previous
From: "Maksym Boguk"
Date:
Subject: BUG #6296: High level backend-write activity on db
Next
From: Tom Lane
Date:
Subject: Re: BUG #6295: Update fails on empty concatenated strings