[Nitro] invalid format for pg sequence query - SELECTnextval('"ogsimpletest"_oid_seq')
Bill Kelly
billk at cts.com
Mon Dec 17 18:54:43 EST 2007
From: George Moschovitis
>
> can someone with pg provide a fix for this?
I'm not sure what the ideal fix is. But for what it's worth,
I'm still using the simplistic fix I posted here back in July:
def enchant(klass, manager)
super
pk = klass.primary_key
seq = "#{klass::OGTABLE}_#{pk}_seq"
seq.tr!('"', '') # %%BWK 070827 -- added this kludge to strip quotes from table name
pkann = klass.ann(pk)
unless pkann[:sequence]
if pkann[:sql] =~ /SERIAL/i
klass.ann(pk, {:sequence => seq})
else
klass.ann(pk, {:sequence => false})
end
end
end
^^^^ I just strip the quotes wholesale.
Regards,
Bill
More information about the Nitro-general
mailing list