X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 59268566E9 for ; Tue, 15 Mar 2005 23:10:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56393-03 for ; Tue, 15 Mar 2005 23:10:50 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id DBECD565D5 for ; Tue, 15 Mar 2005 23:10:49 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.1/8.13.1) with ESMTP id j2FNAnuq057245 for ; Tue, 15 Mar 2005 23:10:49 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.1/8.13.1/Submit) id j2FMh9vg050114 for pgsql-sql@postgresql.org; Tue, 15 Mar 2005 22:43:09 GMT (envelope-from news) From: "Hermann Draeger" X-Newsgroups: pgsql.sql Subject: tablename as function parameter Date: Tue, 15 Mar 2005 23:15:24 +0100 Organization: T-Online Lines: 17 Message-ID: Reply-To: "Hermann Draeger" Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet-abuse@t-online.de X-ID: JTos5oZDge03nXRkxEWYp05uRU5XPd1Kmhd7lUiMpUe8KBy6nuYoEl X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1213 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200503/269 X-Sequence-Number: 20748 I'm trying to create a function (language 'sql') with table name as single input parameter, but I always get syntax errors at "$1". Probably I am use wrong types. simple example: create function testfct (text) language sql as 'select count(*) from $1' fails. I tested type alternatives to 'text' , such as 'name' or 'sql_identifier' - no success. What is the right type ?