Thread: CREATE/DROP SCHEMA considered harmful

CREATE/DROP SCHEMA considered harmful

From
Peter Eisentraut
Date:
I think the create and drop schema commands should throw a "not
implemented" error, rather than fiddle around with databases. Consider
users that try these commands just on luck.

Btw., the grammar for these commands isn't implemented correctly either.


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



Re: CREATE/DROP SCHEMA considered harmful

From
Thomas Lockhart
Date:
> I think the create and drop schema commands should throw a "not
> implemented" error, rather than fiddle around with databases. Consider
> users that try these commands just on luck.
> Btw., the grammar for these commands isn't implemented correctly either.

Sure. I'm not too worried about them, since what you suggest can be done
at any time before release.

At the moment, I'm having trouble just getting a database installed. Did
something change recently? I *thought* I was tracking down a problem
where updated system catalogs did not get propagated into the
share/*.bki files. I did an update from cvsup a few minutes ago, and now
that seems to be fixed, but psql cannot create a database :(

The message when running createdb is:

psql: ConnectDBStart() -- connect() failed: Invalid argumentIs the postmaster running...

Ah, a "make distclean" seems to have fixed it for me. Not sure why it
would need to be that drastic; are we missing a dependency somewhere?
                  - Tom


Re: CREATE/DROP SCHEMA considered harmful

From
Tom Lane
Date:
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> The message when running createdb is:
> psql: ConnectDBStart() -- connect() failed: Invalid argument
>     Is the postmaster running...
> Ah, a "make distclean" seems to have fixed it for me. Not sure why it
> would need to be that drastic; are we missing a dependency somewhere?

I bet what happened is that you pulled Peter's latest change
(introducing HAVE_UNIX_SOCKETS config symbol) and didn't rerun
configure, so you had config.h without HAVE_UNIX_SOCKETS defined,
and the unix-socket support got compiled out.  Two thoughts here:

1. There is no make dependency from config.h.in to config.h, and
probably can't be since make is not responsible for running configure
(and should not be, IMHO).  But perhaps we could have a script or
something that warns you that you probably need to rerun configure
if configure or any .in file is newer than the configure output files.

2. It sounds like libpq does not fail very gracefully if you try to
connect via unix-sockets when that code is ifdef'd out.  Someone needs
to look at that combination --- any volunteers?
        regards, tom lane