Re: Creation of a table with dynamic name from inside a pgpsql function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael Beckstette" <mbeckste(at)TechFak(dot)Uni-Bielefeld(dot)DE>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Creation of a table with dynamic name from inside a pgpsql function
Date: 2002-05-28 17:33:54
Message-ID: 11520.1022607234@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Michael Beckstette" <mbeckste(at)TechFak(dot)Uni-Bielefeld(dot)DE> writes:
> query_string:= ''CREATE TABLE temp1 AS SELECT * FROM ''||
> quote_ident(table_name) || '' WHERE (hsp_rank=1 AND hsp_evalue<=0.001)'';
> RAISE NOTICE ''Query: %'',query_string;
> EXECUTE query_string;

> prod2_db=# select test('blasthits_obj_174_q122_db123');
> NOTICE: Query: CREATE TABLE temp1 AS SELECT * FROM
> blasthits_obj_174_q122_db123 WHERE (hsp_rank=1 AND hsp_evalue<=0.001)
> ERROR: EXECUTE of SELECT ... INTO is not implemented yet

Update to 7.2.1. The above should be allowed, but was mistakenly
rejected by 7.2.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gabriel Dovalo Carril 2002-05-28 18:24:07 Re: Functions with dynamic queries
Previous Message Jeff Eckermann 2002-05-28 17:04:07 Re: Functions with dynamic queries