From: Hermann Draeger <hkdraeger@gmx.de>
To: pgsql-sql@postgresql.org
Subject: tablename as function parameter
Date: Tue, 15 Mar 2005 23:15:24 +0100
Message-ID: <d17o8m$dfd$01$1@news.t-online.com> (raw)
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 ?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: hkdraeger@gmx.de
Subject: Re: tablename as function parameter
In-Reply-To: <d17o8m$dfd$01$1@news.t-online.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox