Re: when does CREATE VIEW not create a view?

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: when does CREATE VIEW not create a view?
Date: 2000-08-28 15:21:16
Message-ID: 20000828102116.B1457@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, Aug 24, 2000 at 12:30:00AM -0600, Malcontent wrote:
> Brook Milligan wrote:
> >
> > See my other reply about what gets added: the problem is the rewrite
> > rule name, as you guessed.
> >
> > Here's a patch that silently truncates the generated rule name.
> >
>
> What are the consequences of changing the NAMEDATALEN and recompiling?
> Doesn't that seem like a better solution then to truncate the view name?

Increasing NAMEDATALEN is a relatively common customization, but
it does cost you efficency of storage in the system tables: all the
identifiers take fixed NAMEDATALEN char fields, for speed of access. In
this particular case, the view name is not getting truncated (that will
already happen, if you try to create a view or table with a name longer
than NAMEDATALEN). The problem is that creation of a view involves
the backend creating a table with the supplied name, building an ON
SELECT INSTEAD rule, whose (unique) name is created by prepending _RET
to the supplied view name. Since this goes into a NAMEDATALEN field in a
system table, it needs to be truncated. Current code fails by not creating
the rule if the supplied name is within 4 characters of NAMEDATALEN,
but leaving the underlying table around. Since end user code _never_
needs to manipulate the rule directly, truncating the name is not a
problem.

The patch I proposed has not been put in CVS, because I need to add
multibyte support. Hmm, anyone got any spare round tuits? (I've got
plenty of square ones...)

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Brook Milligan 2000-08-28 15:24:00 Re: Re: Too many open files (was Re: spinlock problems reported earlier)
Previous Message Patrick Welche 2000-08-28 15:09:34 Re: How Do You Pronounce "PostgreSQL"?

Browse pgsql-patches by date

  From Date Subject
Next Message Brook Milligan 2000-08-28 15:26:13 Re: when does CREATE VIEW not create a view?
Previous Message Tom Lane 2000-08-28 14:20:59 Re: Bug in regression tests