Unix Technical Forum

7.4.6 to 8.2.5 - ' changes to $_$

This is a discussion on 7.4.6 to 8.2.5 - ' changes to $_$ within the Pgsql General forums, part of the PostgreSQL category; --> function from 7.4.x postgres CREATE FUNCTION update_dns(text, text) RETURNS integer AS 'UPDATE domain_details SET domain = $2 WHERE domain ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 12:18 AM
Steve Clark
 
Posts: n/a
Default 7.4.6 to 8.2.5 - ' changes to $_$


function from 7.4.x postgres

CREATE FUNCTION update_dns(text, text) RETURNS integer
AS 'UPDATE domain_details SET domain = $2 WHERE domain = $1;
DELETE from domains where domain = $1;
SELECT 1 AS ignore;'
LANGUAGE sql;

I load it into 8.2.5 - then dump it out and it is changed to


CREATE FUNCTION update_dns(text, text) RETURNS integer
AS $_$UPDATE domain_details SET domain = $2 WHERE domain = $1;
DELETE from domains where domain = $1;
SELECT 1 AS ignore;$_$
LANGUAGE sql;

notice $_$ where the single ' use to be.

Is there some way to keep this from happening?

The reason is we have systems in the field that have configuration
information stored in 7.4.x.
We want to upload that db info load it into an 8.2.5 db massage it
then send it back to the unit
in the field. I realize there are things I am going to have to fix up
in the 8.2.5 dump to be able to load
it back into the 7.4.x db but I want to minimize that as much as possible.

We have some units in the field running 8.1.3 and it does not change
the ' to $_$.


Thanks,
Steve

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 12:18 AM
Bricklen Anderson
 
Posts: n/a
Default Re: 7.4.6 to 8.2.5 - ' changes to $_$

Steve Clark wrote:
>
> function from 7.4.x postgres
>
> CREATE FUNCTION update_dns(text, text) RETURNS integer
> AS 'UPDATE domain_details SET domain = $2 WHERE domain = $1;
> DELETE from domains where domain = $1;
> SELECT 1 AS ignore;'
> LANGUAGE sql;
>
> I load it into 8.2.5 - then dump it out and it is changed to
>
>
> CREATE FUNCTION update_dns(text, text) RETURNS integer
> AS $_$UPDATE domain_details SET domain = $2 WHERE domain = $1;
> DELETE from domains where domain = $1;
> SELECT 1 AS ignore;$_$
> LANGUAGE sql;
>
> notice $_$ where the single ' use to be.
>
> Is there some way to keep this from happening?
>
> The reason is we have systems in the field that have configuration
> information stored in 7.4.x.
> We want to upload that db info load it into an 8.2.5 db massage it then
> send it back to the unit
> in the field. I realize there are things I am going to have to fix up in
> the 8.2.5 dump to be able to load
> it back into the 7.4.x db but I want to minimize that as much as possible.
>
> We have some units in the field running 8.1.3 and it does not change the
> ' to $_$.
>
>
> Thanks,
> Steve


I think "--disable-dollar-quoting" will work. (pg_dump --help)

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 12:18 AM
Steve Clark
 
Posts: n/a
Default Re: 7.4.6 to 8.2.5 - ' changes to $_$

Bricklen Anderson wrote:
> Steve Clark wrote:
>
>>function from 7.4.x postgres
>>
>>CREATE FUNCTION update_dns(text, text) RETURNS integer
>> AS 'UPDATE domain_details SET domain = $2 WHERE domain = $1;
>> DELETE from domains where domain = $1;
>> SELECT 1 AS ignore;'
>> LANGUAGE sql;
>>
>>I load it into 8.2.5 - then dump it out and it is changed to
>>
>>
>>CREATE FUNCTION update_dns(text, text) RETURNS integer
>> AS $_$UPDATE domain_details SET domain = $2 WHERE domain = $1;
>> DELETE from domains where domain = $1;
>> SELECT 1 AS ignore;$_$
>> LANGUAGE sql;
>>
>>notice $_$ where the single ' use to be.
>>
>>Is there some way to keep this from happening?
>>
>>The reason is we have systems in the field that have configuration
>>information stored in 7.4.x.
>>We want to upload that db info load it into an 8.2.5 db massage it then
>>send it back to the unit
>>in the field. I realize there are things I am going to have to fix up in
>>the 8.2.5 dump to be able to load
>>it back into the 7.4.x db but I want to minimize that as much as possible.
>>
>>We have some units in the field running 8.1.3 and it does not change the
>>' to $_$.
>>
>>
>>Thanks,
>>Steve

>
>
> I think "--disable-dollar-quoting" will work. (pg_dump --help)
>
>


Thanks a lot. I missed that option in the man page - but now I see it.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:45 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com