[Nitro] Latest darcs pull gives errors on postgresql

Bill Kelly billk at cts.com
Mon Aug 27 18:25:34 EDT 2007


From: George Moschovitis
> 
> > I saw a patch related to table name quoting, so I guess this
> > is related?
> 
> Yeap, this is related. Jonathan, is it possible that you have a look at this?

For what it's worth, I was able to kludge around the problem by adding 
the following line to #enchant in og/lib/og/adapter/postgresql.rb:


  def enchant(klass, manager)
    super

    pk = klass.primary_key

    seq = "#{klass::OGTABLE}_#{pk}_seq"
    seq.tr!('"', '')  ####### <-- ADDED THIS LINE to strip quotes on 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


Regards,

Bill




More information about the Nitro-general mailing list