

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
> Sent: 21 May 2002 20:09
> To: Dave Page
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] More schema queries 
>
> 
> I guess your version of getopt() won't cooperate with -- 
> switches. I've committed this change in CVS.

Thanks.

> 
> I'm still interested in why explicitly saying "create view 
> pg_catalog.foo" didn't work ...

I've just been playing with this as you suggested, and using an initdb
with both 'create view foo' and 'create view pg_catalog.bar', with the
-- style switch I get (for both types of view): 

namespace_search_path   = $user,public
newRelation->schemaname = null
namespaceId             = 2200 (public)

So I guess the problem is a combination of the getopt() that we've
already found, and schemaname being null in the newRelation structure. 

Using the -c style switch in PGSQL_OPTS gives namespace_search_path =
pg_catalog as expected.

I am interested in learning more about this so any pointers you might
offer would be useful (I seriously doubt I'd find the fault myself
though) but I do understand that you probably have better things to do
than help me begin to understand the internals so I won't be overly
offended if you don't have time :-)

Cheers, Dave.

Tue, 21 May 2002 20:24:46 +0100
"Dave Page" <dpage@vale-housing.co.uk>
Re: More schema queries 
"Dave Page" <dpage@vale-housing.co.uk> writes:
>> I'm still interested in why explicitly saying "create view 
>> pg_catalog.foo" didn't work ...

> I've just been playing with this as you suggested, and using an initdb
> with both 'create view foo' and 'create view pg_catalog.bar', with the
> -- style switch I get (for both types of view): 

> namespace_search_path   = $user,public
> newRelation->schemaname = null
> namespaceId             = 2200 (public)

> So I guess the problem is a combination of the getopt() that we've
> already found, and schemaname being null in the newRelation structure. 

Given that getopt wasn't working, I'd expect namespace_search_path to be
that, and since there won't be any $user view at initdb time, public
should be the default creation target.  For "create view foo",
newRelation->schemaname *should* be null and thus public would be
selected.  But if you say "create view pg_catalog.foo" then
newRelation->schemaname should be "pg_catalog".  Can you trace it back a
little further and try to see why it's not?  It works fine here AFAICT,
so I'm wondering about portability problems ...

			regards, tom lane

Tue, 21 May 2002 15:31:05 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: More schema queries 