osdir.com
mailing list archive

Subject: Transaction in plpgsql function? - msg#00203

List: db.postgresql.novice

Date: Prev Next Index Thread: Prev Next Index
Hi All,

could someone tell me, how can I start explicitly a transaction in a plpgsql
function? The begin/commit doesn't works.. :-(

Thanks!
MaFa


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
message can get through to the mailing list cleanly



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Some wayfor checking/updating database/table structure?

Hi, I'm looking for some way which could enable me to say: - I have database DB_foo - in this database is table T_bar - table T_bar has got columns desc with text type and num with integer type and default value 10 And if there is for example in T_bar only column "desc" I want to add column "num". Is there some simple way of doing this or must I always list tables/columns and manualy check it? I imagine something like: ALTER TABLE T_bar ADD COLUMN desc text IF NOT EXISTS; Thanks for comments, Libor ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend

Next Message by Date: click to view message preview

addnew in combination with Limt

Hi, I want to use the ADODB object model to do updates etc. But the following code does not do the update. Set RST = New ADODB.Recordset RST.Open "SELECT FldPtrFROM TblTown LIMIT 1;", CNN, adOpenKeyset, adLockOptimistic, adCmdText RST.AddNew RST.Fields("FldPtr").Value = 1 RST.Update The following does however the work: Set RST = New ADODB.Recordset RST.Open "SELECT FldPtr FROM TblTown;", CNN, adOpenKeyset, adLockOptimistic, adCmdText RST.AddNew RST.Fields("FldPtr").Value = 1 RST.Fields("FldRetVal").Value = "Austin" RST.Update Is this a bug in the LIMIT operator? Thanks, Fred

Previous Message by Thread: click to view message preview

Re: Transaction in plpgsql function?

> You don't. All of a function takes place inside a transaction. If > there is no explicit transaction already, an implicit one will have been > started. If it is true, then the following function why causes sometimes a "duplicate row"' error? begin if exists(select session_data from session where session_id= $1 ) then update session set session_data= $2, session_exp=now() + interval ''10 minutes'' where session_id= $1 ; return 0; else insert into session(session_id, session_exp, session_data) values ($1 , now() + interval ''10 minutes'' , $2); return 1; end if; end; Maybe because of the current isolation level? Thanks: MaFa ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Next Message by Thread: click to view message preview

Retrieving Array Datatype in Java

Hi all, Can anybody tell me if the array object is supported in the jdbc drivers? If it is, can anybody tell me how to retrieve an array from the database? Searching the net has brought up very little. More inserting than retrieving!! Cheers Tom ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by