Manlio Perillo wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi.
>
> I'm experiencing a strange problem with a multi INSERT statement.
>
> Strange because I'm unable to reproduce it.
>
> Here are both SQLAlchemy (trunk) and PostgreSQL (8.3) logs:
>
> sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax error at
> position 9 near "-"
>  "INSERT INTO cms_categories (type, category_slug, category,
> description, seq) VALUES (%(type)s, %(category_slug)s, %(category)s,
> %(description)s, nextval('cms_categories_seq'))" [{'category':
> 'Normativa e legislazione', 'type': 'article', 'description': u"La
> legislazione italiana e la legislazione in altri paesi comunitari. Il
> diritto internazionale e transnazionale: cosa bisogna fare se si \xe8
> Italiani all'estero o Italiani residenti in Italia ma che intendono
> sposare cittadini di altre nazionalit\xe0.\n", 'category_slug':
> 'normativa-e-legislazione'}, {'category': 'Riti e religioni', 'type':
> 'article', 'description': u"Le principali religioni monoteistiche e i
> riti previsti in ciascuna. I riti misti, le compatibilit\xe0 e
> incompatibilit\xe0, le conversioni. L'approccio razionalistico, il
> matrimonio civile e i  patti sociali.\n", 'category_slug':
> 'riti-e-religioni'}] ... and a total of 17 bound parameter sets
>
>
> 2010-02-01 16:08:14 CET ERROR:  syntax error at position 9 near "-"
> 2010-02-01 16:08:14 CET STATEMENT:  INSERT INTO cms_categories (type,
> category_slug, category, description, seq) VALUES (E'article',
> E'normativa-e-legislazione', E'Normativa e legislazione', E'La
> legislazione italiana e la legislazione in altri paesi comunitari. Il
> diritto internazionale e transnazionale: cosa bisogna fare se si è
> Italiani all''estero o Italiani residenti in Italia ma che intendono
> sposare cittadini di altre nazionalità.
>       ', nextval('cms_categories_seq'))
>
>
> The problem is probably with the tab character in the category field.
> I have no idea why there is a tab character there.
>
> Data is loaded from a YAML file, but even if I use the same data I'm not
> able to reproduce the problem.
> The original program loads, in an unique transaction, several fixtures.

not sure either.  My approach here would be to slowly walk it back to a
simpler case.   Edit the YAML file to a smaller and smaller set of data,
removing elements one at a time, including fewer records, fewer characters
within each record, reduction of non-ascii chars, until the element that
creates the problem is identified.


>
>
> Thanks   Manlio
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAktm/ZMACgkQscQJ24LbaUToxgCgmM8ADXGUN8hJqHCsLyYzWSDs
> sXMAn2mzj+0haQyAa2mfP01N4mouJ/rw
> =HETb
> -----END PGP SIGNATURE-----
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to