Re: proposal: schema PL session variables

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Oleg Bartunov <obartunov(at)gmail(dot)com>
Subject: Re: proposal: schema PL session variables
Date: 2016-02-08 12:53:54
Message-ID: 56B88FE2.3050304@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/02/16 13:41, Pavel Stehule wrote:
> 2016-02-08 13:22 GMT+01:00 Marko Tiikkaja <marko(at)joh(dot)to>:
>> Personally I find that undesirable. I don't know what oracle does, but
>> variables being visible without schema-qualifying them can introduce
>> variable conflicts in PL/PgSQL. I'd prefer if you could only refer to them
>> by prefixing them with the schema name (or maybe allow search_path to be
>> used).
>
> I hope so there are not new conflicts - schema variable is not directly
> visible from SQL (in this iteration) - they are visible only from functions
> - and the behave is same like global plpgsql variable. So schema variable
> can be in conflict with SQL identifier only exactly identically as plpgsql
> variable

Yeah, and that's exactly what I don't want, because that means that
CREATE SCHEMA VARIABLE suddenly breaks existing code.

> But prefix can be used.

Sure, but I don't see the point. Is there a reason not to require such
variable references to be prefixed with the schema name? Or explicitly
bring them into scope in the DECLARE section somehow.

.m

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-02-08 13:11:19 Re: pgbench stats per script & other stuff
Previous Message Craig Ringer 2016-02-08 12:52:58 Re: proposal: make NOTIFY list de-duplication optional