Re: Trying to execute several queries involving temp tables in a PHP script

From: Misa Simic <misa(dot)simic(at)gmail(dot)com>
To: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trying to execute several queries involving temp tables in a PHP script
Date: 2012-06-13 16:21:48
Message-ID: CAH3i69keywpke69uF_+Rqrzh9a9=Cq8Rd1OrjhNshD_h-_ts3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I agree with approach to have all in functions... In that case there would
not be a problem with temp tables because of inside 1 transaction they
would work...

suggestion was just to solve problem from php... what would be achiavable
just trough 1 query, or to use PDO and then:

$dbh->beginTransaction();
$dbh->exec(query1);
$dbh->exec(query2);
$dbh->exec(query3);
$dbh->commit();

Kind Regards,

Misa

2012/6/13 Leif Biberg Kristensen <leif(at)solumslekt(dot)org>

> Onsdag 13. juni 2012 15.12.33 skrev Alexander Farber :
>
> > Any ideas please on how to handle this situation
> > in PHP scripts, do I really have to encapsulate
> > my calls into a pl/PgSQL function?
>
> I believe that Misa Simic's idea that you can do it all in a single query
> without temp tables is correct. But anyway, it's always a good idea to
> encapsulate multiple interdependent queries in a single pl/pgsql function.
> I
> tend to keep my PHP code as simple as possible, and do most of the work
> inside
> the database.
>
> regards, Leif
> http://code.google.com/p/yggdrasil-genealogy/
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Misa Simic 2012-06-13 16:46:00 Re: Create view is not accepting the parameter in postgres functions
Previous Message Bruce Momjian 2012-06-13 16:20:21 Re: Re: [GENERAL] pg_upgrade from 9.0.7 to 9.1.3: duplicate key pg_authid_oid_index