Re: when does CREATE VIEW not create a view?

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: t-ishii(at)sra(dot)co(dot)jp
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: when does CREATE VIEW not create a view?
Date: 2000-08-29 17:46:46
Message-ID: 20000829124646.C10972@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, Aug 29, 2000 at 10:12:38AM +0900, t-ishii(at)sra(dot)co(dot)jp wrote:
>
> No problem for repatching I think, since we are in the development
> cycle anyway.

Oh well.

>
> > The problem is that I just chop it off at NAMEDATALEN, which might be
> > in the middle of a multibyte character, correct?
>
> Exactly.

Good. Understanding the problem is critical to fixing it. ;-)

>
> > Ah, I see code in parser/scan.l that does the multibyte aware version
> > of the chop. Should I just rewrite my patch with that code as a model?
>
> Please do so. If you need any help, please let me know.

O.K.

I'm just about done with it. Since there are three places in the code that
seem to know about how to make a rulename from a viewname, and one of them
is a function named MakeRetrieveViewRuleName(), I've put the #ifdef MULTIBYTE
in there, and called this function from the other places that need it.

Only problem is in utils/adt/ruleutils.c

There's code in there that constructs potential rule names that start with
'_ret' as well as '_RET', in order to use an SPI query to find the rule
associated with a view. This is the only occurance of the string '"_ret'
in the codebase, and I can't find a way a rule might get that name, nor an
example in either the 6.5.0 and 7.0.2 databases I've got here.

Someone when to the trouble of writing the query that way, but I'm not
convinced it's needed anymore. I'm guessing there was an extra tolower
somewhere that doesn't happen anymore (Tom Lane tracked down a bunch
of these when I whined about MultiCase tablenames breaking, nigh on a
year ago)

Should I trash it? Anyone have anything returned from

SELECT rulename from pg_rewrite where rulename ~ '^_ret';

on any database with view defined?

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2000-08-29 18:46:59 Re: [HACKERS] disallow LOCK on a view - the Tom Lane remix
Previous Message Tom Lane 2000-08-29 16:49:05 Re: Backend-internal SPI operations

Browse pgsql-patches by date

  From Date Subject
Next Message Alfred Perlstein 2000-08-29 18:46:59 Re: [HACKERS] disallow LOCK on a view - the Tom Lane remix
Previous Message Tom Lane 2000-08-29 16:49:05 Re: Backend-internal SPI operations