Re: [NOVICE] DB insert Error - Mailing list pgsql-general

From Jasbinder Bali
Subject Re: [NOVICE] DB insert Error
Date
Msg-id a47902760608161142x4e3cf257v3b43e5c38a01057@mail.gmail.com
Whole thread Raw
In response to Re: [NOVICE] DB insert Error  ("Jasbinder Bali" <jsbali@gmail.com>)
Responses Re: [NOVICE] DB insert Error  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Tried everthing but nothing seems to work.
:(

On 8/16/06, Jasbinder Bali <jsbali@gmail.com> wrote:
Also, i tried to mannualy run the insert query in the query tool

------------------------------------------------------------

insert into raw_email ( id  , raw_email  ) values ( 1 ,  'From simon@simon-cozens.org Tue Apr 15 20:24:47 2003
X-MultiHeader: one
X-MultiHeader: two
X-MultiHeader: three
From: Simon Cozens < simon@simon-cozens.org>
To: test
Bcc: simon@twingle.net
Subject: foo
Mime-Version: 1.0
Content-Type: image/gif
Content-Disposition: attachment; filename=" 1.gif"
Content-Transfer-Encoding: base64
X-Operating-System: Linux deep-dark-truthful-mirror 2.4.9
X-POM: The Moon is Waxing Gibbous (98% of Full)
X-Addresses: The simon@cozens.net address is deprecated due to being broken. simon@brecon.co.uk still works, but simon-cozens.org or netthink.co.uk are preferred.
X-Mutt-Fcc: =outbox-200304
Status: RO
Content-Length: 1205
Lines: 17

R0lGODlhDAAMAPcAAAAAAAgICBAQEBgYGCkpKTExMTk5OUpKSoyMjJSUlJycnKWlpbW1tc7O
zufn5+/v7/f39///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/////////////////////////////////ywAAAAADAAMAAAIXwAjRICQwIAAAQYUQBAYwUEB
AAACEIBYwMHAhxARNIAIoAAEBBAPOICwkSMCjBAXlKQYgCMABSsjtuQI02UAlC9jFgBJMyYC
CCgRMODoseFElx0tCvxYIEAAAwkWRggIADs=

' )


------------------------------------------------------------

But it doesn't store the full raw_email field contents

raw_email field has just the follwing stored in it

-----------------------------------------------
"From simon@simon-cozens.org Tue Apr 15 20:24:47 2003
X-MultiHeader: one
X-MultiHeader: two
X-MultiHeader: three
From: Simon Cozens <simon@simon-cozens.org >
To: test
Bcc: simon@twingle.net
Subject: foo
Mime-Version: 1.0
Content-Type: image/gif
Content-Dispo (..)"
-----------------------------------------------

Also, as i've already told, even after i commit my transaction, it doesn't insert the record.

Thanks,
~Jas

On 8/16/06, Jasbinder Bali < jsbali@gmail.com> wrote:
I did commit the transaction by writing
EXEC SQL COMMIT; right after the insert statement.

Then also its not inserting the record and says:
[2998]: ECPGexecute line 97 Ok: INSERT 0 1
and SQLCODE is still 0

~Jas

On 8/1/06, Michael Fuhr < mike@fuhr.org> wrote:
On Wed, Aug 16, 2006 at 01:46:30AM -0400, Jasbinder Bali wrote:
> I changed the datatype from varchar[] to varchar
> ECPGdebug(1,stderr) says
> [2998]: ECPGexecute line 97 Ok: INSERT 0 1
>
> Its not inserting any record even though sqlcode is 0.

Are you committing the transaction?  See the bottom of the
following page:

http://www.postgresql.org/docs/8.1/interactive/ecpg-commands.html

"In the default mode, statements are committed only when EXEC SQL
COMMIT is issued."

--
Michael Fuhr



pgsql-general by date:

Previous
From: "Julian Scarfe"
Date:
Subject: Re: Timezones -- what comes out does not go in?
Next
From: Curtis Scheer
Date:
Subject: Re: plpgsql dynamic queries and optional arguments