Commit Graph

8584 Commits

Author SHA1 Message Date
Tom Lane a390975cc1 Neatnik fetishism. 2001-10-03 15:42:12 +00:00
Thomas G. Lockhart 3e1beda2cd Implement precision support for timestamp and time, both with and without
time zones.
SQL99 spec requires a default of zero (round to seconds) which is set
 in gram.y as typmod is set in the parse tree. We *could* change to a
 default of either 6 (for internal compatibility with previous versions)
 or 2 (for external compatibility with previous versions).
Evaluate entries in pg_proc wrt the iscachable attribute for timestamp and
 other date/time types. Try to recognize cases where side effects like the
 current time zone setting may have an effect on results to decide whether
 something is cachable or not.
2001-10-03 05:29:27 +00:00
Thomas G. Lockhart af9747c375 Fix up bad indenting in a few places. 2001-10-03 05:23:12 +00:00
Tom Lane f2c657375d Add CREATE OR REPLACE FUNCTION syntax to allow replacing a function
definition without changing the function's OID, thereby not breaking
rules, views, triggers, etc that depend on it.  From Gavin Sherry.
2001-10-02 21:39:36 +00:00
Michael Meskes fecbeedc7e Re-added Tom's patch fixing my setlocale patch. I accidently
deleted it.
2001-10-02 14:08:28 +00:00
Tom Lane c7a7107f41 Revise shmget() and semget() failure messages to mention the possibility
of coping by reducing shared_buffers/max_connections settings.
2001-10-01 23:26:55 +00:00
Tom Lane 1929a90b69 Change pg_dump to produce CREATE INDEX commands by using the backend's
pg_get_indexdef() function, rather than reaching into the system catalogs
for itself.  This eliminates a fair amount of redundant code.  Also,
since I just changed pg_get_indexdef() to suppress display of default
index opclasses, this will mean that 7.2 and later dumps will not mention
opclasses unless they are non-default opclasses.  Should make life easier
for future index opclass reorganizations.
2001-10-01 21:31:52 +00:00
Tom Lane e5bbf19659 Extend pg_get_indexdef() to know about index predicates. Also, tweak
it to suppress index opclass output for opclasses that are the default
for their datatype; only non-default opclasses are shown explicitly.
This is expected to improve portability of the CREATE INDEX command
across future versions of Postgres --- we've changed index opclasses
too often in the past to think we won't do so again.
2001-10-01 20:15:26 +00:00
Tom Lane 0648d78ac4 Make inclusion logic for sys/sem.h and sys/ipc.h consistent across all
the files that need them.  Per trouble report from Teodor.
2001-10-01 18:16:35 +00:00
Tom Lane 6d18c038b7 Fix a couple of stray // comments. 2001-10-01 17:53:12 +00:00
Bruce Momjian 77d2622498 Add sys/types.h for FreeBSD compile.
Teodor Sigaev
2001-10-01 17:52:34 +00:00
Tom Lane 87fd2dbe7c Clean up a little more carefully around fork of pgstat subprocess.
Partial support for BEOS (not sure whether second fork of grandchild
process needs these extra calls or not; someone who has BEOS will need
to test it).
2001-10-01 16:48:37 +00:00
Bruce Momjian 034895125d > > > > > - PostgreSQL requires to be compiled with --enable-multibyte
> > > > >   and --enable-unicode-convertion if it ought to work correctly
> > > > >   with Tcl/Tk >= 8.1 (client or server side).
> > > > >
> > > > > - PL/Tcl needs to be changed to use pg_do_encoding_conversion
> > > > >   if it runs on a Tcl version >= 8.1 .
> > >
> > > > I'll do pl/tcl part in the next version of patch. Using this approach we
> > > > can eliminate overhead for databases in UNICODE.
> > >
> > > Any progress on this?  I'd prefer to get rid of this --enable-pltcl-utf
> > > option before release.
> >
> > Done
> >
> > Next version removes --enable-pltcl-utf switch and enables embedded
> > utf conversion of pgsql if tcl version >=8.1 and --enable-unicode-conversion
2001-10-01 15:33:31 +00:00
Michael Meskes 9f09e8362b - Fixed truncate bug.
- Added patch by Christof Petig <christof.petig@wtal.de> to
clean up
ecpglib.
2001-10-01 12:02:28 +00:00
Tom Lane 5999e78fc4 Another round of cleanups for dynahash.c (maybe it's finally clean of
portability issues).  Caller-visible data structures are now allocated
on MAXALIGN boundaries, allowing safe use of datatypes wider than 'long'.
Rejigger hash_create API so that caller specifies size of key and
total size of entry, not size of key and size of rest of entry.
This simplifies life considerably since each number is just a sizeof(),
and padding issues etc. are taken care of automatically.
2001-10-01 05:36:17 +00:00
Tom Lane f58179669a Suppress timestamp_ops for backwards compatibility with 7.1 pg_dump. 2001-10-01 04:19:18 +00:00
Tatsuo Ishii a8443da57a Remove C++ style comment. Some compilers won't accept it. 2001-10-01 02:31:33 +00:00
Tatsuo Ishii 464f20cf7b Fix a compile error on a platform that does not have PAM. 2001-10-01 02:26:36 +00:00
Tom Lane 95d4821b1c Make libpq++ safe again for older C++ compilers. Do 'using namespace std'
only if configure found it was safe to do so; do not assume const_cast
is available.
2001-09-30 22:30:37 +00:00
Bruce Momjian c6f94644a0 These are further fixes for double quotes missing in the various shell
scripts.

Justin Clift
2001-09-30 22:17:51 +00:00
Tom Lane 7eff804b49 Clean up encode/decode functions a little bit. 2001-09-30 22:03:41 +00:00
Tom Lane 12054ba506 Fix sloppiness about static vs non-static declaration of functions.
Some compilers are pickier about this than gcc is.
2001-09-30 21:48:58 +00:00
Tom Lane b16a8f49a7 pg_stat_get_backend_idset should reset fmgr_info->fn_extra at end of
execution, so that it restarts correctly if query tree is used again.
2001-09-30 21:01:39 +00:00
Tom Lane f00da6d841 Allow the postmaster to accept changes in PGC_BACKEND GUC variables
from the config file, so that these changes will propagate to backends
started later.  Already-started backends continue to ignore changes
in these variables.
2001-09-30 20:16:21 +00:00
Tom Lane e43d51fddc ISTM that IsUnderPostmaster should mean we are a child process of the
postmaster ... it should not be set in the postmaster itself.
2001-09-30 20:08:18 +00:00
Tom Lane f9f258281e Create a GUC parameter max_files_per_process that is a configurable
upper limit on what we will believe from sysconf(_SC_OPEN_MAX).  The
default value is 1000, so that under ordinary conditions it won't
affect the behavior.  But on platforms where the kernel promises far
more than it can deliver, this can be used to prevent running out of
file descriptors.  See numerous past discussions, eg, pgsql-hackers
around 23-Dec-2000.
2001-09-30 18:57:45 +00:00
Tom Lane 40ed132ce7 Addition of xid=int4 operator makes opr_sanity unhappy. 2001-09-30 17:37:32 +00:00
Tom Lane 650c175042 winsock_strerror crashed on me. This fixes a line of code that looks
cleverer than it actually is ;-) Braces are good for you :-)

Gerhard HÌring
2001-09-30 16:23:30 +00:00
Hiroshi Inoue f7d607748a Add an operator xid '=' int and remove BINARY_COMPATI... 2001-09-30 06:46:58 +00:00
Bruce Momjian 0386ccfed1 Back out change. Too many place to change too close to beta:
* HOLDER/HOLDERTAB rename to PROCLOCKLINK/PROCLOCKLINKTAG (Bruce)

Will return later.
2001-09-30 00:45:48 +00:00
Tom Lane 1663f33838 Tweak btree page split logic so that when splitting a page that is
rightmost on its tree level, we split 2/3 to the left and 1/3 to the
new right page, rather than the even split we use elsewhere.  The idea
is that when faced with a steadily increasing series of inserted keys
(such as sequence or timestamp values), we'll end up with a btree that's
about 2/3ds full not 1/2 full, which is much closer to the desired
steady-state load for a btree.  Per suggestion from Ann Harrison of
IBPhoenix.
2001-09-29 23:49:51 +00:00
Hiroshi Inoue 1647d3ae61 Allow comparison between xid and xid, int. 2001-09-29 23:01:26 +00:00
Bruce Momjian f738747494 Do this TODO item:
* HOLDER/HOLDERTAB rename to PROCLOCK/PROCLOCKTAG (Tom)

Didn't use PROCLOCKLINK because it made PROCLOCKLINKTAG too long.
2001-09-29 21:35:14 +00:00
Tom Lane 8ca61476e0 Cope with the likelihood that setlocale and localeconv will return
pointers to data that will be changed by any later call to setlocale.
Must copy what they return to be sure we get the right answer.
Karel Zak, further tweaks by Tom Lane.
2001-09-29 21:16:30 +00:00
Tom Lane dc05a996c5 Fix the setlocale problem in a way that actually works. setlocale
returns a string corresponding to the new setting, not the old,
therefore the previous patch was quite wrong.
2001-09-29 20:12:07 +00:00
Tom Lane 742d0f25c1 Clean up comments. 2001-09-29 19:49:50 +00:00
Tom Lane 2a314add00 Whoops, I was a tad too enthusiastic about using shared lock mode for
SInvalLock.  GetSnapshotData(true) has to use exclusive lock, since
it sets MyProc->xmin.
2001-09-29 15:29:48 +00:00
Tom Lane 6fdf7bed60 Fixes for datetime-related regress tests, from Tom Lockhart. 2001-09-29 15:17:42 +00:00
Hiroshi Inoue 53b2e00491 Keep the contents of ItemPointerData not the pointers so that
per tuple memory context doesn't discard them.
2001-09-29 07:57:06 +00:00
Tom Lane e3831d83a7 timetz test was omitted from parallel_schedule. 2001-09-29 05:33:25 +00:00
Tom Lane c0bff32c84 Update horology-no-DST-before-1970.out for new horology test.
Still need an update for horology-solaris-1947.out ...
2001-09-29 05:11:10 +00:00
Tom Lane 499abb0c0f Implement new 'lightweight lock manager' that's intermediate between
existing lock manager and spinlocks: it understands exclusive vs shared
lock but has few other fancy features.  Replace most uses of spinlocks
with lightweight locks.  All remaining uses of spinlocks have very short
lock hold times (a few dozen instructions), so tweak spinlock backoff
code to work efficiently given this assumption.  All per my proposal on
pghackers 26-Sep-01.
2001-09-29 04:02:27 +00:00
Bruce Momjian 818fb55ac4 I have made three changes to the rtree code: one bug fix and
two performance improvements.  I put an explanation of the
changes at

http://cs1.cs.nyu.edu/been/postgres-rtree.html

The performance improvements are quite significant.

All the changes are in the file src/backend/access/rtree/rtree.c

I was working with the 7.1.3 code.

I'm including the diff output as an attachment.

Kenneth Been
2001-09-29 03:46:12 +00:00
Bruce Momjian 850ba41677 A couple of lines were missing from my last patch - this one fixes things.
Liam Stewart
2001-09-29 03:11:11 +00:00
Bruce Momjian 40cd81cff4 This is a simple patch to put double quotes around a few cases in
pg_ctl.sh which were unquoted when inside of [].

Justin Clift
2001-09-29 03:09:32 +00:00
Bruce Momjian 07ce9fe61d Per the recent discussion there's been some code changes in JDBC's
DatabaseMetaData.getColumn(). I proposed a patch that would change the
number of queries to find out all columns in a table from 2 * N + 1 to 1 (N
being the number of columns reported) by using some outer joins. I also
fixed the fact that getColumns() only returned columns that had a default
defined. OTOH, I did not use to change the code required for obtaining a
column's remarks (by using col_description() for 7.2  and requested by Tom
Lane).

Finally, I have found a way to get all the column details in a single query
*and* use col_description() for 7.2 servers. A patch is attached. It
overrules Ren? Pijlman's fix for this that was committed just today, but
still used N + 1 queries (sorry Ren? ;-) )

I also fixed the return values for TABLE_CAT and TABLE_SCHEM from "" to
null, to be more standard compliant (and requested in Ren?'s mail found at
http://fts.postgresql.org/db/mw/msg.html?mid=1034253).

As always, the JDBC1 version has not been tested as I have no JDK 1.1

Jeroen van Vianen
2001-09-29 03:08:01 +00:00
Hiroshi Inoue 5b328502b5 Fix the bug about boolean type handling reported by
Kristis Markis.
2001-09-29 02:48:04 +00:00
Bruce Momjian 9dcec8135b Improve wording. 2001-09-28 19:25:36 +00:00
Thomas G. Lockhart 6f58115ddd Measure the current transaction time to milliseconds.
Define a new function, GetCurrentTransactionStartTimeUsec() to get the time
 to this precision.
Allow now() and timestamp 'now' to use this higher precision result so
 we now have fractional seconds in this "constant".
Add timestamp without time zone type.
Move previous timestamp type to timestamp with time zone.
Accept another ISO variant for date/time values: yyyy-mm-ddThh:mm:ss
 (note the "T" separating the day from hours information).
Remove 'current' from date/time types; convert to 'now' in input.
Separate time and timetz regression tests.
Separate timestamp and timestamptz regression test.
2001-09-28 08:09:14 +00:00
Thomas G. Lockhart 1f075a32ee Add separate regression tests for timetz and the new timestamptz type.
Modify the timestamp test to reflect the "no time zone" behavior of this
 new code; timestamptz resembles the old timestamp code.
2001-09-28 08:00:11 +00:00