> Is there an advantage to using something like $dbh->prepare($sql) if
> the SQL is going to be run once within the scope of the code? The
> code block may be run many times in a minute as in a function call ---
> while (<>) {
> insert_something($_);
> }
> Will the prepare statement be cached @ the database even if it's
> destroyed in the code/application?
The pg_prepared_statments view will give you information on prepared statments
currently resident in the database backend. I suggest you run your progam
(with a couple of "Enter to continue" breakpoints in the code) and, in another
session, select from pg_prepared_statements and see if the prepared statement
is still there.
I'll be trying this myself a bit later once I stabilise my system, so
watch this space!
Cheers,
Stuart.