Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id CCD361FE6211 for ; Sun, 15 Jan 2012 13:29:10 -0400 (AST) Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RmTtG-0006RW-0z for pgsql-sql@postgresql.org; Sun, 15 Jan 2012 17:29:10 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RmTsz-00022y-Hv for pgsql-sql@postgresql.org; Sun, 15 Jan 2012 09:28:53 -0800 Date: Sun, 15 Jan 2012 09:28:53 -0800 (PST) From: IlGenna To: pgsql-sql@postgresql.org Message-ID: <1326648533548-5146721.post@n5.nabble.com> Subject: Call function with dynamic schema name MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.2 (+) X-Archive-Number: 201201/58 X-Sequence-Number: 36229 Hi to everyone, I would like to use in my function (plpgsql or sql) dynamic schema name to execute query or to call other functions. For exemple in oracle is possible to excute query in this manner: SELECT * FROM &&SCHEMA_NAME..TABLE_NAME; Where I think &&SCHEMA_NAME. is a sessione variable. I found tath I can use dynamic SQL like this: execute 'select * from ' || schema_name || '.table_name'; However, I would like to know if exist any other system to use dynamic schema name more similiar to Oracle. Another pl language is also ok. Thank you very much. Alessio -- View this message in context: http://postgresql.1045698.n5.nabble.com/Call-function-with-dynamic-schema-name-tp5146721p5146721.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.