Commit Graph

15460 Commits

Author SHA1 Message Date
Tom Lane 95dbf9c02f Undo changes of trailing space in recently-committed expected files.
This is mostly just over-compulsiveness on my part, but the exercise
did reveal one real bug: errors.out has a space difference now where
it should not.
2006-02-12 03:10:04 +00:00
Tom Lane 3f9d2edddc Restore previous psql behavior of not printing useless trailing spaces
after the data in the last column on a line.
2006-02-12 02:56:21 +00:00
Bruce Momjian 07bae9c099 Please find enclosed a patch that lets you use \c to connect
(optionally) to a new host and port without exiting psql.  This
eliminates, IMHO, a surprise in that you can now connect to PostgreSQL
on a differnt machine from the one where you started your session. This
should help people who use psql as an administrative tool.

David Fetter
2006-02-12 02:54:30 +00:00
Tom Lane d52a57fc30 Actually there's a better way to do this, which is to count tuples
during the vacuumcleanup scan that we're going to do anyway.  Should
save a few cycles (one calculation per page, not per tuple) as well
as not having to depend on assumptions about heap and index being
in step.
I think this could probably be made to work for GIST too, but that
code looks messy enough that I'm disinclined to try right now.
2006-02-12 00:18:17 +00:00
Tom Lane fd267c1ebc Skip ambulkdelete scan if there's nothing to delete and the index is not
partial.  None of the existing AMs do anything useful except counting
tuples when there's nothing to delete, and we can get a tuple count
from the heap as long as it's not a partial index.  (hash actually can
skip anyway because it maintains a tuple count in the index metapage.)
GIST is not currently able to exploit this optimization because, due to
failure to index NULLs, GIST is always effectively partial.  Possibly
we should fix that sometime.
Simon Riggs w/ some review by Tom Lane.
2006-02-11 23:31:34 +00:00
Bruce Momjian a02f6ce33b Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
Joachim Wieland
2006-02-11 22:17:19 +00:00
Bruce Momjian 4cb27fef0a o Improve psql's handling of multi-line statements
Currently, while \e saves a single statement as one entry, interactive
	statements are saved one line at a time.  Ideally all statements
	would be saved like \e does.

Sergey E. Koposov
2006-02-11 21:55:35 +00:00
Tom Lane fbb1daed93 Fix incorrect addition, subtraction, and overflow checking in new
inet operators.
2006-02-11 20:39:59 +00:00
Bruce Momjian 77bb65d3fc Revert based on Tom's recommendation:
> Allow VACUUM to complete faster by avoiding scanning the indexes when no
> rows were removed from the heap by the VACUUM.
2006-02-11 17:14:09 +00:00
Bruce Momjian bf324946b3 Allow VACUUM to complete faster by avoiding scanning the indexes when no
rows were removed from the heap by the VACUUM.

Simon Riggs
2006-02-11 16:59:09 +00:00
Bruce Momjian 85d8ee846b Update catalog version for INET additions. 2006-02-11 16:28:56 +00:00
Bruce Momjian 1372515271 Add INET/CIDR operators: and, or, not, plus int8, minus int8, and inet
minus inet.

Stephen R. van den Berg
2006-02-11 03:32:41 +00:00
Tom Lane 9bf2ac2a40 Clean up signedness warnings and 64-bit bugs in recent psql printing
patch.  Martijn van Oosterhout and Tom Lane
2006-02-10 22:29:06 +00:00
Tom Lane fc9c20eb72 Make it possible to run initdb from an admin account on Windows,
by giving up admin privileges (only works if newer than NT4).

Magnus
2006-02-10 22:05:42 +00:00
Tom Lane a25cd81007 Enable pg_ctl to give up admin privileges when starting the server under
Windows (if newer than NT4, else works same as before).

Magnus
2006-02-10 22:00:59 +00:00
Tom Lane eb6d1270f1 Check that SID is enabled while checking for Windows admin privileges.
Magnus
2006-02-10 21:52:21 +00:00
Tom Lane 3ac1ac58cc Change search for default operator classes so that it examines all opclasses
regardless of the current schema search path.  Since CREATE OPERATOR CLASS
only allows one default opclass per datatype regardless of schemas, this
should have minimal impact, and it fixes problems with failure to find a
desired opclass while restoring dump files.  Per discussion at
http://archives.postgresql.org/pgsql-hackers/2006-02/msg00284.php.
Remove now-redundant-or-unused code in typcache.c and namespace.c,
and backpatch as far as 8.0.
2006-02-10 19:01:12 +00:00
Bruce Momjian 1a7be5cc7e Fix psql after newline patch for calloc(0).
Kris Jurka
2006-02-10 15:48:05 +00:00
Bruce Momjian c01999a557 Allow psql multi-line column values to align in the proper columns
If the second output column value is 'a\nb', the 'b' should appear
  in the second display column, rather than the first column as it
  does now.

Change libpq's PQdsplen() to return more useful values.

