Skip site navigation (1) Skip section navigation (2)

BUG #1375: Problem with Dollar qouting functions

From: "Tony Caduto" <tony(dot)caduto(at)amsoftwaredesign(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1375: Problem with Dollar qouting functions
Date: 2005-01-08 05:04:22
Message-ID: 200501080504.j0854MEF001092@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1375
Logged by:          Tony Caduto
Email address:      tony(dot)caduto(at)amsoftwaredesign(dot)com
PostgreSQL version: 8.0
Operating system:   Gentoo Linux
Description:        Problem with Dollar qouting functions
Details: 

I restored my 7.4.x database to the latest RC, which has several schemas
each with about 30 to 50 functions.
I pull out the source for one of the functions and build a valid function
structure so I can edit it(in notepad for example), and because this is 8.0
I replace the single qoutes we used to have to use around the function body
with dollar qoutes, specificly $BODY$.

Example:

CREATE or REPLACE FUNCTION system.spsys_user_delete( int4)
RETURNS pg_catalog.void AS
$BODY$
DECLARE
USERID_IN alias for $1;
username varchar;

BEGIN
select user_name from system.system_user_information where user_id =
USERID_IN into username;

update
system.SYSTEM_USER_INFORMATION set deleted = 1 where USER_ID = USERID_IN;

return void;
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE;



I then run my function in my query editor and all the linefeeds are striped
out, so the next time I open it I get the entire function body back as one
long string with all the EOL markers gone.
Here is the interesting part, if I go though and add new EOL markers by
hitting the enter key, then save it, it works without problem and the EOL
markers do not get striped out.

There appears to be a problem with functions that have been restored from
7.4.x and dollar quoting, after it has been saved once, then the EOL markers
replaced the problem goes away.
The issue does not seem to affect new functions created on 8.0.

Responses

pgsql-bugs by date

Next:From: Robert SusslandDate: 2005-01-08 20:42:37
Subject: BUG #1376: configure out of date
Previous:From: Tom LaneDate: 2005-01-07 21:27:08
Subject: Re: Bug in 8.0.0rc3 query planner: constant column in view changes execution plan

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group