Commit Graph

2730 Commits

Author SHA1 Message Date
Peter Eisentraut 3adc760fb9 Translation updates 2007-11-15 20:38:15 +00:00
Peter Eisentraut e2776a0820 Add to synopsis that timeout option also applies to stop mode 2007-11-15 19:40:31 +00:00
Peter Eisentraut e4c26b03bf Make help synopsis consistent 2007-11-15 19:35:26 +00:00
Peter Eisentraut c938a4ea8d Make synopses of -t option consistent 2007-11-15 18:37:23 +00:00
Bruce Momjian 6e414a171e Add pg_ctl -t/timeout parameter to control amount of time to wait for
start/shutdown.
2007-11-10 21:48:51 +00:00
Peter Eisentraut 56f9ff72b2 Add missing newlines to error messages, and normalize wording a bit. 2007-11-08 10:37:54 +00:00
Peter Eisentraut 46c099ce71 Consistent capitalization 2007-11-07 14:07:21 +00:00
Peter Eisentraut e8c4f4e887 Improve wording 2007-11-07 13:23:20 +00:00
Peter Eisentraut 27d18ffcc0 Error message cleanup 2007-11-07 13:11:05 +00:00
Peter Eisentraut 5f9869d0ee Use "alternative" instead of "alternate" where it is clearer. 2007-11-07 12:24:24 +00:00
Peter Eisentraut e6a5c0aa2c More precise error message 2007-10-31 10:55:25 +00:00
Tom Lane 27c033ed98 Make pg_dump and friends consistently report both the filename and the
errno string when complaining of fopen failures.  Per gripe from Bob
Pawley, it's not always instantly obvious to the user which name we
tried to open.
2007-10-28 21:55:52 +00:00
Tom Lane 006f42c74d Fix a couple of issues with pg_dump's handling of inheritance child tables
that have default expressions different from their parent.  First, if the
parent table's default expression has to be split out as a separate
ALTER TABLE command, we need a dependency constraint to ensure that the
child's command is given second.  This is because the ALTER TABLE on the
parent will propagate to the child.  (We can't prevent that by using ONLY on
the parent's command, since it's possible that other children exist that
should receive the inherited default.)  Second, if the child has a NULL
default where the parent does not, we have to explicitly say DEFAULT NULL on
the child in order for this state to be preserved after reload.  (The latter
actually doesn't work right because of a backend bug, but that is a separate
issue.)

Backpatch as far as 8.0.  7.x pg_dump has enough issues with altered tables
(due to lack of dependency analysis) that trying to fix this one doesn't seem
very productive.
2007-10-28 19:08:02 +00:00
Peter Eisentraut 8a8bcb447a Translation updates 2007-10-27 00:13:43 +00:00
Tom Lane 48c16e14f5 Make initdb's selection of default text search configuration depend
only on the 'language' part of the locale name, ignoring the country code.
We may need to be smarter later when there are more built-in configurations,
but for now this is good enough and avoids having to bloat the table.
2007-10-25 20:22:53 +00:00
Alvaro Herrera 5c4249c353 Danish_Danmark -> Danish_Denmark 2007-10-24 20:11:00 +00:00
Tom Lane 2011bebc89 Use 'token' not 'lexeme' to describe the output of a parser. 2007-10-16 18:02:26 +00:00
Magnus Hagander 699a0ef7bb Re-allow UTF8 encodings on win32. Since UTF8 is converted to
UTF16 before being used, all (valid) locales will work for this.
2007-10-16 11:30:16 +00:00
Peter Eisentraut 2d5b16bb10 Remove quotes around locale names in some places for consistency. 2007-10-16 09:09:11 +00:00
Tom Lane 041a8b37f5 Try to fix msvc build for recent initdb changes. 2007-10-13 22:55:38 +00:00
Tom Lane 8468146b03 Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: the
renumbering of encoding IDs done between 8.2 and 8.3 turns out to break 8.2
initdb and psql if they are run with an 8.3beta1 libpq.so.  For the moment
we can rearrange the order of enum pg_enc to keep the same number for
everything except PG_JOHAB, which isn't a problem since there are no direct
references to it in the 8.2 programs anyway.  (This does force initdb
unfortunately.)

Going forward, we want to fix things so that encoding IDs can be changed
without an ABI break, and this commit includes the changes needed to allow
libpq's encoding IDs to be treated as fully independent of the backend's.
The main issue is that libpq clients should not include pg_wchar.h or
otherwise assume they know the specific values of libpq's encoding IDs,
since they might encounter version skew between pg_wchar.h and the libpq.so
they are using.  To fix, have libpq officially export functions needed for
encoding name<=>ID conversion and validity checking; it was doing this
anyway unofficially.

It's still the case that we can't renumber backend encoding IDs until the
next bump in libpq's major version number, since doing so will break the
8.2-era client programs.  However the code is now prepared to avoid this
type of problem in future.

Note that initdb is no longer a libpq client: we just pull in the two
source files we need directly.  The patch also fixes a few places that
were being sloppy about checking for an unrecognized encoding name.
2007-10-13 20:18:42 +00:00
Tom Lane b37e1770c5 Make use of additional chklocale.c entries to reject locales that we
cannot support.
2007-09-29 00:14:40 +00:00
Tom Lane 70b9b9b788 Change initdb and CREATE DATABASE to actively reject attempts to create
databases with encodings that are incompatible with the server's LC_CTYPE
locale, when we can determine that (which we can on most modern platforms,
I believe).  C/POSIX locale is compatible with all encodings, of course,
so there is still some usefulness to CREATE DATABASE's ENCODING option,
but this will insulate us against all sorts of recurring complaints
caused by mismatched settings.

I moved initdb's existing LC_CTYPE-to-encoding mapping knowledge into
a new src/port/ file so it could be shared by CREATE DATABASE.
2007-09-28 22:25:49 +00:00
Tom Lane 834f45014b Tweak initdb's text search configuration selection code so it can
cope with LANG settings like 'es_ES@euro'.
2007-09-28 15:25:44 +00:00
Tom Lane 314ed5de6d Define the FRONTEND symbol in postgres_fe.h, which allows us to eliminate
duplicative -DFRONTEND flags from many Makefiles.  We still need Makefile
control of the symbol in a few places that compile frontend-or-backend
src/port/ files, but it's a lot cleaner than before.

Hiroshi Saito
2007-09-27 19:53:44 +00:00
Peter Eisentraut 588901df84 Small string tweaks 2007-09-25 16:29:34 +00:00
Tom Lane c3b193a5c3 Replace linear searches with binary searches in pg_dump's code to
lookup objects by OID.  Per gripe from nikitathespider.
2007-09-23 23:39:36 +00:00
Bruce Momjian 17aae41afd Add tsearch tab completion support:
* adds a few missing words to some commands (like adding GIN as a valid
index type or OWNED BY for ALTER SEQUENCE,...)

* support for ALTER TABLE foo ENABLE/DISABLE REPLICA TRIGGER/RULE

* autocomplete CREATE DATABASE foo TEMPLATE (mostly done to prevent
conflicts with the TEMPLATE keyword for text search)

* support for ALTER/CREATE/DROP TEXT SEARCH as well as COMMENT ON TEXT
SEARCH and the corresponding psql backslash commands.
This proved a little more difficult than expected due to the fact that
words_after_create[] is used for two purposes - one is to provide a list
of words that follow immediatly after CREATE (or DROP) and the other
purpose is to use it for autocompleting anywhere in the statement if the
word in that struct is found with a query.
Since TEXT SEARCH CONFIGURATION|DICTIONARY|TEMPLATE|PARSER results in 3
words instead of one (as all the other words in that list are) I added a
flag to the struct to tell create_command_generator() to skip that entry
 for autocompleting immediatly after CREATE which feels like a dirty
hack (but that holds true for a lot of code in tab-complete.c).


Stefan Kaltenbrunner
2007-09-14 04:25:24 +00:00
Tom Lane 2abae34a2e Implement function-local GUC parameter settings, as per recent discussion.
There are still some loose ends: I didn't do anything about the SET FROM
CURRENT idea yet, and it's not real clear whether we are happy with the
interaction of SET LOCAL with function-local settings.  The documentation
is a bit spartan, too.
2007-09-03 00:39:26 +00:00
Tom Lane 3b5f5d9873 Fix aboriginal bug in _tarAddFile(): when complaining that the amount of data
read from the temp file didn't match the file length reported by ftello(),
the wrong variable's value was printed, and so the message made no sense.
Clean up a couple other coding infelicities while at it.
2007-08-29 16:31:36 +00:00
Tom Lane b2a52b3b80 Make \dFt and \dFt+ do something different --- omitting the function
names in the former case seems more consistent with the behavior of
other \dF commands.
2007-08-22 02:25:34 +00:00
Tom Lane d321421d0a Simplify the syntax of CREATE/ALTER TEXT SEARCH DICTIONARY by treating the
init options of the template as top-level options in the syntax.  This also
makes ALTER a bit easier to use, since options can be replaced individually.
I also made these statements verify that the tmplinit method will accept
the new settings before they get stored; in the original coding you didn't
find out about mistakes until the dictionary got invoked.

Under the hood, init methods now get options as a List of DefElem instead
of a raw text string --- that lets tsearch use existing options-pushing code
instead of duplicating functionality.
2007-08-22 01:39:46 +00:00
Tom Lane 140d4ebcb4 Tsearch2 functionality migrates to core. The bulk of this work is by
Oleg Bartunov and Teodor Sigaev, but I did a lot of editorializing,
so anything that's broken is probably my fault.

Documentation is nonexistent as yet, but let's land the patch so we can
get some portability testing done.
2007-08-21 01:11:32 +00:00
Tom Lane 509bfd6a6b Fix unintended change of output format for createlang/droplang -l. Missed
these uses of printQuery() in FETCH_COUNT patch a year ago :-(.  Per report
from Tomoaki Sato.
2007-08-10 00:39:31 +00:00
Tom Lane fcb9535e8a Fix pg_restore to guard against unexpected EOF while reading an archive file.
Per report and partial patch from Chad Wagner.
2007-08-06 01:38:15 +00:00
Neil Conway 087a271327 Tweak for initdb: if more command-line arguments were specified than
expected, exit with an error, rather than complaining about the error
on stderr but continuing onward.
2007-08-04 21:01:09 +00:00
Tom Lane 82eed4dba2 Arrange to put TOAST tables belonging to temporary tables into special schemas
named pg_toast_temp_nnn, alongside the pg_temp_nnn schemas used for the temp
tables themselves.  This allows low-level code such as the relcache to
recognize that these tables are indeed temporary, which enables various
optimizations such as not WAL-logging changes and using local rather than
shared buffers for access.  Aside from obvious performance benefits, this
provides a solution to bug #3483, in which other backends unexpectedly held
open file references to temporary tables.  The scheme preserves the property
that TOAST tables are not in any schema that's normally in the search path,
so they don't conflict with user table names.

initdb forced because of changes in system view definitions.
2007-07-25 22:16:18 +00:00
Neil Conway ad44c95825 Fixup the indentation of a comment that was mangled by pgindent, and
add dashes to the start/end of the comment block to try to prevent
this happening in the future.
2007-07-12 23:25:26 +00:00
Tom Lane 4bbb7f9469 Suppress Sun Studio warnings, per Stefan. 2007-07-12 21:27:09 +00:00
Magnus Hagander 017f2d2f18 Silence compile warning on win32, per Stefan and Buildfarm. 2007-07-12 18:15:52 +00:00
Tom Lane 05c4d8f783 Suppress a warning that some versions of gcc emit about %x in strftime.
Per suggestion from Alvaro.
2007-07-11 23:15:38 +00:00
Tom Lane ff481ca0d4 Adjust processSQLNamePattern() so that $ within the pattern is always matched
literally, whether quoted or not.  Since we allow $ as a character within
identifiers, this behavior is useful, whereas the previous behavior of
treating it as the regexp ending anchor was nearly useless given that the
pattern is automatically anchored anyway.  This affects the arguments of
psql's \d commands as well as pg_dump's -n and -t switches.  Per discussion.
2007-07-10 00:21:31 +00:00
Tom Lane 8331c11f3f Get rid of client-code dependencies on the exact text of the no-password
error message, by using PQconnectionUsedPassword() instead.  Someday
we might be able to localize that error message, but not until this
coding technique has disappeared everywhere.
2007-07-08 19:07:38 +00:00
Neil Conway a55898131e Add ALTER VIEW ... RENAME TO, and a RENAME TO clause to ALTER SEQUENCE.
Sequences and views could previously be renamed using ALTER TABLE, but
this was a repeated source of confusion for users. Update the docs,
and psql tab completion. Patch from David Fetter; various minor fixes
by myself.
2007-07-03 01:30:37 +00:00
Magnus Hagander a1587e41ae - Fix the -w (wait) option to work in Windows service mode, per bug #3382.
- Prevent the -w option being passed to the postmaster.
- Read the postmaster options file when starting as a Windows service.

Dave Page
2007-07-02 21:58:31 +00:00
Neil Conway 7c07b136bc Add the function's volatility to the output of psql's \df+ command.
Update the psql reference page accordingly.
2007-06-28 06:40:16 +00:00
Neil Conway 2128e5c392 In psql, when running a SELECT query using a cursor, flush the query
output after each FETCH. This ensures that incremental results are
available to clients that are executing long-running SELECT queries
via the FETCH_COUNT feature.
2007-06-22 01:09:28 +00:00
Tom Lane 4c310eca2e Arrange for quote_identifier() and pg_dump to not quote keywords that are
unreserved according to the grammar.  The list of unreserved words has gotten
extensive enough that the unnecessary quoting is becoming a bit of an eyesore.
To do this, add knowledge of the keyword category to keywords.c's table.
(Someday we might be able to generate keywords.c's table and the keyword lists
in gram.y from a common source.)  For the moment, lie about WITH's status in
the table so it will still get quoted --- this is because of the expectation
that WITH will become reserved when the SQL recursive-queries patch gets done.

I didn't force initdb because this affects nothing on-disk; but note that a
few regression tests have changed expected output.
2007-06-18 21:40:58 +00:00
Neil Conway 320f820585 Schema-qualify several references to the builtin function length(), to
avoid mistakenly calling a function of the same name that might happen
to appear earlier in the schema search path.
2007-06-13 23:59:47 +00:00
Peter Eisentraut 9539e64bc0 Remove gratuitous response messages from utility programs.
(Possibly release notes material, lest users be confused.)

The --quiet option is now obsolete and without effect in createdb,
createuser, dropdb, dropuser; kept for compatibility but marked for
removal in 8.4.

Progress messages when acting on all databases now go to stdout instead
of stderr, since they are not in fact errors.

Ordered options in reindexdb reference page alphabetically, like in
other programs' pages.
2007-06-04 10:02:40 +00:00