Tom Lane [Tue, 16 Apr 2002 23:08:12 +0000 (23:08 +0000)]
Operators live in namespaces. CREATE/DROP/COMMENT ON OPERATOR take
qualified operator names directly, for example CREATE OPERATOR myschema.+
( ... ). To qualify an operator name in an expression you need to write
OPERATOR(myschema.+) (thanks to Peter for suggesting an escape hatch).
I also took advantage of having to reformat pg_operator to fix something
that'd been bugging me for a while: mergejoinable operators should have
explicit links to the associated cross-data-type comparison operators,
rather than hardwiring an assumption that they are named < and >.
Bruce Momjian [Mon, 15 Apr 2002 23:47:12 +0000 (23:47 +0000)]
The patch I sent to -patches a little while ago wasn't applied: it
was in the thread "make BufferGetBlockNumber() a macro". Tom
objected to the original patch, so I prepared a new one which
doesn't change BufferGetBlockNumber() into a macro, it just
cleans up some comments and fixes an assertion. The patch
is attached.
Bruce Momjian [Mon, 15 Apr 2002 23:45:07 +0000 (23:45 +0000)]
CATALOG VERSION UPDATED:
The indexes on most system catalogs are named with the suffix "_index";
not so with TOAST table indexes, which use "_idx". This trivial patch
changes TOAST table index names to use the "_index" suffix for
consistency.
Bruce Momjian [Mon, 15 Apr 2002 23:35:51 +0000 (23:35 +0000)]
Fix for NOTIFY when NAMEDATALEN is nonstandard in server. Fix idea from
Tom Lane to move string storage to end of structure but keep pointer in
the same location.
Bruce Momjian [Mon, 15 Apr 2002 23:34:17 +0000 (23:34 +0000)]
Fix for EINTR returns from Win9X socket operations:
In summary, if a software writer implements timer events or other events
which generate a signal with a timing fast enough to occur while libpq
is inside connect(), then connect returns -EINTR. The code following
the connect call does not handle this and generates an error message.
The sum result is that the pg_connect() fails. If the timer or other
event is right on the window of the connect() completion time, the
pg_connect() may appear to work sporadically. If the event is too slow,
pg_connect() will appear to always work and if the event is too fast,
pg_connect() will always fail.
Tom Lane [Mon, 15 Apr 2002 22:33:21 +0000 (22:33 +0000)]
Adjust rules for search_path so that pg_catalog is never implicitly
selected as the creation target namespace; to make that happen, you
must explicitly set search_path that way. This makes initdb a hair
more complex but seems like a good safety feature.
Tom Lane [Mon, 15 Apr 2002 06:05:49 +0000 (06:05 +0000)]
Fix oversight in recent change of representation for JOIN alias
variables: JOIN/ON should allow references to contained JOINs.
Per bug report from Barry Lind.
Tom Lane [Mon, 15 Apr 2002 05:22:04 +0000 (05:22 +0000)]
The contents of command.c, creatinh.c, define.c, remove.c and rename.c
have been divided according to the type of object manipulated - so ALTER
TABLE code is in tablecmds.c, aggregate commands in aggregatecmds.c and
so on.
A few common support routines remain in define.c (prototypes in
src/include/commands/defrem.h).
No code has been changed except for includes to reflect the new files.
The prototypes for aggregatecmds.c, functioncmds.c, operatorcmds.c,
and typecmds.c remain in src/include/commands/defrem.h.
Bruce Momjian [Sat, 13 Apr 2002 19:57:18 +0000 (19:57 +0000)]
Rod's patch does what it is supposed to do, but it also includes
some old code to add PK constraints to CREATE TABLE. That stuff
had been removed as part of my original patch for pg_dump a
little while ago.
The attached patch fixes this by removing (again :-) ) the
code in dumpTables() to perform PK creation during CREATE
TABLE. I briefly tested it locally and it fixes both of
Tom's test cases.
Bruce Momjian [Sat, 13 Apr 2002 19:52:51 +0000 (19:52 +0000)]
Patch against 7.2.1 sources. Uses Solaris Intimate Shared Memory
for Solaris on SPARC. Scott Brunza (sbrunza@sonalysts.com) gets
credit for identifying the issue, making the change, and doing
the regression tests.
Earlier testing on 7.2rc2 and 7.2 showed performance gains of
1% to 10% on pgbench, osdb-pg, and some locally developed apps.
Solaris Intimate Shared Memory is described in "SOLARIS INTERNALS
Core Kernel Components" by Jim Mauro and Richard McDougall,
Copyright 2001 Sun Microsystem, Inc. ISBN 0-13-022496-0
Bruce Momjian [Sat, 13 Apr 2002 01:42:44 +0000 (01:42 +0000)]
This is a proposed patch to doc/src/sgml/libpgtcl.sgml which documents
the libpgtcl "pg_execute" command. This was mentioned on
pgsql-interfaces on Mar 3. I am posting it here in the hope that someone
will check to see if it makes sense and is correct SGML-wise. I did run
it through jade, but this is my first try at this sort of thing.
Tom Lane [Fri, 12 Apr 2002 20:38:31 +0000 (20:38 +0000)]
Checking to decide whether relations are system relations now depends
on the namespace not the name; pg_ is not a reserved prefix for table
names anymore. From Fernando Nasser.
Tom Lane [Thu, 11 Apr 2002 20:00:18 +0000 (20:00 +0000)]
Restructure representation of aggregate functions so that they have pg_proc
entries, per pghackers discussion. This fixes aggregates to live in
namespaces, and also simplifies/speeds up lookup in parse_func.c.
Also, add a 'proimplicit' flag to pg_proc that controls whether a type
coercion function may be invoked implicitly, or only explicitly. The
current settings of these flags are more permissive than I would like,
but we will need to debate and refine the behavior; for now, I avoided
breaking regression tests as much as I could.
Tom Lane [Tue, 9 Apr 2002 20:35:55 +0000 (20:35 +0000)]
Functions live in namespaces. Qualified function names work, eg
SELECT schema1.func2(...). Aggregate names can be qualified at the
syntactic level, but the qualification is ignored for the moment.
Fix PQescapeBytea/PQunescapeBytea so that they handle bytes > 0x7f.
This is necessary for mulibyte character sequences.
See "[HACKERS] PQescapeBytea is not multibyte aware" thread posted around
2002/04/05 for more details.
Tom Lane [Sat, 6 Apr 2002 06:59:25 +0000 (06:59 +0000)]
Implement partial-key searching of syscaches, per recent suggestion
to pghackers. Use this to do searching for ambiguous functions ---
it will get more uses soon.
Bruce Momjian [Fri, 5 Apr 2002 11:58:24 +0000 (11:58 +0000)]
This patch adds a missing heap_freetuple() to renamerel(), documents
the decision not to make renamerel() update the sequence name that
is stored within sequences themselves (thanks to Tom Lane), and adds
some rudimentary regression tests for ALTER TABLE ... RENAME on
non-table relations.
Bruce Momjian [Fri, 5 Apr 2002 11:52:38 +0000 (11:52 +0000)]
I was tinkering with creating rules on views (so, for instance, one could
insert on a view), and noticed that psql wouldn't show the list of rules
set up on a view, like it does for tables.
The fix was extremely simple, so I figured I'd share it. Not sure what
the standard is for communicating these things, so I've attached the diff
file for /src/bin/psql/describe.c.
Bruce Momjian [Fri, 5 Apr 2002 11:39:47 +0000 (11:39 +0000)]
When a macro is replaced by the preprocessor, pgc.l reaches a end of
file, which is not the actual end of the file. One side effect of that
is that if you are i n a ifdef block, you get a wrong error telling you
that a endif is missing.
This patch corrects pgc.l and also adds a test of this problem to
test1.pgc. To convince you apply the patch to test1.pgc first then try
to compile the test the n apply the patch to pgc.l.
The patch moves the test of the scope of an ifdef block to the end of
the file b eeing parsed, including all includes files, ... .
Bruce Momjian [Fri, 5 Apr 2002 11:38:13 +0000 (11:38 +0000)]
Looks like a small patch is needed as well to do the right thing on Linux.
The patch enables the mips2 ISA for the ll/sc operations, and then restores
it when done. The kernel/libc emulation code will take over on CPUs without
ll/sc, and on CPUs with it, it'll use the operations provided by the CPU.
Combined with the earlier fix (removing -mips2), postgresql builds again on
mips and mipsel. The patch is against 7.2-7.
Tom Lane [Fri, 5 Apr 2002 05:47:05 +0000 (05:47 +0000)]
Undo not-so-hot decision to postpone insertion of default values into
INSERT statements to the planner. Taking it out of the parser was right
(so that defaults don't get into stored rules), but it has to happen
before rewrite rule expansion, else references to NEW.field behave
incorrectly. Accordingly, add a step to the rewriter to insert defaults
just before rewrite-rule expansion.
Tom Lane [Fri, 5 Apr 2002 00:31:36 +0000 (00:31 +0000)]
Divide functions into three volatility classes (immutable, stable, and
volatile), rather than the old cachable/noncachable distinction. This
allows indexscan optimizations in many places where we formerly didn't.
Also, add a pronamespace column to pg_proc (it doesn't do anything yet,
however).
Bruce Momjian [Thu, 4 Apr 2002 06:27:45 +0000 (06:27 +0000)]
This patch against 0.98.7 lib/tables.tcl will allow PGAccess to create new
records containing apostrophes in text fields without altering the appearance
of the entry in the GUI interface (by copying the fldval to fldvalfixed).
This will alleviate the need for users to create a record and then go back to
edit apostrophes into the text they entered.
Bruce Momjian [Thu, 4 Apr 2002 04:25:54 +0000 (04:25 +0000)]
Authentication improvements:
A new pg_hba.conf column, USER
Allow specifiction of lists of users separated by commas
Allow group names specified by +
Allow include files containing lists of users specified by @
Allow lists of databases, and database files
Allow samegroup in database column to match group name matching dbname
Removal of secondary password files
Remove pg_passwd utility
Lots of code cleanup in user.c and hba.c
New data/global/pg_pwd format
New data/global/pg_group file
Tom Lane [Wed, 3 Apr 2002 00:44:27 +0000 (00:44 +0000)]
Replace perror() calls by elog()s, so that messages can be routed to
syslog when appropriate. These were the last perror() calls remaining
in the backend; let's not reintroduce any...
Tom Lane [Wed, 3 Apr 2002 00:27:25 +0000 (00:27 +0000)]
Allow postmaster to start up anyway when PGSTAT code fails to initialize,
per recent discussion on pghackers. Also, fix PGSTAT code to report
errors via elog, not scribbling directly on stderr.
This seems to work just fine; Now, when our users submit a 2 hour
query with four million row sorts by accident, then cancel it 30 seconds
later, it doesn't bog down the server ...
Barry Lind [Tue, 2 Apr 2002 06:24:10 +0000 (06:24 +0000)]
Removed error message that was incorectly being issued. This fixes a problem reported a few months ago where a select in a rule was causing an insert statement to return a result set which the code was explicitly prohibiting.
Tom Lane [Tue, 2 Apr 2002 05:11:55 +0000 (05:11 +0000)]
Fix CLOG truncation code to not do the Wrong Thing when there are already
wrapped-around databases. The unvacuumed databases might be fine, or
they might not, but things will definitely not be fine if we remove the
wrong CLOG segments. Per trouble report from Gary Wolfe, 1-Apr-2002.