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