Commit Graph

4812 Commits

Author SHA1 Message Date
Tom Lane d079c419d2 Fix include paths for case of VPATH build. 2002-01-09 00:06:42 +00:00
Tom Lane 649d8543d3 Fix lpad() and rpad() to produce correct results in variable-length
multibyte encodings.
2002-01-08 17:03:41 +00:00
Tom Lane 5b9a058384 Tweak LWLock algorithms so that an awakened waiter for a lock is not
granted the lock when awakened; the signal now only means that the lock
is potentially available.  The waiting process must retry its attempt
to get the lock when it gets to run.  This allows the lock releasing
process to re-acquire the lock later in its timeslice.  Since LWLocks
are usually held for short periods, it is possible for a process to
acquire and release the same lock many times in a timeslice.  The old
spinlock-based implementation of these locks allowed for that; but the
original coding of LWLock would force a process swap for each acquisition
if there was any contention.  Although this approach reopens the door to
process starvation (a waiter might repeatedly fail to get the lock),
the odds of that being a big problem seem low, and the performance cost
of the previous approach is considerable.
2002-01-07 16:33:00 +00:00
Tom Lane a510bf4326 If we fail to fork a new backend process, (try to) report the failure
to the client before closing the connection.  Before 7.2 this was done
correctly, but new code would simply close the connection with no report
to the client.
2002-01-06 21:40:02 +00:00
Tom Lane 3b6cbce458 Add CHECK_FOR_INTERRUPTS() in various strategic spots, per comments
from Hiroshi.
2002-01-06 00:37:44 +00:00
Tom Lane 1aff1d30d6 Fix some incorrect and obsolete commentary. 2002-01-04 17:06:51 +00:00
Thomas G. Lockhart c826d1cefb Have to_date() call timestamptz_date() per Karel's email instructions.
Fixes time zone problems introduced by Thomas' implementation of
 TIMESTAMP WITHOUT TIME ZONE which caused the behavior of the previously
 appropriate routine, timestamp_date(), to change for the worse in this
 context.
2002-01-04 15:49:42 +00:00
Bruce Momjian 5a60ba5078 Replace #ifdef, #endif with # requires comment. 2002-01-04 05:50:25 +00:00
Tom Lane dc6b4deb97 Require ownership permission for CREATE INDEX, per bug report.
Disallow CREATE INDEX on system catalogs, non-tables (views, sequences, etc).
Disallow CREATE/DROP TRIGGER on system catalogs, non-tables.
Disallow ALTER TABLE ADD/DROP CONSTRAINT on system catalogs.
Disallow FOREIGN KEY reference to non-table.
None of these things can actually work in the present system structure,
but the code was letting them pass without complaint.
2002-01-03 23:21:32 +00:00
Tom Lane ab20692e1e SPI_cursor_open must copy by-reference parameter values into the
portal's memory context, so that they will live as long as the portal does.
2002-01-03 20:30:47 +00:00
Tom Lane f7fb29dec3 Shouldn't try to copy null datums with datumCopy. 2002-01-03 18:01:59 +00:00
Tom Lane b36df04ce2 Guard against roundoff errors in new selectivity-estimation code,
per bug report from Laurette Cisneros.
2002-01-03 04:02:34 +00:00
Tom Lane bb2bff498c Fix to_timestamp/to_date so that zero year input for Y, YY, or YYY
formats will be taken as 2000, not year zero.  Per bug report from
Aasmund Midttun Godal.  Fix from Karel Zak.
2002-01-02 22:09:23 +00:00
Tom Lane 4764ae823b Do not accept interrupts in RESUME_INTERRUPTS() and END_CRIT_SECTION()
macros, but only at explicit CHECK_FOR_INTERRUPTS() calls.  Not clear
whether overenthusiastic acceptance of interrupts accounts for any real
bugs, but it definitely seems risky and unnecessary.
2002-01-01 23:16:22 +00:00
Tom Lane 1ccc67600b Fix race condition that could allow two concurrent transactions
to insert the same key into a supposedly unique index.  The bug is of
low probability, and may not explain any of the recent reports of
duplicated rows; but a bug is a bug.
2002-01-01 20:32:37 +00:00
Thomas G. Lockhart c546170e77 Rename TIME token to ISOTIME to eliminate conflict with gram.y parser
token. Seems to be isolated to datetime.c and datetime.h.
2002-01-01 02:54:33 +00:00
Tom Lane ee051baeac Make sure that all <ctype.h> routines are called with unsigned char
values; it's not portable to call them with signed chars.  I recall doing
this for the last release, but a few more uncasted calls have snuck in.
2001-12-30 23:09:42 +00:00
Bruce Momjian 6f901b6f5a Oops, only wanted datetime.c changes in there. lock stuff reversed out. 2001-12-29 21:30:32 +00:00
Bruce Momjian 9e7b9c6f54 Fix newly introduced datetime.c compile failure; not enough parens. 2001-12-29 21:28:18 +00:00
Thomas G. Lockhart b7a0af7d64 Check a bit more carefully for preceeding ISO field tags
when decoding date fields.
2001-12-29 18:40:58 +00:00
Thomas G. Lockhart b5e23db438 Rework the date/time parsing to tighten up some cases and to enable other
cases which should have worked but did not.
Now supports julian day (J2452271), ISO time labels (T040506) and various
 combinations of spaces and run-togethers of dates, times, and time zones.
All regression tests pass, and I have more tests to add after the 7.2
 release (don't want to require changes to the ancillary horology result
 files until after then).
2001-12-29 18:31:48 +00:00
Tom Lane 198152730b Improve LOCK_DEBUG logging code for LWLocks. 2001-12-28 23:26:04 +00:00
Peter Eisentraut 9d6d4dfeeb Update from Serguei Mokhov 2001-12-28 18:47:54 +00:00
Tom Lane d3fc362ec2 Ensure that all direct uses of spinlock-protected data structures use
'volatile' pointers to access those structures, so that optimizing
compilers will not decide to move the structure accesses outside of the
spinlock-acquire-to-spinlock-release sequence.  There are no known bugs
in these uses at present, but based on bad experience with lwlock.c,
it seems prudent to ensure that we protect these other uses too.
Per pghackers discussion around 12-Dec.  (Note: it should not be
necessary to worry about structures protected by LWLocks, since the
LWLock acquire and release operations are not inline macros.)
2001-12-28 18:16:43 +00:00
Bruce Momjian 2fcc911750 Place PAM before REJECT in sample file. 2001-12-24 04:44:03 +00:00
Tom Lane aed0c29f7e Fix mispeling ... 2001-12-23 07:25:39 +00:00
Peter Eisentraut cb85a62807 Czech translation updates from Karel Zak 2001-12-21 22:30:49 +00:00
Peter Eisentraut d56c072c83 Fix error 2001-12-21 22:27:34 +00:00
Tom Lane 12d17deb4f Use MemSet() rather than a loop to do blank-padding on PS_USE_CLOBBER_ARGV
machines.  I have just been observing some scenarios where set_ps_display
accounts for more than 10% of the backend CPU, and this loop has to be
the reason.
2001-12-21 15:22:09 +00:00
Thomas G. Lockhart db667614ef Add full name of the month of July to the lookup table.
Thanks to Greg Sabino Mullane <greg@turnstep.com> for finding the problem.
2001-12-21 06:03:27 +00:00
Bruce Momjian 8799d84603 Add memcmp() test and new memcmp.c file, for SunOS. Tested by Tatsuo. 2001-12-20 21:23:05 +00:00
Bruce Momjian 48aa2dbe61 MIN() -> Min, fixes compile problem. 2001-12-20 02:39:26 +00:00
Tom Lane 8647c14228 Fix buffer-overrun problem in pretty printer. 2001-12-19 22:35:35 +00:00
Tom Lane 9aa2e7da51 Temporarily dike out GetUndoRecPtr() in checkpoint generation, since we
do not use the undo pointer anyway.  This is a quick-hack solution for
the three-way deadlock condition discussed in pghackers 17-Dec-01.
Need to find a better way of doing it.
2001-12-19 19:42:51 +00:00
Tom Lane de59370844 Make sure that all variants of HeapTupleSatisfies will do the right thing
if presented with a tuple in process of being moved by VACUUM.  Per
bug report from Brian Hirt.
2001-12-19 17:18:39 +00:00
Bruce Momjian e71493300c Move geqo enable into proper section. 2001-12-17 19:09:01 +00:00
Peter Eisentraut 2adce49615 Update Hungarian from Kovacs Zoltan 2001-12-13 22:02:20 +00:00
Tom Lane 990eb8552e Don't accept names of complex types (ie, relation types) as being
requests for implicit trivial coercions.  Prevents sillinesses like
this one:
regression=# select x.int8_tbl.q1 from int8_tbl x;
ERROR:  fmgr_info: function 270997776: cache lookup failed
2001-12-12 03:28:49 +00:00
Tom Lane 07009651ce Repair roundoff-error problem for stddev/variance results near zero,
per complaint from Kemin Zhou.
Fix lack of precision in numeric stddev/variance.
2001-12-11 02:02:12 +00:00
Tom Lane 63cc56de54 Suppress subquery pullup and pushdown when the subquery has any
set-returning functions in its target list.  This ensures that we
won't rewrite the query in a way that places set-returning functions
into quals (WHERE clauses).  Cf. bug reports from Joe Conway.
2001-12-10 22:54:12 +00:00
Tom Lane 584f818bef Declare LWLock pointers as volatile to prevent AIX compiler from
reordering operations at its whim.  Releasing TAS lock before we've
finished updating proc structure is uncool.
2001-12-10 21:13:50 +00:00
Peter Eisentraut 356c02b262 Update from Serguei Mokhov 2001-12-10 18:44:44 +00:00
Tom Lane f3f8499bc0 Repair case-conversion error in to_date's handling of roman numerals.
From Manuel Sugawara, approved by Karel Zak.
2001-12-10 15:34:05 +00:00
Thomas G. Lockhart eda51264c8 Allow variable (unrestricted) precision for TIME and TIMESTAMP types in parser. 2001-12-09 04:39:39 +00:00
Thomas G. Lockhart cd8b354971 Honor the typmod field for time zone intervals. 2001-12-09 04:37:50 +00:00
Tatsuo Ishii 2b714fd66e Fix for usage of spirntf in more portable way. 2001-12-05 02:06:19 +00:00
Tatsuo Ishii 9f8ff2ab5a Re-enable SunOS4 port. Replace
RTLD_LAZY | RTLD_GLOBAL to 1.
It seems sunos4.h was accidentally modified between 7.1 and 7.2.
2001-12-05 02:03:59 +00:00
Tom Lane 969cc16c69 Enforce restriction that COPY DELIMITERS string must be exactly one
character; replace strchr() search with simple comparison to speed up
COPY IN.  Per discussion in pghackers.
2001-12-04 21:19:57 +00:00
Tom Lane a0734d1eb1 Change appendStringInfoChar to appendStringInfoCharMacro in a couple of
hot spots --- buys about 10% in Verner's INSERT example.
2001-12-04 20:57:22 +00:00
Tom Lane f4bd04bb67 Replace pq_getbytes(&ch, 1) calls with pq_getbyte(), which is easier
to use and significantly faster.  This tweak saves 25% (!) of the runtime
of COPY IN in a test with 8000-character lines.  I wouldn't normally
commit a performance improvement this late in the cycle, but 25% got
my attention...
2001-12-04 19:40:17 +00:00
Tom Lane dae887abfe Remove now-dead code for processing CONSTR_UNIQUE nodes in
AlterTableAddConstraint.  Earlier reorganization of the parser's
processing of ALTER TABLE means that these node types no longer get here.
2001-12-04 17:19:48 +00:00
Bruce Momjian 1af6761207 Hi Bruce, here is a first version of the hu.po file for the backend. I
tested it with 7.2b3 and worked fine.

Regards, Zoltan
2001-12-04 17:00:51 +00:00
Tom Lane 0e9e888ebd Suppress data directory access-permissions check when __CYGWIN__,
per recent pghackers discussions.  Improving this should be a TODO
for 7.3.
2001-12-04 16:17:48 +00:00
Tom Lane c3cf68de6b Fix latent bug in checking for failure of hashtable creation. 2001-12-03 19:02:58 +00:00
Bruce Momjian 1a88682d45 attachement is the NLS patch for backend/po & pg_dump,
they are all against the current CVS tree. the patch is about 70K.

    regards    laser
2001-12-03 18:43:21 +00:00
Tom Lane ac06a7a21f Try to make genbki.sh a little more bulletproof, per trouble report
from Paul Stavrides.
2001-11-30 20:21:06 +00:00
Tom Lane c31bcbc8d6 Repair failure to mark an inserted Materialize node with the appropriate
extParam/locParam lists.  Per bug #526.
2001-11-30 19:24:15 +00:00
Peter Eisentraut 22a6a7e371 updates 2001-11-30 18:04:23 +00:00
Tom Lane 636a939fe5 Fix array_out's failure to backslash backslashes, per bug# 524. Also,
remove brain-dead rule that double quotes are needed if and only if the
datatype is pass-by-reference; neither direction of the implication holds
water.  Instead, examine the actual data string to see if it contains
any characters that force us to quote it.
Add some documentation about quoting of array values, which was previously
explained nowhere AFAICT.
2001-11-29 21:02:41 +00:00
Peter Eisentraut 0556f7ca87 NLS updates, most notably fixed zh_TW translations 2001-11-29 18:59:28 +00:00
Tom Lane 8e75b36aeb Fix unportable, non-spec-compliant use of offsetof() with a nonconstant
member offset.
2001-11-26 22:31:08 +00:00
Tom Lane 2337780e0e Change display of FieldSelect nodes from arg.field to field(arg),
per bug report from Stefan Hadjistoytchev.  There are some cases
where the dot notation works, but there are more where it doesn't.
Eventually ought to consider fixing the parser to allow cases like
func().field, but for now this is the simplest patch.
2001-11-26 21:15:14 +00:00
Tom Lane e59334994e Repair problem with listing rules that have a WHERE condition and
have an INSERT...SELECT as the first or only action.  Per bug report
from Sergio Pili.
2001-11-26 00:29:15 +00:00
Bruce Momjian b1a40bfe51 Backend /po patch.
http://laser.zhengmai.com.cn/download/backend_zh_CN.po.diff.gz

Weiping He
2001-11-25 18:25:54 +00:00
Tom Lane 2ec958721d Tweak int8in to accept -9223372036854775808, per recent discussion in
pgsql-patches.
2001-11-24 19:57:06 +00:00
Tom Lane cd255bb070 Fix boundary condition in btbulkdelete: don't examine high key in case
where rightmost index page splits while we are waiting to obtain exclusive
lock on it.  Not clear this would actually hurt (probably the callback
would always fail), but better safe than sorry.
Also, improve comments describing concurrency considerations in this code.
2001-11-23 23:41:54 +00:00
Tom Lane 6c134eb6f1 Spell 'precedes', 'preceding' correctly in various places. 2001-11-21 22:57:01 +00:00
Tom Lane 82bad53cf5 Insert CommandCounterIncrement call into SPI_cursor_open. 2001-11-21 18:30:58 +00:00
Tom Lane dcdf9119a8 Tweak interval_avg support to avoid coredump with Alpha/Tru64 compiler.
Per report from Bernd Tegge.
2001-11-21 18:29:48 +00:00
Thomas G. Lockhart 90e757c17d Add a few new time zones, and list every time zone mentioned in my
Linux box's time zone database.
Do not allow 'current' as a date/time input value.
2001-11-21 05:58:51 +00:00
Thomas G. Lockhart 4bedbd061c Repair swapped sign for time minus time routine (time_mi_time()).
Problem reported by Manuel Sugawara (masm@fciencias.unam.mx).
2001-11-21 05:57:33 +00:00
Thomas G. Lockhart d90b5d06ba Allow 'PostgreSQL' as a date/time formatting style. Formerly, recognized
'Postgres' only, but now accepts both.
2001-11-21 05:55:18 +00:00
Bruce Momjian 2985286eb4 I think it's patch's size problem that I can't
send patches to pgsql-patches list.
the zh_CN NLS patch is about 80K,
but sended twice and still can emerge on list.
so I've put it at:

http://laser.zhengmai.com.cn/download/zh_CN.po.diff.tar.gz

If possible, please download it and apply it.
(for current CVS).

    regards   laser
2001-11-21 05:45:31 +00:00
Bruce Momjian d83cadb314 Add mention of template1 usage. 2001-11-20 18:23:37 +00:00
Tom Lane 604f54cd27 Some minor tweaks of REINDEX processing: grab exclusive lock a little
earlier, make error checks more uniform.
2001-11-20 02:46:13 +00:00
Tatsuo Ishii 933761e7b1 Simplify pg_convert() in that it calls pg_convert2 using new fmgr interface. 2001-11-20 01:32:29 +00:00
Tom Lane 1436b212cc Double quotes in ln command to guard against spaces in path. 2001-11-20 00:27:13 +00:00
Tom Lane ed1ff84750 Tweak format_type so that we get good behavior for both column type
display (with a typemod) and function arg/result type display (without
a typemod).
2001-11-19 19:51:20 +00:00
Bruce Momjian 40015cdaae Fix arg coerect match text type, per Tom. 2001-11-19 19:15:07 +00:00
Bruce Momjian 6f6567812e Make text octet_length() return non-compressed length to be consistent
with other data types, per disucssion.  Encoding issue still open.
2001-11-19 18:21:10 +00:00
Tom Lane 5e86d226e4 Grammatical and spelling fixes. 2001-11-19 09:05:02 +00:00
Tatsuo Ishii 5590d5fe99 Fix nasty bugs in pg_convert() and pg_convert2().
o they sometimes returns a result garbage string appended.
    o they do not work if client encoding is different from server
      encoding
2001-11-19 06:48:39 +00:00
Tom Lane 9f07cb70db Add example of using 'sameuser' followed by 'all' pg_hba records to
enforce a limit on who can connect to databases other than their own.
From a recent discussion in pg-admin.
2001-11-18 23:24:16 +00:00
Bruce Momjian 09bf48cf79 Improve comments about duplicate files. 2001-11-18 23:02:19 +00:00
Tatsuo Ishii 226211f0af Optimization for bpcharlen, textlen, varcharlen in case of single byte
encodings.
2001-11-18 12:07:07 +00:00
Tom Lane 6b516f5951 Fix performance problems in TOAST compressor. The management of
search lists was broken in such a way that only the most recent
instance of a given hash code would ever be searched, thus possibly
missing longer matches further back.  Fixing this gave 5 to 10%
compression improvement on some text test cases.  Additional small
tweaks to improve speed of inner loops a little bit.  There is no
compatibility issue created by this change, since the compressed data
format and decompression algorithm don't change.
2001-11-17 06:09:30 +00:00
Tom Lane c845b4272c IsSystemRelationName() treats TOAST relations as system relations.
This seems the right thing for most usages, but I notice two places
where it is the wrong thing.  One is that the default permissions on
TOAST rels should be no-access, not world-readable; the other is that
PrepareForTupleInvalidation doesn't really need to spend time looking
at tuples of TOAST relations.
2001-11-16 23:30:35 +00:00
Peter Eisentraut aff53b27f0 Make the yacc rules safe for parallel make. See discussion on pgsql-patches
and comment in src/backend/parser/Makefile for the technical details.
2001-11-16 16:32:33 +00:00
Tom Lane 7c50767f08 Remove 'triggered data change violation' error check, per recent
discussions in pghackers.
2001-11-16 16:31:16 +00:00
Tom Lane 2a4660f5aa Update keyword lists per suggestions by Peter. There are now four
mutually exclusive keyword lists spanning all known keywords ---
including AS.  Moved COALESCE and a few other ColLabels into the
can-be-ColId list.
2001-11-16 04:08:33 +00:00
Peter Eisentraut a6348ae332 Only use RTLD_GLOBAL when available, which it isn't in older releases of the OS. 2001-11-15 16:08:15 +00:00
Bruce Momjian c97a787e85 Update CVS tags. 2001-11-13 22:08:04 +00:00
Bruce Momjian e735112b51 Use better CVS tag. 2001-11-13 22:07:42 +00:00
Bruce Momjian 2ca65f716a Remove md5.c check, add CVS log stamp. Update comments. 2001-11-13 22:06:58 +00:00
Tom Lane a585c20d12 Tweak parser so that there is a defined representation for datatypes
bpchar, bit, numeric with typmod -1.  Alter format_type so that this
representation is printed when the typmod is -1.  This ensures that
tables having such columns can be pg_dump'd and reloaded correctly.
Also, remove the rather useless and non-SQL-compliant default
precision and scale for type NUMERIC.  A numeric column declared as
such (with no precision/scale) will now have typmod -1 which means
that numeric values of any precision/scale can be stored in it,
without conversion to a uniform scale.  This seems significantly
more useful than the former behavior.  Part of response to bug #513.
2001-11-12 21:04:46 +00:00
Tom Lane d4d23852c1 If the alternatives for a CASE construct all have the same typmod,
use that typmod not -1 as the typmod of the CASE result.
Part of response to bug#513.
2001-11-12 20:05:24 +00:00
Tom Lane e433bf5a5e If the inputs of a UNION/INTERSECT/EXCEPT construct all agree on the
typmod of a particular column, mark the output with that same typmod,
not -1 as formerly.  -1 is still used if there is any disagreement.
Part of response to bug#513.
2001-11-12 20:04:20 +00:00
Tom Lane 611afd9f4b Repair crash in EvalPlanQual of query involving nestloop with inner
index scan.  Problem was that link to outer tuple wasn't being stored
everyplace it needed to be.
2001-11-12 17:18:06 +00:00
Bruce Momjian e506ca4063 Tables without oids wouldn't be able to be
used inside fk constraints, since some of the checks
in the trigger did a SELECT oid.  Since the oid wasn't
actually used, I changed this to SELECT 1.  My test
case with non-oid tables now works and fk regression
appears to run fine on my machine.

Stephan Szabo
2001-11-12 06:09:09 +00:00
Tom Lane 9371325042 Remove a bunch more no-longer-used stuff in libpq-be.h. 2001-11-12 05:43:25 +00:00
Tom Lane 7be18072db Suppress duplicate error messages in pq_flush. Write error messages to
postmaster log with elog(DEBUG) so that they will be timestamped etc.
Once upon a time I think elog() was unsafe here, but it shouldn't be anymore.
2001-11-12 04:54:08 +00:00
Tom Lane 1131ba3135 send() attempt for IDENT communication should retry on EINTR. 2001-11-12 04:29:23 +00:00
Tom Lane a7f6210de2 The PacketReceive/PacketSend routines aren't used anymore. 2001-11-12 04:19:15 +00:00
Bruce Momjian 215772ae96 Update MD5 documentation. 2001-11-12 03:57:16 +00:00
Bruce Momjian 67a56f2286 Sync up both files. 2001-11-12 02:05:17 +00:00
Bruce Momjian 9937040a02 Add comments and remove CVS tag from md5.c so they remain identical. 2001-11-12 02:00:18 +00:00
Bruce Momjian 75bb1e6f5d Add code to check that md5.c files are in sync. 2001-11-12 01:42:03 +00:00
Bruce Momjian a83bd89d00 Indent new rename.c for Tom Lane. 2001-11-12 01:34:50 +00:00
Tom Lane f14fdad858 Make ALTER TABLE RENAME update foreign-key trigger arguments correctly.
Brent Verner, with review and kibitzing from Tom Lane.
2001-11-12 00:46:36 +00:00
Tom Lane 8bfc437301 Clean up a bunch of ScanKeyEntryInitialize calls that weren't bothering
to apply the proper Datum conversion macros to search key values.
2001-11-12 00:00:55 +00:00
Tom Lane 801a1accca Test program needs to declare MaxBackends, per Bernd Tegge. 2001-11-11 22:12:00 +00:00
Tom Lane 69a59150c2 Defend against brain-dead QNX implementation of qsort().
Per report from Bernd Tegge, 10-Nov-01.
2001-11-11 22:00:25 +00:00
Tom Lane c5c97318f9 In find_mergeclauses_for_pathkeys, it's okay to return multiple merge
clauses per path key.  Indeed, we *must* do so or we will be unable to
form a valid plan for FULL JOIN with overlapping join conditions, eg
select * from a full join b on
a.v1 = b.v1 and a.v2 = b.v2 and a.v1 = b.v2.
2001-11-11 20:33:53 +00:00
Tom Lane ad511a3ff3 sort_inner_and_outer needs a check to ensure that it's consumed all the
mergeclauses in RIGHT/FULL join cases, just like the other routines have.
I'm not quite sure why I thought it didn't need one --- but Nick
Fankhauser's recent bug report proves that it does.
2001-11-11 19:18:54 +00:00
Tom Lane 15c21bf8e1 Defend against possibility that SSL error reporting mechanism returns
a NULL pointer.  Per report from Stephen Pillinger 8-Nov-01.
2001-11-11 02:09:05 +00:00
Tom Lane f6ee99a062 Clean up usage-statistics display code (ShowUsage and friends). StatFp
is gone, usage messages now go through elog(DEBUG).
2001-11-10 23:51:14 +00:00
Tom Lane 0c1669c806 Restructure child-exit logging messages for easier translation,
per suggestion from Peter.
2001-11-10 23:06:12 +00:00
Tom Lane ec438886e1 Allow TIMESTAMP, VARCHAR, et al to be used as unquoted column names,
though alas not as unquoted function names.  De-reserve a bunch of
keywords that could have been in ColId rather than ColLabel all along.
Per recent proposal in pgsql-patches.
2001-11-10 22:31:49 +00:00
Bruce Momjian 77e4fd889c Fix indenting for 'extern "C"' cases. 2001-11-08 20:37:52 +00:00
Tom Lane 7e16f3c0d8 PostgreSQL works again on Mac OS X 10.1. Hold your nose before
investigating the kluge that makes it so...
2001-11-08 04:24:03 +00:00
Tom Lane 64af43a15f Add casts to suppress compiler warnings observed on Darwin platform
(surprised no one has reported these yet...)
2001-11-08 04:05:13 +00:00
Tom Lane d22e9456a7 Clean up formatting of child process exit-status reports so that they
are correct, consistent, and complete ... motivated by gripe from
Oliver Elphick, but I see someone had already made an incomplete stab
at this.
2001-11-06 18:02:48 +00:00
Thomas G. Lockhart 3ea311d4b3 Add British Double Standard Time (BDST) per mailing list report. 2001-11-06 16:29:51 +00:00
Tom Lane d980ddb544 Add Darwin to list of known systems for ps_status. 2001-11-06 01:15:29 +00:00
Tom Lane ca7578d454 The extra semaphore that proc.c now allocates for checkpoint processes
should be accounted for in the PROC_SEM_MAP_ENTRIES() macro.  Otherwise
the ports that rely on this macro to size data structures are broken.
Mea culpa.
2001-11-06 00:38:26 +00:00
Tom Lane 0053cebea5 Fix coredump in plpgsql when trying to return a rowtype result.
Need to return a TupleTableSlot, not just a bare tuple.
2001-11-05 19:41:56 +00:00
Bruce Momjian ea08e6cd55 New pgindent run with fixes suggested by Tom. Patch manually reviewed,
initdb/regression tests pass.
2001-11-05 17:46:40 +00:00
Tom Lane 5251e7b3d0 CREATE TABLE foo (x,y,z) AS SELECT ... can't apply target column names
to the target list in gram.y; it must wait till after expansion of the
target list in analyze.c.  Per bug report 4-Nov:
lx=# CREATE TABLE abc (a char, b char, c char);
CREATE
lx=# CREATE TABLE xyz (x, y, z) AS SELECT * FROM abc;
ERROR:  CREATE TABLE/AS SELECT has mismatched column count
2001-11-05 05:00:14 +00:00
Tom Lane d556920a98 Remove ill-considered Assert. 2001-11-05 01:34:37 +00:00
Tom Lane 430cd88a18 Fix now-obsolete comment. 2001-11-04 20:12:57 +00:00
Tom Lane fb5f1b2c13 Merge three existing ways of signaling postmaster from child processes,
so that only one signal number is used not three.  Flags in shared
memory tell the reason(s) for the current signal.  This method is
extensible to handle more signal reasons without chewing up even more
signal numbers, but the immediate reason is to keep pg_pwd reloads
separate from SIGHUP processing in the postmaster.
Also clean up some problems in the postmaster with delayed response to
checkpoint status changes --- basically, it wouldn't schedule a checkpoint
if it wasn't getting connection requests on a regular basis.
2001-11-04 19:55:31 +00:00
Bruce Momjian 7cc8af5563 Got "ADD" to appear only in ALTER TABLE and not CREATE TABLE
UNIQUE-PRIMARY KEY notice message.  This is what Christopher wanted from
his patch.
2001-11-04 03:08:11 +00:00
Bruce Momjian 434077c4e6 Remove "ADD" from TABLE / ADD UNIQUE-PRIMARY error message because the
same code is called for both creation and alter.  Not worth worrying
about.
2001-11-04 02:41:09 +00:00
Tom Lane 9685afb0b2 Add default expressions to INSERTs during planning, not during parse
analysis.  This keeps stored rules from prematurely absorbing default
information, which is necessary for ALTER TABLE SET DEFAULT to work
unsurprisingly with rules.  See pgsql-bugs discussion 24-Oct-01.
2001-11-02 20:23:02 +00:00
Tom Lane 8a069abd18 Fix pg_pwd caching mechanism, which was broken by changes to fork
postmaster children before client auth step.  Postmaster now rereads
pg_pwd on receipt of SIGHUP, the same way that pg_hba.conf is handled.
No cycles need be expended to validate password cache validity during
connection startup.
2001-11-02 18:39:57 +00:00
Tom Lane 7d05310828 Fix problem reported by Alex Korn: if a relation has been dropped and
recreated since the start of our transaction, our first reference to it
errored out because we'd try to reuse our old relcache entry for it.
Do this by accepting SI inval messages just before relcache search in
heap_openr, so that dead relcache entries will be flushed before we
search.  Also, break heap_open/openr into two pairs of routines,
relation_open(r) and heap_open(r).  The relation_open routines make
no tests on relkind and so can be used to open anything that has a
pg_class entry.  The heap_open routines are wrappers that add a relkind
test to preserve their established behavior.  Use the relation_open
routines in several places that had various kluge solutions for opening
rels that might be either heap or index rels.

Also, remove the old 'heap stats' code that's been superseded by Jan's
stats collector, and clean up some inconsistencies in error reporting
between the different types of ALTER TABLE.
2001-11-02 16:30:29 +00:00
Tom Lane 3c9b549a75 Minor code cleanups. 2001-11-01 18:10:48 +00:00
Tom Lane 7663e6bb70 Reject tabs and linefeeds in usernames and passwords that are being
stored in pg_pwd, to guard against failures of the sort observed by
Tom Yackel.  Note: in the case of encrypted passwords this is no
restriction, since the string we are interested in is the MD5 hash.
2001-11-01 18:09:58 +00:00
Tom Lane bdea97ea95 Add missing #include. 2001-11-01 06:17:01 +00:00
Tom Lane 4877c59217 Suppress trivial compiler warning. 2001-11-01 05:45:28 +00:00
Bruce Momjian 57584d70fa More *.po cleanups for new spacing. 2001-10-31 05:16:31 +00:00
Bruce Momjian e7fc0604cd Modify *.po files and regression expected output for new clearer error
message spacing.
2001-10-31 05:14:33 +00:00
Bruce Momjian 37bba02bdb Here is an updated version of /src/backend/po/ru.po
which incorporates recent changes by Bruce to
readability of some messages and few more translations.

--
Serguei A. Mokhov
2001-10-31 04:58:36 +00:00
Bruce Momjian 4911c85e86 Add ALTER TABLE ADD UNIQUE regression tests from Christopher Kings-Lynne.
Add space between slash for ALTER TABLE / ADD ....

Regression and *.po updates to follow.
2001-10-31 04:49:44 +00:00
Tom Lane 96ca8ffebc Fix problems with subselects used in GROUP BY expressions, per gripe
from Philip Warner.  Side effect of change is that GROUP BY expressions
will not be re-evaluated at multiple plan levels anymore, whereas this
sometimes happened with old code.
2001-10-30 19:58:58 +00:00
Bruce Momjian c41b6b1b9c Fix small problem Tom Lane found with pgindent run. 2001-10-30 05:38:56 +00:00
Bruce Momjian 8469a33818 Add gp->gr_mem != NULL check for Solaris, per Seth Hettich 2001-10-29 18:06:54 +00:00
Bruce Momjian 40b1403ae8 Check for NULL return from getgrgid(), per Seth Hettich 2001-10-29 17:55:41 +00:00
Bruce Momjian 6783b2372e Another pgindent run. Fixes enum indenting, and improves #endif
spacing.  Also adds space for one-line comments.
2001-10-28 06:26:15 +00:00
Tom Lane 22d9e91219 Fix a couple of places where lack of parenthesization of a cast
causes pgindent to make weird formatting decisions.  Easiest fix
seems to be to put in the extra parens...
2001-10-25 20:37:30 +00:00
Tom Lane a0cd991987 Add int2-to-int8 and int8-to-int2 conversion routines. Needed to avoid
breaking existing pg_dump scripts, which try to assign the result of
count(*) to an int2 variable.  catversion bumped.
2001-10-25 14:10:07 +00:00
Tom Lane 92e8282229 Add missing output routine for FkConstraint nodes. 2001-10-25 14:08:11 +00:00
Bruce Momjian b81844b173 pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
2001-10-25 05:50:21 +00:00
Bruce Momjian fde8edaf53 Add do { ... } while (0) to more bad macros. 2001-10-25 01:29:37 +00:00
Bruce Momjian 6f6d16ab25 All three *.po patches applied.
forth@pagic.net
2001-10-24 17:52:28 +00:00
Hiroshi Inoue 0450331526 Allow concurrent index creation for the same table. 2001-10-24 09:28:31 +00:00
Tom Lane d0667af926 Add support for INTERVAL's new typmod values to format_type. 2001-10-23 20:12:54 +00:00
Tom Lane 01b73d3f27 Fix foreign keys on system columns. 2001-10-23 17:39:03 +00:00
Tom Lane 57dd2ce78a Make SPI's column-accessing functions work for system columns as well as
user columns.  Needed for foreign keys on OID, but useful in general.
2001-10-23 17:38:25 +00:00
Bruce Momjian 8dded696e6 Now I had them reversed. Wow that syntax is error-prone. 2001-10-23 02:50:41 +00:00
Bruce Momjian caafc1c5cc Syntax fix. Can't use #ifdef in gram.y. 2001-10-23 02:47:14 +00:00
Bruce Momjian e1ce520c09 Back out LIMIT #,# removal and mark it as to-be-removed in 7.3. 2001-10-23 02:45:37 +00:00
Tom Lane 087771ae40 Add error checking to PageRepairFragmentation to ensure that it can
never overwrite adjacent pages with copied data, even if page header
and/or item pointers are already corrupt.  Change inspired by trouble
report from Alvaro Herrera.
2001-10-23 02:20:15 +00:00
Tom Lane dab708ea08 Cause transformIndexConstraints() to do the right thing with requests
for indexes on system columns.  Per complaint from Peter.
2001-10-22 22:49:02 +00:00
Tom Lane c59839ac6d Consolidate tables of known system attributes into one table. 2001-10-22 22:47:57 +00:00
Tom Lane 94daee3cb7 Further cleanup of ps_status setup code. On platforms where the
environment strings need to be moved around, do so when called from
initial startup (main.c), not in init_ps_status.  This eliminates the
former risk of invalidating saved environment-string pointers, since
no code has yet had a chance to grab any such pointers when main.c
is running.
2001-10-22 19:41:38 +00:00
Tom Lane a19f2605ed Add defenses against invalid operator names passed in CREATE OPERATOR
arguments (where the parser doesn't check them already).  Minor code
cleanups too.
2001-10-22 19:34:13 +00:00
Tom Lane 6ec5eaad3b Fix FindExec() for case where executable is found via a relative path
in .:/home/postgres/testversion/bin:/opt/perl5.6.1/bin:/home/postgres/bin:/usr/local/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/upgrade/bin:/opt/CC/bin:/opt/langtools/bin:/opt/graphics/phigs/bin:/opt/java/bin:/bin:/opt/imake/bin:/opt/hparray/bin:/opt/aCC/bin:/opt/lrom/bin:/usr/local/nmh/bin:. (I suppose the only common case for this is '.').
2001-10-21 03:43:54 +00:00
Tom Lane b2e92a712e Fix getopt-vs-init_ps_display problem by copying original argv[] info,
per suggestion from Peter.  Simplify several APIs by transmitting the
original argv location directly from main.c to ps_status.c, instead of
passing it down through several levels of subroutines.
2001-10-21 03:25:36 +00:00
Bruce Momjian bb8f8e6279 Change LIMIT #,# error message to be more generic. 2001-10-20 16:51:02 +00:00
Bruce Momjian f363b3177d Remove LIMIT #,# and suggest LIMIT # OFFSET #, per mailing list discussion. 2001-10-20 02:55:39 +00:00
Thomas G. Lockhart 424d9389d6 Fix transposed arguments for typmod for one INTERVAL production.
Mask both typmod subfields for INTERVAL to avoid setting the high bit,
 per dire warning from Tom Lane.
Clear tmask for DTK_ISO_TIME case to avoid time zone troubles.
 Symptom reported by Tom Lane.
Clean up checking for valid time zone info in output routine.
 This should now work for both SQL99 and Unix-style time zones.
Put in explicit check for INTERVAL() typmod rounding to avoid accumulating
 cruft in the lower bits. Not sure that this helps, but we'll need to do
 something. The symptom is visible with a query like
 select interval(2) '10000 days 01:02:03.040506';
Regression tests are patched to repair the Tom Lane symptom, and all pass.
2001-10-20 01:02:22 +00:00
Tom Lane 379268aa62 Proper fix for glibc getopt() botch. Surprising we did not see this
before.
2001-10-19 20:47:09 +00:00
Tom Lane 861a679fc1 Set optreset on platforms that have it before launching postmaster
subprocesses; perhaps this will fix portability problem just noted by
Lockhart.  Also, move test for bad permissions of DataDir to a more
logical place.
2001-10-19 18:19:41 +00:00
Tom Lane 6430e6e283 Ensure that all startup paths (postmaster, standalone postgres, or
bootstrap) check for a valid PG_VERSION file before looking at anything
else in the data directory.  This fixes confusing error report when
trying to start current sources in a pre-7.1 data directory.
Per trouble report from Rich Shepard 10/18/01.
2001-10-19 17:03:08 +00:00
Tom Lane eb133197b6 Move init_ps_display from postgres.c to postmaster.c, putting it
just after receipt of the startup packet.  Now, postmaster children
that are waiting for client authentication response will show as
'postgres: user database host authentication'.  Also, do an
init_ps_display for startup/shutdown/checkpoint subprocesses,
so that they are readily identifiable as well.  Fix an obscure race
condition that could lead to Assert failure in the postmaster ---
attempting to start a checkpoint process before any connections have
been received led to calling PostmasterRandom before setting random_seed.
2001-10-19 00:44:08 +00:00
Tom Lane 9047292725 Spell 'between' correctly, clean up spacing in error messages. 2001-10-18 23:16:09 +00:00
Tom Lane 43568d11ad Fix memory leakage when sending notice messages to client. 2001-10-18 23:07:29 +00:00
Tom Lane aed378e8d1 Fix authentication so that it doesn't record an extra 'Password
authentication failed' and a 'send() failed: Broken pipe' message
on every connection from psql in password auth mode.  Problem is
that psql doesn't ask user for a password until it sees a password
challenge failure, and libpq just closes the connection unceremoniously
if it's challenged for a password when it hasn't got one to send.
Accordingly, EOF from the client after asking for a password is
normal behavior and should not result in postmaster log entries.
2001-10-18 22:44:37 +00:00
Tom Lane f9b6583747 Didn't compile on non-HAVE_TM_ZONE machines. 2001-10-18 19:54:59 +00:00
Tom Lane 369c9e3b6c Repair missing brace in HAVE_INT_TIMEZONE case. 2001-10-18 19:52:03 +00:00
Thomas G. Lockhart 9310075a13 Accept an INTERVAL argument for SET TIME ZONE per SQL99.
Modified the parser and the SET handlers to use full Node structures
 rather than simply a character string argument.
Implement INTERVAL() YEAR TO MONTH (etc) syntax per SQL99.
 Does not yet accept the goofy string format that goes along with, but
 this should be fairly straight forward to fix now as a bug or later
 as a feature.
Implement precision for the INTERVAL() type.
 Use the typmod mechanism for both of INTERVAL features.
Fix the INTERVAL syntax in the parser:
 opt_interval was in the wrong place.
INTERVAL is now a reserved word, otherwise we get reduce/reduce errors.
Implement an explicit date_part() function for TIMETZ.
 Should fix coersion problem with INTERVAL reported by Peter E.
Fix up some error messages for date/time types.
 Use all caps for type names within message.
Fix recently introduced side-effect bug disabling 'epoch' as a recognized
 field for date_part() etc. Reported by Peter E. (??)
Bump catalog version number.
Rename "microseconds" current transaction time field
 from ...Msec to ...Usec. Duh!
date/time regression tests updated for reference platform, but a few
 changes will be necessary for others.
2001-10-18 17:30:21 +00:00
Tom Lane 6254465d06 Extend code that deduces implied equality clauses to detect whether a
clause being added to a particular restriction-clause list is redundant
with those already in the list.  This avoids useless work at runtime,
and (perhaps more importantly) keeps the selectivity estimation routines
from generating too-small estimates of numbers of output rows.
Also some minor improvements in OPTIMIZER_DEBUG displays.
2001-10-18 16:11:42 +00:00
Tom Lane b207081056 Make sure to clean out old activity string when recycling a backend entry. 2001-10-16 22:35:27 +00:00
Tatsuo Ishii cfe01796e6 Ok, here is the modified encoding table (column1 is the standard name,
2 is our "official" name, and 3 is alias). If there's no objection, I
will change them.

ASCII		SQL_ASCII
UTF-8		UNICODE		UTF_8
MULE-INTERNAL	MULE_INTERNAL
ISO-8859-1	LATIN1		ISO_8859_1
ISO-8859-2	LATIN2		ISO_8859_2
ISO-8859-3	LATIN3		ISO_8859_3
ISO-8859-4	LATIN4		ISO_8859_4
ISO-8859-5	ISO_8859_5
ISO-8859-6	ISO_8859_6
ISO-8859-7	ISO_8859_7
ISO-8859-8	ISO_8859_8
ISO-8859-9	LATIN5		ISO_8859_9
ISO-8859-10	LATIN6		ISO_8859_10
ISO-8859-13	LATIN7		ISO_8859_13
ISO-8859-14	LATIN8		ISO_8859_14
ISO-8859-15	LATIN9		ISO_8859_15
ISO-8859-16	LATIN10		ISO_8859_16
2001-10-16 10:09:17 +00:00
Tatsuo Ishii d07bacd54a Add UTF-8 char >= 0x10000 check 2001-10-15 01:19:15 +00:00
Tom Lane e482dcb0a4 Make selectivity routines cope gracefully with NaNs, infinities, and
NUMERIC values that are out of the range of 'double'.  Per trouble
report from Mike Quinn.
2001-10-13 23:32:34 +00:00
Tom Lane cf5dc330b9 path_inter, path_distance, path_length, dist_ppath now do the right
things with closed paths --- ie, include the closing line segment in
their calculations.  Per bug report from Curtis Barrett 9-Oct-01.
2001-10-13 17:40:24 +00:00
Bruce Momjian dac9f40ba8 Mention createlang when language not installed, per problem report. 2001-10-13 01:35:25 +00:00
Tatsuo Ishii f426465ba9 Add a new function "pg_client_encoding" which returns the current client
side encoding name. This is necessary for client API's such as JDBC
to perform correct encoding conversions. See my email "[HACKERS]
pg_client_encoding" 10 Sep 2001.
2001-10-12 02:08:34 +00:00
Tom Lane f9e6e27c87 Break transformCreateStmt() into multiple routines and make
transformAlterStmt() use these routines, instead of having lots of
duplicate (not to mention should-have-been-duplicate) code.
Adding a column with a CHECK constraint actually works now,
and the tests to reject unsupported DEFAULT and NOT NULL clauses
actually fire now.  ALTER TABLE ADD PRIMARY KEY works, modulo
having to have created the column(s) NOT NULL already.
2001-10-12 00:07:15 +00:00
Tom Lane 97d0c8b219 Suppress gcc warnings. 2001-10-11 18:06:52 +00:00
Tatsuo Ishii 51053d3216 Add support for ISO-8859-6 to 16 2001-10-11 14:20:35 +00:00
Peter Eisentraut 371f49bf9f Remove gratuitous discrepancy between extract() and date_part(),
regarding timezone_hour, timezone_minute vs. tz_hour, tz_minute.
Document the former.
2001-10-10 00:02:42 +00:00
Peter Eisentraut ec5c62874d Allow optional () after current_user, session_user, user, current_time,
current_timestamp, current_date for ODBC compatibility.

Add more functions to odbc.sql catalog extension, use new CREATE OR
REPLACE FUNCTION.

Document iODBC/unixODBC build options.
2001-10-09 22:32:33 +00:00
Tom Lane c781600618 Fix typo in error message. Noted by laser@zhengmai.com.cn. 2001-10-09 14:00:22 +00:00
Tom Lane 0b3bca6c6f Change plpgsql to depend on main parser's type-declaration grammar,
rather than having its own somewhat half-baked notion of what a type
declaration looks like.  This is necessary now to ensure that plpgsql
will think a 'timestamp' variable has the same semantics as 'timestamp'
does in the main SQL grammar; and it should avoid divergences in future.
2001-10-09 04:15:38 +00:00
Tom Lane 7ecc40c2df Another go-round with FigureColname, to produce less surprising results
for nested typecasts.  It now produces a column header of 'timestamptz'
for 'SELECT CURRENT_TIMESTAMP', rather than 'text' as it was doing for
awhile there.
2001-10-08 21:48:51 +00:00
Tom Lane 71f2993c45 Fix transformExpr() to not scribble on its input datastructure while
transforming CASE expressions.  This was definitely confusing
FigureColname, and might lead to bad things elsewhere as well.
2001-10-08 21:46:59 +00:00
Tom Lane 1c7bef32b4 Fix ruleutils to depend on format_type, rather than having a private
copy of code that knows about displaying types with typmod info.
Needed so that it does the right thing with timestamp datatypes now.
2001-10-08 19:55:07 +00:00
Tom Lane b6a7948294 Make ALTER TABLE RENAME COLUMN update column names of indexes that
refer to the renamed column.  Brent Verner, with a little help from tgl.
2001-10-08 18:40:04 +00:00
Tom Lane 7249562fe3 Remove redundant code, update comments, cause CURRENT_TIME to
agree with CURRENT_TIME(n).
2001-10-08 18:16:59 +00:00
Tom Lane 85801a4dbd Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfo
lookup info in the relcache for index access method support functions.
This makes a huge difference for dynamically loaded support functions,
and should save a few cycles even for built-in ones.  Also tweak dfmgr.c
so that load_external_function is called only once, not twice, when
doing fmgr_info for a dynamically loaded function.  All per performance
gripe from Teodor Sigaev, 5-Oct-01.
2001-10-06 23:21:45 +00:00
Bruce Momjian ee973be9c2 files attached are Traditional Chinese translations translated
and modified from Simplified Chinese translations for backend,
pgsql, pg_dump and libpq. I've appended their names to zh_TW.po.

forth
2001-10-05 19:05:54 +00:00
Tom Lane 8a52b893b3 Further cleanup of dynahash.c API, in pursuit of portability and
readability.  Bizarre '(long *) TRUE' return convention is gone,
in favor of just raising an error internally in dynahash.c when
we detect hashtable corruption.  HashTableWalk is gone, in favor
of using hash_seq_search directly, since it had no hope of working
with non-LONGALIGNable datatypes.  Simplify some other code that was
made undesirably grotty by promixity to HashTableWalk.
2001-10-05 17:28:13 +00:00
Bruce Momjian 583096a7f9 > > I am quite sure that all AIX Versions accept the CLOBBER method,
> > thus I ask you to apply the following patch, to make it work.

Zeugswetter Andreas SB SD
2001-10-05 15:47:48 +00:00
Thomas G. Lockhart 7547b0104a Define CEST as a synonym for Central European Savings Time
per Jan Varga <varga@utcru.sk>
Fix up spacing and formatting.
2001-10-05 06:38:59 +00:00
Thomas G. Lockhart bd97e4e7be Implement explicit date/time precision per SQL99 spec.
Use CAST() mechanism to define CURRENT_TIME and CURRENT_TIMESTAMP.
2001-10-05 06:37:42 +00:00
Tom Lane 03b0a589d1 Consider interpreting a function call as a trivial (binary-compatible)
type coercion after failing to find an exact match in pg_proc, but before
considering interpretations that involve a function call with one or
more argument type coercions.  This avoids surprises wherein what looks
like a type coercion is interpreted as coercing to some third type and
then to the destination type, as in Dave Blasby's bug report of 3-Oct-01.
See subsequent discussion in pghackers.
2001-10-04 22:06:46 +00:00
Tom Lane 1ca0874faa Ooops, I was a little too enthusiastic about suppressing default
index opclasses; they might be default for some other datatype,
in which case we mustn't suppress 'em.
2001-10-04 22:00:10 +00:00
Tom Lane 3f8a50c013 Plug memory leaks introduced by dynamic-search-path changes.
From Teodor Sigaev.
2001-10-04 19:13:55 +00:00
Tom Lane 38633cf891 Make the world safe for atttypmod=0 ... this didn't use to mean anything,
but timestamp now wants it to mean something.
2001-10-04 17:52:24 +00:00
Tom Lane dd154dde59 Make current_time deliver a fractional-second answer. 2001-10-04 17:10:11 +00:00
Bruce Momjian a6020b396b I've just finished the Chinese NLS support(zh_CN part) files
translation,
    the attachement is those four files.
   (.tar.gz file, with the directory, root is $PGSRC).
    Tested on some Linux platform.

Weiping He
2001-10-04 15:44:14 +00:00
Bruce Momjian 720ca220a9 Attached please find an initiation of the
NLS effort for the 'postgresql' component.
It includes 'ru.po', which should be added
to /src/backend/po/ and a typical patch for
nls.mk with the 'ru' entry added in
the AVAIL_LANGUAGES.

I'll submit a patch with more translations
for pg_dump once CVSweb becomes available.
CVSweb for me right now is the only way
to get to the source code until my system
is completely setup by the end of the week.

--
Serguei A. Mokhov
2001-10-04 15:38:28 +00:00
Tom Lane 1392cbd0ed AdjustTimeForTypmod has the same bug ... 2001-10-04 15:14:22 +00:00
Tom Lane 64dff0beac Fix some problems in new variable-resolution-timestamp code. 2001-10-04 14:49:57 +00:00
Tatsuo Ishii f03b7ba0de Add dependency for regexec.c 2001-10-04 04:16:16 +00:00
Tatsuo Ishii 62d62e79b7 Add dependency for like.c 2001-10-04 04:13:40 +00:00
Tatsuo Ishii 219bd1e4fb Optimization for single byte encodings. 2001-10-04 02:15:47 +00:00
Tom Lane fcd2e372a7 Consistently use gcc's __attribute__((format)) to check sprintf-style
format strings wherever possible.  Remarkably, this exercise didn't
turn up any inconsistencies, but it seems a good idea for the future.
2001-10-03 21:58:28 +00:00
Tom Lane 2e5fda7b7e DROP AGGREGATE and COMMENT ON AGGREGATE now accept the expected syntax
'aggname (aggtype)'.  The old syntax 'aggname aggtype' is still accepted
for backwards compatibility.  Fix pg_dump, which was actually broken for
most cases of user-defined aggregates.  Clean up error messages associated
with these commands.
2001-10-03 20:54:22 +00:00
Tom Lane 5c35b5973b Teach format_type about time/timestamp precision, so that pg_dump and
psql's \d option work properly.
2001-10-03 18:32:42 +00:00
Tom Lane 2684f15e46 Add missing TIMESTAMPTZ case. 2001-10-03 18:25:59 +00:00
Tom Lane 77be5f9451 AdjustTimestampForTypmod does not work (at least not portably) on
-infinity and +infinity.  Put TIMESTAMP_NOT_FINITE guard into the routine,
instead of forgetting it at some call sites.  Fixes regression test
failures here.
2001-10-03 15:50:48 +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
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
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 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
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
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
Tom Lane 7eff804b49 Clean up encode/decode functions a little bit. 2001-09-30 22:03:41 +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
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
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 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
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 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 9dcec8135b Improve wording. 2001-09-28 19:25:36 +00:00