Re: string fields helps - Mailing list pgsql-general

From Bill Moran
Subject Re: string fields helps
Date
Msg-id 20070416195859.af706ade.wmoran@potentialtech.com
Whole thread Raw
In response to string fields helps  (marcelo Cortez <jmdc_marcelo@yahoo.com.ar>)
Responses Re: string fields helps
List pgsql-general
marcelo Cortez <jmdc_marcelo@yahoo.com.ar> wrote:
>
> Folks
>
>   I need to save data on rtf format but , postgres
> refuses to storage for backslah or character's
> problem's   any idea or vice are welcomed       best
> regards
>  mdc

You need to escape the data before you insert it.  This is language-
dependant, but any language that has PostgreSQL libraries will have
functions to escape text data.

>
> pd: sample off data to save ( from postgres log)
>
> "
>  UPDATE plbrecord SET documentation =
> '{\rtf1\ansi\deff0{\fonttbl{\f0\fnil Tahoma;}}
>         \viewkind4\uc1\pard\lang1033\f0\fs16
>         \par }
>         ', version_ = 4 WHERE (plbrecord.id_ = 8 AND
> plbrecord.version_ = 3 AND plbrecord.inst_class_ =
> 'EntityDataWindow')
> LOG:  statement: COMMIT1
> LOG:  statement: BEGIN
> LOG:  statement: UPDATE plbrecord SET documentation =
> '{\rtf1\ansi\deff0{\fonttbl{\f0\fnil Tahoma;}}
>         \viewkind4\uc1\pard\lang1033\f0\fs16   SELECT
> "PARAMETROS"."PARAMETRO",
>         \par
> substr(to_char("PARAMETROS"."F_VAL_PARAM",
> ''YYYY/MM/DD''), 1,10),
>         \par
> substr(to_char("PARAMETROS"."F_ANUL_PARAM",''YYYY/MM/DD''),
> 1,10),
>         \par          "PARAMETROS"."VALOR1",
>         \par          "PARAMETROS"."VALOR2"
>         \par     FROM "PARAMETROS"
>         \par " )
>         \par
>         \par }
>         ', version_ = 5 WHERE (plbrecord.id_ = 8 AND
> plbrecord.version_ = 4 AND plbrecord.inst_class_ =
> 'EntityDataWindow')
> LOG:  statement: COMMIT
> LOG:  statement: BEGIN
> LOG:  statement: UPDATE plbrecord SET documentation =
> '{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0
> Tahoma;}{\f1\fnil Tahoma;}}
>         \viewkind4\uc1\pard\lang1033\f0\fs18   SELECT
> "PARAMETROS"."PARAMETRO",
>         \par
> substr(to_char("PARAMETROS"."F_VAL_PARAM",
> ''YYYY/MM/DD''), 1,10),
>         \par
> substr(to_char("PARAMETROS"."F_ANUL_PARAM",''YYYY/MM/DD''),
> 1,10),
>         \par          "PARAMETROS"."VALOR1",
>         \par          "PARAMETROS"."VALOR2"
>         \par     FROM "PARAMETROS"
>         \par " )
>         \par \f1\fs16
>         \par }
> "
>
>
>       __________________________________________________
> Preguntá. Respondé. Descubrí.
> Todo lo que querías saber, y lo que ni imaginabas,
> está en Yahoo! Respuestas (Beta).
> ¡Probalo ya!
> http://www.yahoo.com.ar/respuestas
>
>
> ---------------------------(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


--
Bill Moran
http://www.potentialtech.com

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Dynamic DDL
Next
From: Jeff Davis
Date:
Subject: Re: digest data types?