On Wednesday, September 11, 2013 2:28:32 PM UTC-7, [email protected] wrote:
>
> Hello,
>
> When I try to insert a record using either the insert or create syntax
>
> MyModel.create(:item1 => item1, :item2 => item2, :pgarray_item => [])
>
> I get the error:
> Sequel::DatabaseError - PG::SyntaxError: ERROR:  syntax error at or near 
> "]"
> LINE 1: ...item1, item2, ARRAY[]::integer...
>
> I am using ruby 1.8.7, postgres 8.3 and sequel 4.2.0
>
> Any help would be greatly appreciated.
>

Interesting.  Looks like PostgreSQL 8.3 and below does not support empty 
arrays via the array constructor syntax.  Compare the following two links:

  
http://www.postgresql.org/docs/8.3/static/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS
  
http://www.postgresql.org/docs/8.4/static/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS

Even though PostgreSQL 8.3 and below are not supported by PostgreSQL 
anymore, Sequel still is supposed to support PostgreSQL 8.2+, so this is 
something that should be fixed.  Try the diff at http://pastie.org/8318314 
and let me know if it works for you.

Thanks,
Jeremy


-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to