Problem in 'select' from temp table with Perl/DBI - Mailing list pgsql-general

From samik@cae.wisc.edu (Samik Raychaudhuri)
Subject Problem in 'select' from temp table with Perl/DBI
Date
Msg-id fbf5e750.0111281921.55f0cd67@posting.google.com
Whole thread Raw
Responses Re: Problem in 'select' from temp table with Perl/DBI
List pgsql-general
Hi,
I am using a temp table for a 'select' statement from a perl code
(using DBI) as follows:
==========================================
$query="select date_part('month', date) as month, date_part('year',
date) as year into temp counter from weblogs;
        select month || '-' || year, count(*) from counter group by
month, year;
        ";
$sth=$dbh->prepare($query) || die "Content-type:
text/plain\n\nCouldn't prepare select query: $query\n";
$sth->execute() || die "Content-type: text/plain\n\nCouldn't execute
statement: $query\n";
while(@data=$sth->fetchrow_array()){    push(@Datelog, [$data[0],
$data[1]]);   }
======================================

When I run this code, I get the following error message:
DBD::Pg::st execute failed: ERROR:  Relation 'counter' does not exist
at counter.pl line 56.
Content-type: text/plain

Couldn't execute statement:
select date_part('month', date) as month, date_part('year', date) as
year into temp counter from weblogs;
select month || '-' || year, count(*) from counter group by month,
year;

Line 56 is the 2nd select statement.
Can anybody give a hint about what can be wrong here?
Thanks and regards.
Samik

pgsql-general by date:

Previous
From: "xin"
Date:
Subject: How many processes running on the server side, postmaster, backends, something else?
Next
From: Jan Wessely
Date:
Subject: Current JDBC Driver char encoding - Bug or feature?