Re: small smgrcreate cleanup patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: small smgrcreate cleanup patch
Date
Msg-id 6636.1282275306@sss.pgh.pa.us
Whole thread Raw
In response to small smgrcreate cleanup patch  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: small smgrcreate cleanup patch
Re: small smgrcreate cleanup patch
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> So I propose moving the TablespaceCreateDbspace() call to mdcreate(),
> removing the redundant check from smgrcreate(), and deleting that
> portion of the comment which says this is in the wrong place.

While I don't care for having smgr.c call tablespace.c, moving the call to
md.c instead is surely not an improvement :-(.  The problem here is that
we'd like the tablespace code to be above the smgr code, not below.
Calling it from md.c makes the layer inversion worse not better.

> You could argue that perhaps md.c isn't the right place either, but it
> certainly makes more sense than smgr.c, and I'd argue it's exactly
> right.

On what grounds pray tell?

> A related, interesting question is whether there's any purpose to the
> smgr layer at all.

Not a lot anymore, I think.  This has been ranted about before, but
I think the Berkeley guys bet on the wrong horse when they put an API
layer here.  The facilities that might once have been usefully switched
between at this level are now all down inside kernel device drivers.
I could see merging smgr.c and md.c entirely.  But they'd still be
appropriately placed below, not above, the tablespace commands.
        regards, tom lane


pgsql-hackers by date:

Previous
From: KaiGai Kohei
Date:
Subject: Re: security hook on authorization
Next
From: Steven Schlansker
Date:
Subject: Re: [BUGS] COPY FROM/TO losing a single byte of a multibyte UTF-8 sequence