pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: IlGenna <alessio.gennari78@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Call function with dynamic schema name
Date: Sun, 15 Jan 2012 09:28:53 -0800 (PST)
Message-ID: <1326648533548-5146721.post@n5.nabble.com> (raw)

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.htm...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



view thread (5+ messages)  latest in thread

Message-ID: <1326648533548-5146721.post@n5.nabble.com>
Permalink:  ../1326648533548-5146721.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1326648533548-5146721.post@n5.nabble.com

 · 

reply

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: alessio.gennari78@gmail.com
  Subject: Re: Call function with dynamic schema name
  In-Reply-To: <1326648533548-5146721.post@n5.nabble.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