On Tue, Dec 29, 2009 at 4:44 PM, Bryce Nesbitt wrote:
> Craig is correct in the OP attempt. All but one field is intended to be null
Ah; my misunderstanding, then. Sorry for the noise.
> Duplicate rows, or data in multiple columns, would wreck havoc on the
> scheme. If there is a better way
Craig Ringer wrote:
On 24/12/2009 5:04 AM, Rosser Schwarz wrote:
On Wed, Dec 23, 2009 at 1:44 AM, Craig Ringer
wrote:
Your invocation of COALESCE is incorrect -- it is n-ary, but it
returns its first non-NULL argument.
Yes. That was the point.
I think we're assuming the OP wants different th
On 24/12/2009 5:04 AM, Rosser Schwarz wrote:
On Wed, Dec 23, 2009 at 1:44 AM, Craig Ringer
wrote:
SELECT COALESCE( t_number::text, t:string::text, t_date::text, t_boolean::text)
AS value;
Your invocation of COALESCE is incorrect -- it is n-ary, but it
returns its first non-NULL argument.
On Wed, Dec 23, 2009 at 1:44 AM, Craig Ringer
wrote:
> SELECT COALESCE( t_number::text, t:string::text, t_date::text,
> t_boolean::text) AS value;
Your invocation of COALESCE is incorrect -- it is n-ary, but it
returns its first non-NULL argument. Instead, try:
SELECT
COALESCE(t_number::te
In response to Bryce Nesbitt :
> Dear experts,
>
> This point is confusing me with the || operator. I've got a table with
> "one column per data type", like so:
>
> # \d context_keyvals;
> Table "public.context_keyvals"
>Column|Type | Modifiers
> --
On 23/12/2009 4:34 PM, Bryce Nesbitt wrote:
Dear experts,
This point is confusing me with the || operator. I've got a table with
"one column per data type", like so:
Dare I ask why? What problem are you trying to solve by doing this?
# select context_key,keyname,t_number||t_string||t_date||t
Dear experts,
This point is confusing me with the || operator. I've got a table with
"one column per data type", like so:
# \d context_keyvals;
Table "public.context_keyvals"
Column|Type | Modifiers
-+-+---