Commit Graph

3353 Commits

Author SHA1 Message Date
Bruce Momjian
f71b671bd5 Make EXPLAIN show output more clearly. 1998-08-04 04:50:15 +00:00
Bruce Momjian
c8b42a6151 Update flow chart. 1998-08-04 00:42:14 +00:00
Bruce Momjian
439a2af0bc Update mark/reset index code for multiple indexes, (OR code).
Thanks for Vadim for fixes.
1998-08-03 19:41:35 +00:00
Bruce Momjian
21ad8695ca Fix typo in man pages. 1998-08-03 05:54:30 +00:00
Bruce Momjian
b88e9784b6 Cleanup of OR processing. 1998-08-03 05:49:24 +00:00
Thomas G. Lockhart
7665e7b0a8 Allows the following query to succeed: "SELECT NULL ORDER BY 1;"
There are three or four cases in transformSortClause() and I had fixed
only one case for UNION. A second case is now fixed, in the same way; I
assigned INT4OID to the column type for the "won't actually happen"
sort. Didn't want to skip the code entirely, since the backend needs to
_try_ a sort to get the NULLs right. I'm not certain under what
circumstances the other cases are invoked and these are not yet
fixed up, though perhaps they don't need to be...
1998-08-02 13:34:26 +00:00
Bruce Momjian
39844ac2c3 Fix for OR handling with multiple indexes. 1998-08-02 07:10:38 +00:00
Bruce Momjian
34aecb3557 run autoconf 1998-08-02 00:34:05 +00:00
Bruce Momjian
b942928bd1 Fix MULTIBYTE typo. 1998-08-02 00:21:39 +00:00
Bruce Momjian
77cce4e278 Fix duplicate inside initdb.sh 1998-08-01 22:57:41 +00:00
Bruce Momjian
2c6b370e64 Cleanup of OR fix. 1998-08-01 22:44:55 +00:00
Bruce Momjian
0a2e5cdfc9 Allow index use with OR clauses. 1998-08-01 22:12:13 +00:00
Marc G. Fournier
0668aa8817 Adrian Hall reported a problem to me that snprintf() doesn't exist in, at
least, Solaris 2.5.1.  We use it in backend/utils/adt/int8.c.

Add a check to configure so that we see if it exists or not, and, if not,
compile in snprintf.c from backend/port, which was taken from, and falls under
the same Berkeley license as us, the FreeBSD libc/stdio ...
1998-08-01 19:30:29 +00:00
Vadim B. Mikheev
0d78e8c112 Lmgr cleanup, new locking modes for LLL. 1998-08-01 15:26:38 +00:00
Vadim B. Mikheev
83d3626b1f Matching clauses to functional indices was broken, now fixed. 1998-07-31 15:10:40 +00:00
Vadim B. Mikheev
f73fc6eb29 Fix scan adjustment. 1998-07-30 05:05:05 +00:00
Vadim B. Mikheev
be8300b18f Use Snapshot in heap access methods. 1998-07-27 19:38:40 +00:00
Marc G. Fournier
f7f989c990 Missed a few files in the last round of commits from Tatsuo, as well
as needed to run autoconf ...
1998-07-27 03:21:58 +00:00
Marc G. Fournier
5979d73841 From: t-ishii@sra.co.jp
As Bruce mentioned, this is due to the conflict among changes we made.
Included patches should fix the problem(I changed all MB to
MULTIBYTE). Please let me know if you have further problem.

P.S. I did not include pathces to configure and gram.c to save the
file size(configure.in and gram.y modified).
1998-07-26 04:31:41 +00:00
Marc G. Fournier
74b30a3a1f I missed addding initdb.sh ... 1998-07-26 04:22:42 +00:00
Bruce Momjian
e05aa52a55 Update flowchart. Add arrow. 1998-07-26 02:17:55 +00:00
Bruce Momjian
01a651aaf9 Fix compile error. Make transaction/work optional on all transaction
statements.  More cleanups of psql help.  Fix for shift/reduce on
UNION in subselect.
1998-07-26 01:18:09 +00:00
Bruce Momjian
d8d0aa019b Update psql help syntax to remove <> and uppercaese keywords. 1998-07-25 00:17:30 +00:00
Bruce Momjian
8e2647a145 Add mention of actual SQL command to create*/destroy* commands. 1998-07-24 16:44:04 +00:00
Bruce Momjian
22616fdc5d Add mention of SQL commands to create/destroy man pages. 1998-07-24 16:36:56 +00:00
Bruce Momjian
253a294e9f Add mention of psql and template1 to create*, destroy* command
manual pages.
1998-07-24 16:10:19 +00:00
Bruce Momjian
809fc91fdd Fix HAVING patch missing cast. 1998-07-24 15:54:10 +00:00
Bruce Momjian
128d827d4b I'm sorry, but I think I introduced a little bug with my last patch.
Everyone using an [NOT] EXISTS subquery will have noticed that
already.

The bug is in "subselect.c" in the function "SS_process_sublinks()".

Here the whole function as it *SHOULD BE*:

Stephan
1998-07-24 04:03:10 +00:00
Marc G. Fournier
bf00bbb0c4 I really hope that I haven't missed anything in this one...
From: t-ishii@sra.co.jp

Attached are patches to enhance the multi-byte support.  (patches are
against 7/18 snapshot)

* determine encoding at initdb/createdb rather than compile time

Now initdb/createdb has an option to specify the encoding. Also, I
modified the syntax of CREATE DATABASE to accept encoding option. See
README.mb for more details.

For this purpose I have added new column "encoding" to pg_database.
Also pg_attribute and pg_class are changed to catch up the
modification to pg_database.  Actually I haved added pg_database_mb.h,
pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is
enabled. The reason having separate files is I couldn't find a way to
use ifdef or whatever in those files. I have to admit it looks
ugly. No way.

* support for PGCLIENTENCODING when issuing COPY command

commands/copy.c modified.

* support for SQL92 syntax "SET NAMES"

See gram.y.

* support for LATIN2-5
* add UNICODE regression test case
* new test suite for MB

New directory test/mb added.

* clean up source files

Basic idea is to have MB's own subdirectory for easier maintenance.
These are include/mb and backend/utils/mb.
1998-07-24 03:32:46 +00:00
Byron Nikolaidis
6e66468f3a Version 06-30-0248 1998-07-22 23:47:48 +00:00
Vadim B. Mikheev
2a67742412 Fix _lo_commit: core if LO memmory context was not created (LO were not used?) 1998-07-22 05:48:59 +00:00
Vadim B. Mikheev
5afe171443 VariableCache (next XID generator) is placed in shmem. 1998-07-21 06:17:39 +00:00
Bruce Momjian
224a62c5b7 Update. 1998-07-21 04:48:31 +00:00
Bruce Momjian
7f61f8a71f Update. 1998-07-21 04:19:44 +00:00
Bruce Momjian
e0058b6172 Theses buffer leaks are caused by indexes that are kept open between
calls. Outside a transaction, the backend detects them as buffer
leaks; it sends a NOTICE, and frees them. This sometimes cause a
segmentation fault (at least on Linux). These indexes are initialized
on the first lo_read/lo_write/lo_tell call, and (normally) closed
on a lo_close call.  Thus the buffer leaks appear when lo direct
access functions are used, and not with lo_import/lo_export functions
(libpq version calls lo_close before ending the command, and the
backend version uses another path).

The included patches (against recent snapshot, and against 6.3.2)
cause indexes to be closed on transaction end (that is on explicit
'END' statment, or on command termination outside trasaction blocks),
thus preventing the buffer leaks while increasing performance inside
transactions. Some (all?) 'classic' memory leaks are also removed.

I hope it will be ok.

--- Pascal ANDRE, graduated from Ecole Centrale Paris andre@via.ecp.fr
1998-07-21 04:17:30 +00:00
Bruce Momjian
7702d7aa4b target list fixes. 1998-07-20 21:18:35 +00:00
Bruce Momjian
1d00134be4 makeTargetEntry cleanup. 1998-07-20 20:48:54 +00:00
Bruce Momjian
61700b4089 Makefile removal of internal.c. 1998-07-20 20:01:48 +00:00
Bruce Momjian
3dd2eabc53 Cleanup makeTargetEntry and remove internal.c. 1998-07-20 19:53:53 +00:00
Bruce Momjian
97ac8f7ffc Use defines rather than constants for types. 1998-07-20 19:21:45 +00:00
Bruce Momjian
db48f7a153 Fix problem brought in with 32K machine. 1998-07-20 17:45:49 +00:00
Bruce Momjian
0da6358f37 Cleanup use of 16 that should be NAMEDATALEN. 1998-07-20 16:57:18 +00:00
Bruce Momjian
34797d4225 Cleanup Name usage. 1998-07-20 16:14:18 +00:00
Bruce Momjian
7193719b4f Fix temp name length. 1998-07-20 11:28:12 +00:00
Bruce Momjian
aabdd3094c Remove un-needed references to Name. 1998-07-20 11:17:11 +00:00
Bruce Momjian
a6ca652508 Update version. 1998-07-20 10:01:51 +00:00
Bruce Momjian
aac163336f Remove unneeded strcpy() of timezone. 1998-07-19 10:08:15 +00:00
Bruce Momjian
4e6eb4aca1 Remove un-needed psort close. 1998-07-19 10:05:19 +00:00
Bruce Momjian
a292ed243a Lock fix from Tom Ivar Helbekkmo . 1998-07-19 09:44:36 +00:00
Bruce Momjian
460b20a43f 1) Queries using the having clause on base tables should work well
now. Here some tested features, (examples included in the patch):

1.1) Subselects in the having clause 1.2) Double nested subselects
1.3) Subselects used in the where clause and in the having clause
     simultaneously 1.4) Union Selects using having 1.5) Indexes
on the base relations are used correctly 1.6) Unallowed Queries
are prevented (e.g. qualifications in the
     having clause that belong to the where clause) 1.7) Insert
into as select

2) Queries using the having clause on view relations also work
   but there are some restrictions:

2.1) Create View as Select ... Having ...; using base tables in
the select 2.1.1) The Query rewrite system:

2.1.2) Why are only simple queries allowed against a view from 2.1)
? 2.2) Select ... from testview1, testview2, ... having...; 3) Bug
in ExecMergeJoin ??


Regards Stefan
1998-07-19 05:49:26 +00:00
Bruce Momjian
916710fc91 pg_dump -z has gotten rather thoroughly broken in the last couple
of days --- it was emitting stuff like
	REVOKE ALL on 'table' from PUBLIC; GRANT ALL on "table" to
	"Public"; neither of which work.  While I was at it I
cleaned up a few other things:

* \connect commands are issued only in -z mode.  In this way,
reloading a pg_dump script made without -z will generate a simple
database wholly owned by the invoking user, rather than a mishmash
of tables owned by various people but lacking in access rights.
(Analogy: cp versus cp -p.)

* \connect commands are issued just before COPY FROM stdin commands;
without this, reloading a database containing non-world-writable
tables tended to fail because the COPY was not necessarily attempted
as the table owner.

* Redundant \connect commands are suppressed (each one costs a
backend launch, so...).

* Man page updated (-z wasn't ever documented).

The first two items were discussed in a pgsql-hackers thread around
6 May 98 ("An item for the TODO list: pg_dump and multiple table
owners") but no one had bothered to deal with 'em yet.

			regards, tom lane
1998-07-19 05:24:51 +00:00
Bruce Momjian
b41468dad2 Make sparc/solaris not use complex macr. 1998-07-19 05:02:51 +00:00
Bruce Momjian
cf21d71a14 Attached are the three patches that were needed to get PostgreSQL
6.3.2 to compile (and run) on my Sparc Solaris 2.5.1 box. Details
below:

	pgsql.sparc.patch-template: Adds -D__sparc__ and -D__sun__,
defintions which gcc does define, but Sun's cc does not. :(
	pgsql.sparc.patch-makefile: Adds a define so that 'lorder'
	is not used, as it is not found on my machine.


Ryan Kirkpatrick
1998-07-19 04:30:04 +00:00
Bruce Momjian
0624f3dcbd My mailer munged the intro text in my last post. Here is the text
in a more readable form.  -- I am submitting the following patches
to the June 6, 1998 snapshot of PostgreSQL.  These patches implement
a port of PostgreSQL to SCO UnixWare 7, and updates the Univel port
(UnixWare 2.x).  The patched files, and the reason
 for the patch are:

File            Reason for the patch ---------------
---------------------------------------------------------------
src/backend/port/dynloader/unixware.c src/backend/port/dynloader/unixware.h
src/include/port/unixware.h src/makefiles/Makefile.unixware
src/template/unixware
		Created for the UNIXWARE port.

src/include/port/univel.h
		Modifed this file to work with the changes made to
		s_lock.[ch].

src/backend/storage/buffer/s_lock.c src/include/storage/s_lock.h
		Moved the UNIXWARE (and Univel) tas() function from
		s_lock.c to s_lock.h.  The UnixWare compiler asm
		construct is treated as a macro and needs to be in
		the s_lock.h file.  I also reworked the tas()
		function to correct some errors in the code.

src/include/version.h.in
		The use of the ## operator with quoted strings in
		the VERSION macro caused problems with the UnixWare
		C compiler.  I removed the ## operators since they
		were not needed in this case.  The macro expands
		into a sequence of quoted strings that will be
		concatenated by any ANSI C compiler.

src/config.guess
		This script was modified to recognize SCO UnixWare
		7.

src/configure src/configure.in
		The configure script was modified to recognize SCO
		UnixWare 7.

Billy G. Allie
1998-07-19 04:17:13 +00:00
Bruce Momjian
5b4ca67147 Conditionally execute Junk filter only when ORDER BY of columns
not in target list.
1998-07-19 03:46:29 +00:00
Bruce Momjian
62cd6e7b75 Somewhere between 6.1 and 6.3 someone removed the support for the
NS32K machine I contributed.  In any case, I now have postgresql-6.3
running again on NetBSD/pc532, a NS32532 machine.  The following
changes are needed relative to the src directory.  (It looks like
support was partially removed when the files were moved from the
src/backend/storage/.... tree to the src/include tree.)

If you need me to get a current development version of postgresql
for this change let me know.  Also, let me know if this code needs
updating due to another code movement that deleted the old NS32K
support.

Thank you.

Phil Nelson
1998-07-19 01:19:54 +00:00
Bruce Momjian
8ae23e1305 Add DISABLE_COMPLEX_MACRO to sco. 1998-07-19 01:11:01 +00:00
Bruce Momjian
7b2b779a2a Add auto-size to screen to \d? commands. Use UNION to show all
\d? results in one query. Add \d? field search feature.  Rename MB
to MULTIBYTE.
1998-07-18 18:34:34 +00:00
Bruce Momjian
550f209797 Move common lock code to their own section. 1998-07-18 14:58:58 +00:00
Bruce Momjian
a93f397423 On architectures where we don't have any special inline code for
GCC, the inner "#if defined(__GNUC__)" can just be omitted in that
architecture's block.

The existing arrangement with an outer "#if defined(__GNUC__)"
doesn't have any obvious benefit, and it encourages missed cases
like this one.


BTW, I'd suggest making the definition of clear_lock for HPUX be

static const slock_t clear_lock = {{-1, -1, -1, -1}};

The extra braces are needed to suppress warnings from gcc, and
declaring it const just seems like good practice.

			regards, tom lane
1998-07-18 14:51:10 +00:00
Bruce Momjian
b47466482f Thank you for testing and reporting this. It is my fault of course,
but as I don't have access to a sparc for testing I just did what
I could. I am guessing here, but please apply the following to your
pgsql and let me know what happens. Also, cd to src/storage/buffer
and do 'make s_lock_test' as well.

David Gould
1998-07-18 14:38:12 +00:00
Bruce Momjian
584f9438ca Rename Rel to RelOptInfo. 1998-07-18 04:22:52 +00:00
Bruce Momjian
3a132e9d83 update 1998-07-17 18:19:31 +00:00
Bruce Momjian
96f5323bcd Remove monitor mention and add psql. 1998-07-16 15:54:39 +00:00
Bruce Momjian
e2bc275657 Fix for Group ReScan suggested by Vadim. 1998-07-16 02:58:09 +00:00
Bruce Momjian
4f807be2ad Patch for ReScan of Group. 1998-07-16 01:49:19 +00:00
Bruce Momjian
c1f1a2e03a Allow UNION/UNION ALL in subselects. 1998-07-15 22:16:21 +00:00
Bruce Momjian
2077ce123b Fix for COPY problem and atttypmod. 1998-07-15 18:53:40 +00:00
Bruce Momjian
36549074a3 Update word. 1998-07-15 17:34:06 +00:00
Bruce Momjian
866a527163 Add PGUSER to man page. 1998-07-15 17:08:23 +00:00
Bruce Momjian
86883aec4f Allow UNION in subselect. 1998-07-15 15:56:36 +00:00
Bruce Momjian
9e964f90fb Fix explain for union and inheritance. Rename Append structure
members to be clearer.  Fix cost computation for these.
1998-07-15 14:54:39 +00:00
Thomas G. Lockhart
9fdbbdc877 Fix for UNION selects with constant NULL expressions; e.g.
SELECT 1 UNION SELECT NULL;
1998-07-14 03:51:42 +00:00
Bruce Momjian
0acc52ae91 utoconf 1998-07-14 03:02:53 +00:00
Bruce Momjian
36b03601c3 Update for hpux and rint 1998-07-14 02:58:59 +00:00
Bruce Momjian
e36f96e42a More updates for typmod int32 change. From Tom Lane. 1998-07-14 02:41:26 +00:00
Bruce Momjian
3600fd320f Major man page update from Tom Lane. c 1998-07-14 01:45:25 +00:00
Bruce Momjian
f99dcd6d15 Fix for AS name quotation problem. 1998-07-13 21:27:58 +00:00
Bruce Momjian
976b3862ce Currently, building on any platform that hasn't got getrusage()
requires manual editing of src/backend/port/getrusage.c, because
its substitute version of getrusage is #if'd out.

There is no good reason for that, because configure won't even
include the file into the Makefile unless the platform hasn't got
getrusage.  Furthermore, we only have one working substitute version
of getrusage --- the alleged HPUX syscall-based code doesn't work.
(It causes a coredump because the syscall returns a struct rusage
that's much larger than the stub struct defined in
src/include/rusagestub.h.)  The times()-based emulation works fine
on HPUX, however.

I propose, therefore, that getrusage.c should just unconditionally
compile the times-based version, and rely on configure to include
the file only if needed.  This will be one less manual configuration
step on all platforms that need this code.

Patch attached.

Tom Lane.
1998-07-13 16:39:07 +00:00
Bruce Momjian
5aea4062d6 Inline function, rename libpq variablees, change lrel to lockrel. 1998-07-13 16:35:04 +00:00
Bruce Momjian
8bac4ca87b Rename libpq to use more normal field names. 1998-07-13 02:41:59 +00:00
Bruce Momjian
6ce9c76b0a Fix libpq because it was reading from the backend as a short. 1998-07-13 00:01:45 +00:00
Bruce Momjian
dc189183eb removed unneeded long spec on constants. 1998-07-12 23:41:19 +00:00
Bruce Momjian
683f399391 Change atttypmod from int16 to int32, for Thomas. 1998-07-12 21:29:40 +00:00
Bruce Momjian
647bbfb086 Fix distclean in libpq++. 1998-07-12 19:20:45 +00:00
Bruce Momjian
cfef73b4c0 Update linux_i386 fix. 1998-07-12 18:48:08 +00:00
Bruce Momjian
37273977cb add mention of DISTINCT ON attrN 1998-07-12 04:49:47 +00:00
Bruce Momjian
76dd88f10b Reverse out unused patch. 1998-07-12 04:43:28 +00:00
Bruce Momjian
2a8996f631 Print relation name before vacuum, results after vacuum. 1998-07-12 04:37:55 +00:00
Thomas G. Lockhart
fdcab1dbcb Moved to select_implicit.out. 1998-07-11 12:46:20 +00:00
Bruce Momjian
da9db56930 change <CODE> to <I>. 1998-07-09 17:59:49 +00:00
Bruce Momjian
b992bb457d update 1998-07-09 15:45:00 +00:00
Bruce Momjian
db82332bdc Fix for views that use AS with two words. 1998-07-09 14:59:27 +00:00
Thomas G. Lockhart
fa2a1d7d52 Handle case of GROUP BY target list column number out of range. 1998-07-09 14:34:05 +00:00
Thomas G. Lockhart
a3c9cce930 "select_implicit" is renamed from "junkfilter" test.
Move from last test in list up to other "select_xxx" tests.
1998-07-09 14:32:58 +00:00
Thomas G. Lockhart
511b368f97 Renamed from "junkfilter" test. 1998-07-09 14:32:14 +00:00
Marc G. Fournier
3a3c1b85a3 From: Tom Lane <tgl@sss.pgh.pa.us>
I see someone missed an ancient bit of shell-scripting lore:
on some older shells, if your script's argument list is empty,
then "$@" generates an empty-string word rather than no word
at all.  You need to write ${1+"$@"} to get the latter behavior.
(Read your shell man page to see exactly how that works,
but it does the Right Thing on every Bourne shell.)

In particular, pg_dumpall fails when invoked without any switches
on HPUX 9.*, because pg_dump gets an empty-string argument that it
thinks is the name of the database to dump.  I expect this bug
also affects some other OSes, but couldn't tell you just which ones.
Patch attached.
1998-07-09 03:35:39 +00:00
Marc G. Fournier
bd029bcb4a From: Tom Lane <tgl@sss.pgh.pa.us>
The attached patches respond to discussion that was on pgsql-hackers
around the beginning of June (see thread "libpgtcl bug (and symptomatic
treatment)").  The changes are:

1. Remove code in connectDB that throws away the password after making
a connection.  This doesn't really add much security IMHO --- a bad guy
with access to your client's address space can likely extract the
password anyway, to say nothing of what he might do directly.  And
there's the serious shortcoming that it prevents PQreset() from working
if the database requires a password.

2. Fix coredump problem: fe_sendauth did not guard against being handed
a NULL password pointer.  (This is the proximate cause of the coredump-
during-PQreset problem that Magosanyi Arpad complained of last month.)

3. Remove highly questionable "error recovery" logic in libpgtcl's
pg_exec statement.

I believe the consensus of the discussion last month was in favor of
#1 and #3, but I'm just now getting around to making the change.
I realized that #2 was a bug in process of looking at the change.
1998-07-09 03:32:10 +00:00
Marc G. Fournier
ce812671b1 From: Tom Lane <tgl@sss.pgh.pa.us>
Attached are diffs (from current cvs sources) to bring libpq.sgml
and libpq.3 up to date.

It appears that at various times in the past, people have made edits to
one or the other of these files but not both.  I propagated some changes
from each into the other, but I don't think I caught every
inconsistency.  It'd be real nice if the man pages could be
automatically generated from the SGML...
1998-07-09 03:30:49 +00:00
Marc G. Fournier
a0659e3e2c From: Tom Lane <tgl@sss.pgh.pa.us>
Making PQrequestCancel safe to call in a signal handler turned out to be
much easier than I feared.  So here are the diffs.

Some notes:
  * I modified the postmaster's packet "iodone" callback interface to allow
    the callback routine to return a continue-or-drop-connection return
    code; this was necessary to allow the connection to be closed after
    receiving a Cancel, rather than proceeding to launch a new backend...
    Being a neatnik, I also made the iodone proc have a typechecked
    parameter list.
  * I deleted all code I could find that had to do with OOB.
  * I made some edits to ensure that all signals mentioned in the code
    are referred to symbolically not by numbers ("SIGUSR2" not "2").
    I think Bruce may have already done at least some of the same edits;
    I hope that merging these patches is not too painful.
1998-07-09 03:29:11 +00:00