Re: What's the CURRENT schema ?

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Fernando Nasser" <fnasser(at)redhat(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: What's the CURRENT schema ?
Date: 2002-04-05 22:58:00
Message-ID: EKEJJICOHDIEMGPNIFIJIEEPHGAA.Inoue@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Fernando Nasser
>
> Hiroshi Inoue wrote:
> >
> > Tom Lane wrote:
> > >
> > > Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> writes:
> > > > I don't object to use a search path to resolve unqualified
> > > > function, type etc names. But it is very siginificant for
> > > > users to be able to be sure what tables they are handling.
> > >
> > > I really don't buy this argument; it seems exactly comparable to
> > > arguing that the notion of current directory in Unix is evil, and
> > > that users should be forced to specify absolute paths to every
> > > file that they reference.
> > >
> > > There is nothing to stop you from writing qualified names
> (schema.table)
> > > if you are concerned about being sure that you get the table
> you intend.
> >
> > Probably I can do it in many cases but I couldn't force others
> > to do it. I don't object if PostgreSQL doesn't allow unqualified
> > table name other than in public/temporary/catalog schema.
> > There's no ambiguity and there's no need for the CURRENT schema.
> >
>
> We can't do that. Accordingly to the SQL if you are user HIROSHI
> and write "SELECT * FROM a;" the table is actually "HIROSHI.a".
>
> This must work for people who are using SQL-schemas in their databases
> or we would have a non-conforming implementation of SCHEMAS (would make
> the whole exercise pointless IMO).

Schema name isn't necessarily a user id since SQL-92
though SQL-86 and SQL-89 had and probably Oracle still
has the limitation. As far as I see PostgreSQL's schema
support wouldn't have the limitation. Probably I wouldn't
create the schema HIROSHI using PostgreSQL. When
I used Oracle I really disliked the limitation.

> The path proposed by Tom (discussed in the list some time ago) actually
> does magic:

The seems a misuse of SQL-path to me.
If I restrict the path to temporary:CURRENT schema:catalog, I would be
able to use the CURRENT schema and I can see no other useful way in
unqualified table name resolution. Probably I would also be able to use the
path as SQL-path. But how can I use the path in both style simultaneously ?

regards,
Hiroshi Inoue

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2002-04-05 22:58:41 Re: PQescapeBytea is not multibyte aware
Previous Message Larry Rosenman 2002-04-05 22:56:52 Re: Debugging symbols by default