Search Postgresql Archives

Re: General coding question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 20 Dec 2011 13:32:32 -0500, David Johnston wrote:

> -----Original Message-----
> From: pgsql-general-owner@xxxxxxxxxxxxxx
> [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of jkells Sent:
> Tuesday, December 20, 2011 12:33 PM To: pgsql-general@xxxxxxxxxxxxxx
> Subject:  General coding question
> 
> General coding question.  Can I insert a text string into a character
> varying column that contains a \ as is, meaning no escaping of the
> character or is this a bad practice?
> 
> I.e:  Column                     data
>     ==========              ====================================
>     description              SUBDIV LOT 13 & N1\2 LOT  14
> 
> Thanks
> 
> -----------------------------------------------------
> 
> You never would actually store an "escaping" black-slash in the data. 
> The need for an escape symbol occurs only during data entry and strictly
> depends on how you are entering data .  As you have not provided those
> details further advice cannot be given.
> 
> David J.

David Thanks
My problem comes from 6 records containing a backslash in several columns 
out of a million plus rows in many different tables.  I am testing some 
replication software and have found that for these 6 records the 
destination tables contain two backslashes after being replicated.

Source (master) record  
I.e:  Column                     data
     ==========              ====================================
     description              SUBDIV LOT 13 & N1\2 LOT  14

Destination (slave) becomes the following  
     description              SUBDIV LOT 13 & N1\\2 LOT  14

My question was more generic since I cant see why a '\' character cant be 
used in a character string (I.e. storage path etc..  ).  How would you 
escape a \ character that is needed to be stored in a string and is there 
anything special that one would have to do when retrieving it?   

Regards,

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux