X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D871ED1B16B for ; Sat, 15 May 2004 11:27:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 64863-02 for ; Sat, 15 May 2004 11:26:57 -0300 (ADT) Received: from simmts5-srv.bellnexxia.net (simmts5.bellnexxia.net [206.47.199.163]) by svr1.postgresql.org (Postfix) with ESMTP id ACCA8D1B176 for ; Sat, 15 May 2004 11:26:34 -0300 (ADT) Received: from localhost ([67.71.24.121]) by simmts5-srv.bellnexxia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040515142636.MFIM28433.simmts5-srv.bellnexxia.net@localhost>; Sat, 15 May 2004 10:26:36 -0400 Received: from sympatico.ca ([192.168.250.6]) by (8.11.6/8.11.6) with ESMTP id i4FEQag18339; Sat, 15 May 2004 10:26:36 -0400 Message-ID: <40A628CC.9000204@sympatico.ca> Date: Sat, 15 May 2004 10:27:24 -0400 From: Jean-Luc Lachance User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Theodore Petrosky Cc: Stephan Szabo , postgres SQL Subject: Re: where is this problem (trigger) References: <20040515134247.26712.qmail@web41006.mail.yahoo.com> In-Reply-To: <20040515134247.26712.qmail@web41006.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/137 X-Sequence-Number: 17851 Have noticed it is not the same function... Theodore Petrosky wrote: > Great I got the double quotes in the trigger... like > this: > > CREATE FUNCTION notify_jobinfo() RETURNS "trigger" > AS ' > BEGIN > EXECUTE ''NOTIFY > "''||TG_RELNAME||''_''||NEW.jobnumber||''"''; > RETURN NEW; > END > ' LANGUAGE plpgsql; > > and it works great... however, i did a pg_dump of the > db to back it up. On a lark I started looking through > the file and I decided to look at the dumped trigger > and this is what I see. > > -- > -- TOC entry 29 (OID 17180) > -- Name: notify_on_update(); Type: FUNCTION; Schema: > public; Owner: postgres > -- > > CREATE FUNCTION notify_on_update() RETURNS "trigger" > AS ' > BEGIN > EXECUTE ''NOTIFY ''||TG_RELNAME||''_''||NEW.jobnumseq; > RETURN NEW; > END > ' > LANGUAGE plpgsql; > > Ouch... it looks like pg_dump forgot my double quotes. > > Do you have any ideas? If I reimport this dump file > the triggers won't work when it meets a row with a dot > in the column. Of course I can just update my data to > use the underscore instead of the dot..... > > Ted > > > --- Stephan Szabo > wrote: > >>On Wed, 12 May 2004, Theodore Petrosky wrote: >> >> >>>I can not seem to update these rows because of the >> >>dot >> >>>in the jobnumber field. I have found that I can >> >>change >> >>>the dot to an underscore but I thought I would ask >> >>if >> >>>there is a better solution. >>> >>>here is the error: >>> >>>UPDATE jobinfo SET isbilled = false WHERE >> >>jobnumber = >> >>>'1162.01'; >>>ERROR: syntax error at or near ".01" at character >> >>20 >> >>>CONTEXT: PL/pgSQL function "notify_jobinfo" line >> >>2 at >> >>>execute statement >> >>From the docs, it looks like NOTIFY takes an >>identifier >>as a name. Foo_1023.01 is not a valid identifier so >>you >>might want to double quote the string since >>"Foo_1023.01" >>is one. >> >> >>---------------------------(end of >>broadcast)--------------------------- >>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > > > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! - Internet access at a great low price. > http://promo.yahoo.com/sbc/ > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >