This sounds suspiciously similar to the problem I had with initial SQL scripts in MySQL. In my case I was inserting rows into a table and one of the string fields contained %. I had to "escape" the % (using %%). I'm guessing that the SQL isn't directly executed but somehow evaluated in the django.db bowels (didn't bother to track it down).
Is there a way to escape $'s in Postgres SQL (maybe with $$ or \$)? Of course, I could be completely off base here, too... -Dave On Dec 10, 4:01 pm, Raymond Cote <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > I'm having problems loading a custom PostgreSQL trigger function during > syncdb and not sure how to address this: > The function (trimmed down) looks as follows: > > CREATE OR REPLACE FUNCTION probe_data_insert() > RETURNS SETOF trigger AS $$ > > DECLARE > ofs VARCHAR; > > BEGIN > NEW.collected_dt := NEW.received_dt; > RETURN NEW; > END; > $$ LANGUAGE 'plpgsql' VOLATILE; > > When I run that in PgAdmin2, it loads fine. > However, when I try to load it with syncdb, I get the following error: > > Installing custom SQL for data.ProbeData model > Failed to install custom SQL for data.ProbeData model: unterminated > dollar-quoted string at or near "$$ > > DECLARE > ofs VARCHAR;" > LINE 2: RETURNS SETOF trigger AS $$ > > I found one reference on the net regarding the unterminated string that > had to do with an old version of psql on the system. This is a clean OS > install and I checked that psql 8.3.4 is the only one on the system. > > Any idea what I should be doing differently? > Anyone have a sample of a PostgreSQL function that loads properly that > they could share? > > Thanks > --Ray --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---