> Note: this changes the PQdsplen function, it can now return zero or
> minus one which was not possible before. It doesn't appear anyone is
> actually using the functions other than psql but it is a change. The
> functions are not actually documentated anywhere so it's not like we're
> breaking a defined interface. The new semantics follow the Unicode
> standard.

BACKWARD COMPATIBLE CHANGE.

The only user-visible change I saw in the regression tests is that a
SELECT * on a table where all the columns have been dropped doesn't
return a blank line like before.  This seems like a step forward.

Martijn van Oosterhout
2006-02-10 00:39:04 +00:00
Bruce Momjian 593763c086 This fixes pg_dump so that when using the '-O' no owners option it does
not print the owner name in the object comment.

eg:

--
-- Name: actor; Type: TABLE; Schema: public; Owner: chriskl; Tablespace:
--

Becomes:

--
-- Name: actor; Type: TABLE; Schema: public; Owner: -; Tablespace:
--

This makes it far easier to do 'user independent' dumps.  Especially for
distribution to third parties.

Christopher Kings-Lynne
2006-02-09 20:52:13 +00:00
Tom Lane ff2cc83f8a Provide the libpq error message when PQputline or PQendcopy fails. 2006-02-09 18:28:29 +00:00
Bruce Momjian a815a579f5 Use "bitwise" rather than "binary for AND/OR descriptions in \d, to
match SGML documentation.
2006-02-09 14:53:51 +00:00
Tom Lane 14ebeee134 C++ comments are verboten. Per gripe from Kris Jurka. 2006-02-09 07:22:22 +00:00
Tom Lane 7ae2ccbc85 Reject out-of-range dates in date_in().
Kris Jurka
2006-02-09 03:39:17 +00:00
Tom Lane 3cb312d873 Fix broken non-YYDEBUG case. 2006-02-09 00:56:57 +00:00
Michael Meskes e3740d2c59 Added just another test case.
Fixed missing continuation line character.
 Do not translate $-quoting.
 Bit field notation belongs to a variable not a variable list.
 Output of line number only done by one function.
2006-02-08 09:10:05 +00:00
Tom Lane 115e5dd597 Remove ancient hack to work around a peculiarity of libcurses on HPUX.
Since we now use libtermcap in preference to libcurses, no need for hack
anymore.
2006-02-07 17:36:13 +00:00
Bruce Momjian ad177f10ee Source code cleanup. 2006-02-07 17:04:04 +00:00
Bruce Momjian e7a9ccdb6c I think that NUMERIC datatype has a problem in the performance that
the format on Tuple(Numeric) and the format to calculate(NumericVar)
are different. I understood that to reduce I/O. However, when many
comparisons or calculations of NUMERIC are executed, the conversion
of Numeric and NumericVar becomes a bottleneck.

It is profile result when "create index on NUMERIC column" is executed:

  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 17.61     10.27    10.27 34542006     0.00     0.00  cmp_numerics
 11.90     17.21     6.94 34542006     0.00     0.00  comparetup_index
  7.42     21.54     4.33 71102587     0.00     0.00  AllocSetAlloc
  7.02     25.64     4.09 69084012     0.00     0.00  set_var_from_num
  4.87     28.48     2.84 69084012     0.00     0.00  alloc_var
  4.79     31.27     2.79 142205745     0.00     0.00  AllocSetFreeIndex
  4.55     33.92     2.65 34542004     0.00     0.00  cmp_abs
  4.07     36.30     2.38 71101189     0.00     0.00  AllocSetFree
  3.83     38.53     2.23 69084012     0.00     0.00  free_var

The create index command executes many comparisons of Numeric values.
Functions other than comparetup_index spent a lot of cycles for
conversion from Numeric to NumericVar.

An attached patch enables the comparison of Numeric values without
executing conversion to NumericVar. The execution time of that SQL
becomes half.

o Test SQL (index_test table has 1,000,000 tuples)
 create index index_test_idx on index_test(num_col);

o Test results (executed the test five times)
(1)PentiumIII
 original: 39.789s  36.823s  36.737s  37.752s  37.019s
 patched : 18.560s  19.103s  18.830s  18.408s  18.853s
  4.07     36.30     2.38 71101189     0.00     0.00  AllocSetFree
  3.83     38.53     2.23 69084012     0.00     0.00  free_var

The create index command executes many comparisons of Numeric values.
Functions other than comparetup_index spent a lot of cycles for
conversion from Numeric to NumericVar.

An attached patch enables the comparison of Numeric values without
executing conversion to NumericVar. The execution time of that SQL
becomes half.

o Test SQL (index_test table has 1,000,000 tuples)
 create index index_test_idx on index_test(num_col);

o Test results (executed the test five times)
(1)PentiumIII
 original: 39.789s  36.823s  36.737s  37.752s  37.019s
 patched : 18.560s  19.103s  18.830s  18.408s  18.853s

(2)Pentium4
 original: 16.349s  14.997s  12.979s  13.169s  12.955s
 patched :  7.005s   6.594s   6.770s   6.740s   6.828s

(3)Itanium2
 original: 15.392s  15.447s  15.350s  15.370s  15.417s
 patched :  7.413s   7.330s   7.334s   7.339s   7.339s

(4)Ultra Sparc
 original: 64.435s  59.336s  59.332s  58.455s  59.781s
 patched : 28.630s  28.666s  28.983s  28.744s  28.595s

Atsushi Ogawa
2006-02-07 16:03:50 +00:00
Peter Eisentraut 4d464076ff Make --version option print fixed program name. 2006-02-07 11:36:36 +00:00
Bruce Momjian 8bf47f455f Fix HTML alignment in PQprint.
Christoph Zwerschke
2006-02-07 00:26:15 +00:00
Tom Lane 72153c0582 Improve the tests to see if ScalarArrayOpExpr is strict. Original coding
would basically punt in all cases for 'foo <> ALL (array)', which resulted
in a performance regression for NOT IN compared to what we were doing in
8.1 and before.  Per report from Pavel Stehule.
2006-02-06 22:21:12 +00:00
Bruce Momjian 9ce51f3aa6 Fix PQprint HTML tag, "centre" -> "center". 2006-02-06 02:23:07 +00:00
Tom Lane 8e4057cc7d Fix pg_restore to properly discard COPY data when trying to continue
after an error in a COPY statement.  Formerly it thought the COPY data
was SQL commands, and got quite confused.

Stephen Frost
2006-02-05 20:58:47 +00:00
Tom Lane 336a6491aa Improve my initial, rather hacky implementation of joins to append
relations: fix the executor so that we can have an Append plan on the
inside of a nestloop and still pass down outer index keys to index scans
within the Append, then generate such plans as if they were regular
inner indexscans.  This avoids the need to evaluate the outer relation
multiple times.
2006-02-05 02:59:17 +00:00
Tom Lane 3893127431 Fix constraint exclusion to work in inherited UPDATE/DELETE queries
... in fact, it will be applied now in any query whatsoever.  I'm still
a bit concerned about the cycles that might be expended in failed proof
attempts, but given that CE is turned off by default, it's the user's
choice whether to expend those cycles or not.  (Possibly we should
change the simple bool constraint_exclusion parameter to something
more fine-grained?)
2006-02-04 23:03:20 +00:00
Michael Meskes a13c1edb57 Added C bit fields to ecpg parser
Added some default rules to lexer
Added log output to prepare statement
Added some more stuff to a test case
2006-02-04 20:54:44 +00:00
Andrew Dunstan f8b54fe6ed DROP IF EXISTS for ROLE/USER/GROUP 2006-02-04 19:06:47 +00:00
Peter Eisentraut 3fa9c416ed Issue a warning if a change-on-restart-only postgresql.conf value is
modified  and the server config files are reloaded
2006-02-04 12:50:47 +00:00
Bruce Momjian b3769066b8 In ecpg, automatically double single quotes in $$ strings because
internally $$ strings are converted to single-quote strings.

In ecpg, output newlines in commands using standard C escapes, rather
than using literal newlines, which is not portable.
2006-02-04 02:32:38 +00:00
Bruce Momjian 9190b4da5d Update Makefile for new thread_test location. 2006-02-04 01:04:20 +00:00
Bruce Momjian 9e66c3e6fe Move thread_test directory from /tools to /test so source-only tarballs
have the directory for the configure test.
2006-02-04 01:00:02 +00:00
Tom Lane 8b109ebf14 Teach planner to convert simple UNION ALL subqueries into append relations,
thereby sharing code with the inheritance case.  This puts the UNION-ALL-view
approach to partitioned tables on par with inheritance, so far as constraint
exclusion is concerned: it works either way.  (Still need to update the docs
to say so.)  The definition of "simple UNION ALL" is a little simpler than
I would like --- basically the union arms can only be SELECT * FROM foo
--- but it's good enough for partitioned-table cases.
2006-02-03 21:08:49 +00:00
Bruce Momjian a25b1decef Update tested AIX memset platforms. 2006-02-03 13:56:20 +00:00
Bruce Momjian ebd38e3c1d Allow MEMSET_LOOP_LIMIT to be set on a per-platform basis, and turn off
MemSet on AIX by setting MEMSET_LOOP_LIMIT to zero.

Add optimization to skip MemSet tests in MEMSET_LOOP_LIMIT == 0 case and
just call memset() directly.
2006-02-03 13:53:15 +00:00
Bruce Momjian 59bb147353 Update random() usage so ranges are inclusive/exclusive as required. 2006-02-03 12:45:47 +00:00
Bruce Momjian eb7bd06983 Prevent COPY from using newline or carriage return as delimiter or null.
Disallow backslash as the delimiter in non-CVS mode.

David Fetter
2006-02-03 12:41:07 +00:00
Bruce Momjian 890707a537 Improve tab whitespace in file.
Add comment about $$ and '' SCONST strings.
2006-02-03 05:38:35 +00:00
Bruce Momjian 46dfa5ec83 More spacing cleanups. 2006-02-02 03:51:41 +00:00
Bruce Momjian d63901c9d0 Source code alignment fixes for preproc.y. 2006-02-01 22:16:36 +00:00