2011/4/8 Louise-Amélie Schmitt <louise-amelie.schm...@embl.de>:
> Hello everyone
>
> I just met a huge problem concerning the database. I'm currently trying
> to transfer my data from MySQL to PostgreSQL by writing a Perl script
> that would do the job.
>
> Here is the issue: In the "form_definition" table, one of the field
> identifiers is "desc", which is a reserved SQL keyword used for ordering
> values. Therefore, There's currently no way of making any query of the
> type "INSERT INTO table_name (<identifiers list>) VALUES (<values
> list>);" which is a big handicap in this context, since the order of the
> identifiers list we dynamically retrieve is not necessarily (and seldom)
> the right order.
>
> Is there a way to fix this issue without blowing everything up?

You need to quote the identifiers.  A simple example using "desc" as a
column name:

sdavis=# create table test_table(
id int,
desc varchar);
ERROR:  syntax error at or near "desc"
LINE 3: desc varchar);
        ^
sdavis=# create table test_table(
id int,
"desc" varchar);
CREATE TABLE

Hope that helps.

Sean

___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/

Reply via email to