postgresql/src/include
Tom Lane 862861ee77 Fix a couple of misbehaviors rooted in the fact that the default creation
namespace isn't necessarily first in the search path (there could be implicit
schemas ahead of it).  Examples are

test=# set search_path TO s1;

test=# create view pg_timezone_names as select * from pg_timezone_names();
ERROR:  "pg_timezone_names" is already a view

test=# create table pg_class (f1 int primary key);
ERROR:  permission denied: "pg_class" is a system catalog

You'd expect these commands to create the requested objects in s1, since
names beginning with pg_ aren't supposed to be reserved anymore.  What is
happening is that we create the requested base table and then execute
additional commands (here, CREATE RULE or CREATE INDEX), and that code is
passed the same RangeVar that was in the original command.  Since that
RangeVar has schemaname = NULL, the secondary commands think they should do a
path search, and that means they find system catalogs that are implicitly in
front of s1 in the search path.

This is perilously close to being a security hole: if the secondary command
failed to apply a permission check then it'd be possible for unprivileged
users to make schema modifications to system catalogs.  But as far as I can
find, there is no code path in which a check doesn't occur.  Which makes it
just a weird corner-case bug for people who are silly enough to want to
name their tables the same as a system catalog.

The relevant code has changed quite a bit since 8.2, which means this patch
wouldn't work as-is in the back branches.  Since it's a corner case no one
has reported from the field, I'm not going to bother trying to back-patch.
2007-08-27 03:36:08 +00:00
..
access Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
bootstrap Create a new dedicated Postgres process, "wal writer", which exists to write 2007-07-24 04:54:09 +00:00
catalog Remove the 'not in' operator (!!=). This was a hangover from Berkeley 2007-08-27 01:39:25 +00:00
commands Simplify the syntax of CREATE/ALTER TEXT SEARCH DICTIONARY by treating the 2007-08-22 01:39:46 +00:00
executor Arrange to cache a ResultRelInfo in the executor's EState for relations that 2007-08-15 21:39:50 +00:00
lib Add resetStringInfo(), which clears the content of a StringInfo, and 2007-03-03 19:32:55 +00:00
libpq Move session_start out of MyProcPort stucture and make it a global called MyStartTime, 2007-08-02 23:39:45 +00:00
mb Make JOHAB client only encoding per discussions in pgsql-hackers 2007-04-15 10:56:30 +00:00
nodes Make ARRAY(SELECT ...) return an empty array, rather than a NULL, when the 2007-08-26 21:44:25 +00:00
optimizer Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
parser Separate parse-analysis for utility commands out of parser/analyze.c 2007-06-23 22:12:52 +00:00
port Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
postmaster Provide for logfiles in machine readable CSV format. In consequence, rename 2007-08-19 01:41:25 +00:00
regex Wording cleanup for error messages. Also change can't -> cannot. 2007-02-01 19:10:30 +00:00
rewrite Fix a couple of misbehaviors rooted in the fact that the default creation 2007-08-27 03:36:08 +00:00
snowball Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
storage Apparently icc doesn't always define __ICC, and it's more correct to 2007-08-05 15:11:40 +00:00
tcop Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
tsearch Cleanup for some problems in tsearch patch: 2007-08-25 00:03:59 +00:00
utils Remove the 'not in' operator (!!=). This was a hangover from Berkeley 2007-08-27 01:39:25 +00:00
c.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
fmgr.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
funcapi.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
getaddrinfo.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
getopt_long.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
Makefile Allow installation into directories containing spaces in the name. 2005-12-09 21:19:36 +00:00
miscadmin.h Move session_start out of MyProcPort stucture and make it a global called MyStartTime, 2007-08-02 23:39:45 +00:00
pg_config.h.in Support GSSAPI builds where the header is <gssapi.h> and not <gssapi/gssapi.h>, 2007-07-12 14:36:52 +00:00
pg_config.h.win32 Enable IPV6 for all MSVC builds, including the VC6 libpq-only build. 2007-04-16 18:39:19 +00:00
pg_config_manual.h Arrange for large sequential scans to synchronize with each other, so that 2007-06-08 18:23:53 +00:00
pg_trace.h pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
pgstat.h Remove the pgstat_drop_relation() call from smgr_internal_unlink(), because 2007-07-08 22:23:16 +00:00
pgtime.h Fix crash caused by log_timezone patch if we attempt to emit any elog messages 2007-08-04 19:29:25 +00:00
port.h Get dirmod.c on the same page as port.h about whether we use pgsymlink 2007-07-12 23:28:49 +00:00
postgres.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
postgres_ext.h Move NAMEDATALEN definition from postgres_ext.h to pg_config_manual.h. It 2007-02-06 09:16:08 +00:00
postgres_fe.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
rusagestub.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00