tablename as function parameter - Mailing list pgsql-sql

From Hermann Draeger
Subject tablename as function parameter
Date
Msg-id d17o8m$dfd$01$1@news.t-online.com
Whole thread Raw
Responses Re: tablename as function parameter  (Jonathan Daugherty <cygnus@cprogrammer.org>)
List pgsql-sql
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 ?







pgsql-sql by date:

Previous
From: Ashok Agrawal
Date:
Subject: date subtraction
Next
From: Jonathan Daugherty
Date:
Subject: Re: Group by 15 Minute Steps