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

From Tom Lane
Subject Re: Problem in 'select' from temp table with Perl/DBI
Date
Msg-id 18414.1007046171@sss.pgh.pa.us
Whole thread Raw
In response to Problem in 'select' from temp table with Perl/DBI  (samik@cae.wisc.edu (Samik Raychaudhuri))
List pgsql-general
samik@cae.wisc.edu (Samik Raychaudhuri) writes:
> $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;
>         ";

> 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.

You didn't say what postgres version you are using, but on older
versions I think it'd be necessary to issue those commands as two
separate statements.  PG used to try to parse all the commands in
a querystring before executing any of them.

            regards, tom lane

pgsql-general by date:

Previous
From: Sanjay Bhatia
Date:
Subject: DEBUG messages
Next
From: qradius@qnet.com.pe
Date:
Subject: time calculation