transaction in postgres - Mailing list pgsql-php

From Sebastiano Cascione
Subject transaction in postgres
Date
Msg-id EAEILHDBPKKJIGAEGPGNEEDNCAAA.cascione.sr@tin.it
Whole thread Raw
Responses Re: transaction in postgres  ("Miguel Carvalho" <miguel@ipatimup.pt>)
List pgsql-php
Hi averyone,
I'm using a new function to include two query into an unique transaction. Is
this the only way to do it? The following lines show you my function, the
purpose is to return the id_utente field (serial) of the last insert done:
----------------------------------------
CREATE FUNCTION "id_from_insert"("varchar", "varchar", "int4", "bpchar",
"varchar", "int4", "int4", "int4", "varchar", "int4", "bpchar", "varchar",
"varchar") RETURNS "int4" AS 'INSERT INTO g_registrazione_generale (
nome,
cognome,
data_di_nascita,
genere,
indirizzo,
codice_postale,
telefono,
id_documentazione,
email,
data_inserimento,
stato,
velocita_connessione,
istruzione
) VALUES (
$1,
$2,
$3,
$4,
$5,
$6,
$7,
$8,
$9,
$10,
$11,
$12,
$13
);
SELECT max(g_registrazione_generale.id_utente) FROM
g_registrazione_generale;
' LANGUAGE 'sql';
----------------------------------------------------------------------
Best regards


pgsql-php by date:

Previous
From: Andrew Haigh
Date:
Subject: Re: File upload default size in php
Next
From: "Miguel Carvalho"
Date:
Subject: Re: Where can I get error messages?