Re: Posgres Adding braces at beginning and end of text (html) content

From: linnewbie <linnewbie(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Posgres Adding braces at beginning and end of text (html) content
Date: 2009-04-02 13:33:44
Message-ID: 389c2d1d-252b-49f5-bbf5-6eebc8acb551@f11g2000vbf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Apr 2, 8:59 am, l(dot)(dot)(dot)(at)solumslekt(dot)org ("Leif B. Kristensen") wrote:
> On Thursday 2. April 2009, linnewbie wrote:
>
> >Hi All,
>
> >I'm fairly new to postgres and I'm having this peculiar problem.
>
> >I'm storing raw html in a text field and I want users who know HTML to
> >update the content in a textarea field.
>
> >The problem is postgres is adding braces to the begining and ending of
> >the content.  On creation and every time I update.
>
> I can't reproduce your problem in 8.3.5:
>
> pgslekt=> create table test (i integer, t text);
> CREATE TABLE
> pgslekt=> insert into test values (1, '<p>Hei hei</p>');
> INSERT 0 1
> pgslekt=> select * from test;
>  i |       t
> ---+----------------
>  1 | <p>Hei hei</p>
> (1 row)
>
> Perhaps it's a middleware problem?
> --
> Leif Biberg Kristensen | Registered Linux User #338009
> Me And My Database:http://solumslekt.org/blog/
>
> --
> Sent via pgsql-general mailing list (pgsql-gene(dot)(dot)(dot)(at)postgresql(dot)org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

I am using tcl ( ncgi and tclobdc ) so it is more like the excerpts
below:

ie I input:

<h1>Hello World </h1>

<p>xyz <p/>
.........

into the text area field, save:

set page_content [ ncgi::value textarea_field_name]

database connect dbh $datasource $dbuser $dbpassword

set sql "INSERT INTO profile (page_content) \
VALUES('$page_content') "

dbh $sql

......................

......................

......................

view:

set sql "SELECT page_content FROM profile \
WHERE page_id = $page"

set page_content [lindex [ dbh $sql ] 0]

::ncgi::header "text/html

...........................

...........................

...........................

puts "<textarea id='page_content' name='page_content'> $page_content
</
textarea>"

.........................................................

........................................................

in browser I see:

{<h1>Hello World </h1>

<p>xyz <p/>
.........
}

On a subsequent update I see

{{

<h1>Hello World </h1>

<p>xyz <p/>
.........
}}

On another I see

{{{

<h1>Hello World </h1>

<p>xyz <p/>
.........

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leif B. Kristensen 2009-04-02 13:45:28 Re: Posgres Adding braces at beginning and end of text (html) content
Previous Message Alvaro Herrera 2009-04-02 13:28:13 Re: %r in restore_command?