Re: [GENERAL] quoting values magic

2009-05-26 Thread Brandon Metcalf
t == t...@sss.pgh.pa.us writes: t> Brandon Metcalf writes: t> > d == dal...@solfertje.student.utwente.nl writes: t> > d> On May 26, 2009, at 6:37 PM, Brandon Metcalf wrote: t> > d> > The issue here is that these reduce back to my original problem. For t> > d> > example, if I use a CASE

Re: [GENERAL] quoting values magic

2009-05-26 Thread Tom Lane
Brandon Metcalf writes: > d == dal...@solfertje.student.utwente.nl writes: > d> On May 26, 2009, at 6:37 PM, Brandon Metcalf wrote: > d> > The issue here is that these reduce back to my original problem. For > d> > example, if I use a CASE statement and I fall through to the ELSE, > d> > then

Re: [GENERAL] quoting values magic

2009-05-26 Thread Brandon Metcalf
d == dal...@solfertje.student.utwente.nl writes: d> On May 26, 2009, at 6:37 PM, Brandon Metcalf wrote: d> > j> option 2: case when '$length' = '' ... d> > d> > j> you can use case like this: d> > d> > j>UPDATE foo d> > j> SET d> > j>pattern = '$pattern', d> > j>s

Re: [GENERAL] quoting values magic

2009-05-26 Thread Alban Hertroys
On May 26, 2009, at 6:37 PM, Brandon Metcalf wrote: j> option 2: case when '$length' = '' ... j> you can use case like this: j>UPDATE foo j> SET j>pattern = '$pattern', j>shape = '$shape', j>length = case when '$length'='' then length else '$length' end, j

Re: [GENERAL] quoting values magic

2009-05-26 Thread Brandon Metcalf
j == ja...@xnet.co.nz writes: j> On 2009-05-22, Brandon Metcalf wrote: j> > Assume I have an UPDATE statement that looks like j> > j> > UPDATE foo j> > SET j> > pattern = '$pattern', j> > shape = '$shape', j> > length = $length, j> > comment = '$comment'

Re: [GENERAL] quoting values magic

2009-05-26 Thread Jasen Betts
On 2009-05-22, Brandon Metcalf wrote: > Assume I have an UPDATE statement that looks like > > UPDATE foo > SET > pattern = '$pattern', > shape = '$shape', > length = $length, > comment = '$comment' > WHERE foo_id = $foo_id > > and length is defined as NUMERIC.

Re: [GENERAL] quoting values magic

2009-05-22 Thread Craig Ringer
Brandon Metcalf wrote: > Assume I have an UPDATE statement that looks like > > UPDATE foo > SET > pattern = '$pattern', > shape = '$shape', > length = $length, > comment = '$comment' > WHERE foo_id = $foo_id > > and length is defined as NUMERIC. Is there any

[GENERAL] quoting values magic

2009-05-22 Thread Brandon Metcalf
Assume I have an UPDATE statement that looks like UPDATE foo SET pattern = '$pattern', shape = '$shape', length = $length, comment = '$comment' WHERE foo_id = $foo_id and length is defined as NUMERIC. Is there any kind of magic that would allow me to use the