Commit Graph

2467 Commits

Author SHA1 Message Date
Bruce Momjian 2ee0d5549f Add -L option to psql to log sessions.
Lorne Sunley
2005-06-14 02:57:45 +00:00
Neil Conway 077811605e Per discussion on -hackers, this patch changes psql's "expanded" output
mode to only affect the presentation of normal query results, not the
output of psql slash commands. Documentation updated. I also made
some unrelated minor psql cleanup. Per suggestion from Stuart Cooper.
2005-06-13 06:36:22 +00:00
Bruce Momjian 1a61896189 Use saveHistory so we get a nice error message on failure.
Andreas Seltenreich
2005-06-10 15:40:41 +00:00
Bruce Momjian ea88824a3e the following patch makes the filename used to store the readline
history customizable through a variable named HISTFILE, analogous to
psql's already implemented HISTCONTROL and HISTSIZE variables, and
bash's HISTFILE-Variable.

The motivation was to be able to get psql to maintain separate
histories for separate databases.  This is now easily achievable
through a line like the following in ~/.psqlrc:

\set HISTFILE ~/.psql_history-:DBNAME

Andreas Seltenreich
2005-06-10 15:34:26 +00:00
Bruce Momjian 92eadf6c4a More Win32 tilde code comments. 2005-06-10 14:49:31 +00:00
Bruce Momjian 3d44763179 Add comment on tilde expansion. 2005-06-10 14:41:32 +00:00
Bruce Momjian 0725065b37 This patch shows the full path name when doing a \s in psql,
if you have previously issued a \cd command.

Greg Sabino Mullane
2005-06-09 23:28:10 +00:00
Bruce Momjian 5c4955981e \(rs should be \\(rs, per Tom. 2005-06-09 18:40:06 +00:00
Bruce Momjian ebc8649892 Since I needed this feature badly, I added the -n / --schema switch to
pg_restore. It restores the given schemaname only. It can be used in
conjunction with the -t and other switches to make the selection very
fine grained.

Richard van den Bergg, CISSP
2005-06-09 17:56:51 +00:00
Bruce Momjian 4a5cda7bba I've created a patch which adds support for troff "-ms" output to
psql.  i.e. "\pset format troff-ms".  The patch also corrects some
problems with the "latex" format, notably defining an extra column in
the output table, and correcting some alignment issues; it also
changes the output to match the border setting as documented in the
manual page and as shown with the "aligned" format.

The troff-ms output is mostly identical to the latex output allowing
for the differences between the two typesetters.

The output should be saved in a file and piped as follows:

  cat file | tbl | troff -T ps -ms > file.ps
or
  tbl file | troff -T ps -ms > file.ps

Because it contains tabs, you'll need to redirect psql output or use
"script", rather than pasting from a terminal window, due to the tabs
which can be replaced with spaces.

Roger Leigh
2005-06-09 15:27:27 +00:00
Tom Lane f5b2f60bd1 Change WAL-logging scheme for multixacts to be more like regular
transaction IDs, rather than like subtrans; in particular, the information
now survives a database restart.  Per previous discussion, this is
essential for PITR log shipping and for 2PC.
2005-06-08 15:50:28 +00:00
Tom Lane c14f2ba7a4 Use just NULL not NULL::TEXT --- the latter coding is unnecessary and
not schema-safe.  Per report from Jochem van Dieten.
2005-06-07 14:04:48 +00:00
Tom Lane 8dfb616606 The no-lexer-backup speedup hadn't been there a week before somebody
broke it.  Maybe we do need an automated check ...
2005-06-02 17:45:19 +00:00
Tom Lane 21fda22ec4 Change CRCs in WAL records from 64bit to 32bit for performance reasons.
Instead of a separate CRC on each backup block, include backup blocks
in their parent WAL record's CRC; this is important to ensure that the
backup block really goes with the WAL record, ie there was not a page
tear right at the start of the backup block.  Implement a simple form
of compression of backup blocks: drop any run of zeroes starting at
pd_lower, so as not to store the unused 'hole' that commonly exists in
PG heap and index pages.  Tweak PageRepairFragmentation and related
routines to ensure they keep the unused space zeroed, so that the above
compression method remains effective.  All per recent discussions.
2005-06-02 05:55:29 +00:00
Bruce Momjian b51366396b Add support for \x hex strings in psql variables. 2005-06-02 01:23:48 +00:00
Bruce Momjian 3e8dbc846c Support only octal for psql PROMPT values, rather than the confusing
hex/decimal/octal.  Documentation already updated.

BACKWARD COMPATIBLE CHANGE
2005-05-30 18:28:11 +00:00
Bruce Momjian 33294d57c7 Use {xqoctesc} lex macro now that \ddd is standard. 2005-05-30 16:48:47 +00:00
Bruce Momjian f13c132072 Have psql escape bytes in strings for variables follow the backend
conventions of only allowing octal, like \045.  Remove support for
\decimal, \0octal, and \0xhex which matches the strtol() function but
didn't make sense with backslashes.

These now return the same character:

	test=> \set x '\54'
	test=> \echo :x
	,
	test=> \set x '\054'
	test=> \echo :x
	,

THIS IS A BACKWARD COMPATIBILITY CHANGE.
2005-05-30 14:50:35 +00:00
Tom Lane 15e4d1e2a7 Tweak the backend scanner (and psqlscan.l, which must track the backend
scanner anyway) to avoid having any backup states.  According to the
flex manual, this should speed things up, and indeed the backend scanner
is about a third faster according to some quick profiling checks.
I haven't tried to measure the speed change in psql, but it probably
is similar.
2005-05-26 01:24:29 +00:00
Bruce Momjian bbb586ff21 Quick patch to adress a recent concern on the mailing list
about adding an errant "TO" when we already have a TO. Since
TO cannot be a valid column name (we must quote it), we can
simply ignore the tab-completion if the previous word
was a "TO".

Greg Sabino Mullane
2005-05-25 22:12:05 +00:00
Bruce Momjian b492c3accc Add parentheses to macros when args are used in computations. Without
them, the executation behavior could be unexpected.
2005-05-25 21:40:43 +00:00
Tom Lane 1a022f71d8 Add -I$(srcdir) to CPPFLAGS to make psqlscan.c compile in vpath builds.
Not sure why this hasn't been reported before; perhaps it is not needed
with newer gcc versions, but it definitely fails here.
2005-05-24 16:45:23 +00:00
Neil Conway 6910032a56 Upon closer inspection, Greg's psql tab completion patch leaks memory.
Fix the leak, and add a comment to note that the return value of
previous_word must be free'd.
2005-05-18 05:01:10 +00:00
Neil Conway 4c1f9a0f0b psql tab completion improvements, from Greg Sabino Mullane:
* Made DELETE into "DELETE FROM"
* Moved ANALZYE to the end of the list to ease EXPLAIN / VACUUM
  conflicts
* Removed the ANALYZE xx semicolon completion: we don't do that anywhere
  else
* Add DECLARE support
* Add parens for DROP AGGREGATE
* Add "CASCADE | RESTRICT" for DROP xx
* Make EXPLAIN <tab> a lot smarter
* GROUP "BY" and ORDER "BY"
* "ISOLATION" becomes "ISOLATION LEVEL"
* Fix error in which REVOKE xx ON yy was receiving "TO", now gets "FROM"
* Add GRANT/REVOKE xx ON yy TO/FROM choices: usernames, GROUP, PUBLIC
* PREPARE xx <tab> AS "SELECT | INSERT | UPDATE | DELETE"
* Add = at end of UPDATE xx SET yy
* Beef up VACUUM stuff
2005-05-18 04:47:40 +00:00
Tom Lane f9ad8a2802 Guard against duplicate IDs in input file in SortTocFromFile().
Per report from Brian Hackett.
2005-05-17 17:30:29 +00:00
Bruce Momjian b63990c6a8 Add COPY WITH CVS HEADER to allow a heading line as the first line in
COPY.

Andrew Dunstan
2005-05-07 02:22:49 +00:00
Tom Lane 13f75e378e Use postmaster_is_alive() check in pg_ctl restart as well as pg_ctl status,
so that restart doesn't fail when old postmaster died unbetimes.
2005-05-04 22:35:15 +00:00
Tom Lane f593dda030 Spell DELIMITER correctly, per Seamus Dean. 2005-05-04 14:25:24 +00:00
Neil Conway 47458f8c2f GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()
and similar functions (if the variable is derived from untrusted
data, it could include unexpected formatting sequences). This
emits too many warnings to be enabled by default, but it does
flag a few dubious constructs in the Postgres tree. This patch
fixes up the obvious variants: functions that are passed a variable
format string but no additional arguments.

Most of these are harmless (e.g. the ruleutils stuff), but there
is at least one actual bug here: if you create a trigger named
"%sfoo", pg_dump will read uninitialized memory and fail to dump
the trigger correctly.
2005-04-30 08:08:51 +00:00
Bruce Momjian 32d3b47e6f Remove extern from optreset that was just added. 2005-04-29 14:30:11 +00:00
Bruce Momjian 7cebfdf211 Backpatch BCC compile changes to 8.0.X for psql. 2005-04-29 13:42:21 +00:00
Neil Conway 18b5ef5a76 This patch fixes a bug in the error message emitted by pg_restore on an
incorrect -F argument: write_msg() expects its first parameter to be a
"module name", not the format string.
2005-04-29 07:08:06 +00:00
Tom Lane bedb78d386 Implement sharable row-level locks, and use them for foreign key references
to eliminate unnecessary deadlocks.  This commit adds SELECT ... FOR SHARE
paralleling SELECT ... FOR UPDATE.  The implementation uses a new SLRU
data structure (managed much like pg_subtrans) to represent multiple-
transaction-ID sets.  When more than one transaction is holding a shared
lock on a particular row, we create a MultiXactId representing that set
of transactions and store its ID in the row's XMAX.  This scheme allows
an effectively unlimited number of row locks, just as we did before,
while not costing any extra overhead except when a shared lock actually
has to be shared.   Still TODO: use the regular lock manager to control
the grant order when multiple backends are waiting for a row lock.

Alvaro Herrera and Tom Lane.
2005-04-28 21:47:18 +00:00
Dennis Bjorklund d902e7d63b Fix a whitespace problem. From Alvaro Herrera. 2005-04-28 15:51:57 +00:00
Bruce Momjian a65b1b738c Add psql \set ON_ERROR_ROLLBACK to allow statements in a transaction to
error without affecting the entire transaction.  Valid values are
"on|interactive|off".
2005-04-28 13:09:59 +00:00
Tom Lane 14c7fba3f7 Rethink original decision to use AND/OR Expr nodes to represent bitmap
logic operations during planning.  Seems cleaner to create two new Path
node types, instead --- this avoids duplication of cost-estimation code.
Also, create an enable_bitmapscan GUC parameter to control use of bitmap
plans.
2005-04-21 19:18:13 +00:00
Tom Lane 2f8c7c866c Make pg_ctl status do a kill() test to verify that the PID found in
postmaster.pid still represents a live postmaster.
2005-04-20 23:10:16 +00:00
Tom Lane c822fe05ae pg_dumpall should enforce the server version check for itself, rather
than simply passing it down to pg_dump.  Else, version-related failures
in pg_dumpall itself generate unhelpful error messages.
2005-04-18 23:47:52 +00:00
Tom Lane 348f856dc5 Revert addition of poorly-thought-out DUMP TIMESTAMP archive entry,
which induced bug #1597 in addition to having several other misbehaviors
(like labeling the dump with a completion time having nothing to do with
reality).  Instead just print out the desired strings where RestoreArchive
was already emitting the 'PostgreSQL database dump' and
'PostgreSQL database dump complete' strings.
2005-04-15 16:40:36 +00:00
Tom Lane 2193a856a2 Simplify initdb-time assignment of OIDs as I proposed yesterday, and
avoid encroaching on the 'user' range of OIDs by allowing automatic
OID assignment to use values below 16k until we reach normal operation.

initdb not forced since this doesn't make any incompatible change;
however a lot of stuff will have different OIDs after your next initdb.
2005-04-13 18:54:57 +00:00
Tom Lane dffab0c88d Remove unnecessary UPDATE commands to assign explicit ACLs to functions
and PL languages during initdb.  The default permissions for these objects
are the same as what we were assigning anyway, so there is no need to
expend space in the catalogs on them.  The space cost is particularly
significant in pg_proc's indexes, which are bloated by about a factor of 2
by the full-table update, and can never really recover the space.
initdb not forced, since the change has no actual impact on behavior.
2005-04-12 19:29:24 +00:00
Peter Eisentraut c580d94541 Revert mistaken renaming of UTF-8. 2005-04-12 14:19:43 +00:00
Tom Lane 2e7a68896b Add aggsortop column to pg_aggregate, so that MIN/MAX optimization can
be supported for all datatypes.  Add CREATE AGGREGATE and pg_dump support
too.  Add specialized min/max aggregates for bpchar, instead of depending
on text's min/max, because otherwise the possible use of bpchar indexes
cannot be recognized.
initdb forced because of catalog changes.
2005-04-12 04:26:34 +00:00
Neil Conway f5ab0a14ea Add a "USING" clause to DELETE, which is equivalent to the FROM clause
in UPDATE. We also now issue a NOTICE if a query has _any_ implicit
range table entries -- in the past, we would only warn about implicit
RTEs in SELECTs with at least one explicit RTE.

As a result of the warning change, 25 of the regression tests had to
be updated. I also took the opportunity to remove some bogus whitespace
differences between some of the float4 and float8 variants. I believe
I have correctly updated all the platform-specific variants, but let
me know if that's not the case.

Original patch for DELETE ... USING from Euler Taveira de Oliveira,
reworked by Neil Conway.
2005-04-07 01:51:41 +00:00
Neil Conway e6557e9a67 Include information about a domain's CHECK constraint, if any, in the
output of \dD in psql. From Greg Sabino Mullane.
2005-04-06 05:23:32 +00:00
Neil Conway 8bbe905a2e Minor fixes for psql tab completion. Spell "absolute" like the English word,
not the brand of vodka. Complete FETCH <sth> <sth> with FROM and IN, not
FROM and TO (which is still pretty incomplete, but at least its the right
syntax).
2005-04-04 07:19:44 +00:00
Tom Lane a8e0dff101 Teach pg_dump about OUT parameters. 2005-04-01 18:35:41 +00:00
Bruce Momjian 135f65e299 Adjust pg_proc.proargtypes[0] tests in psql \df to handle new NULL value
for a function taking no arguments, per report from Michael Fuhr.
2005-04-01 05:30:38 +00:00
Tom Lane 8c85a34a3b Officially decouple FUNC_MAX_ARGS from INDEX_MAX_KEYS, and set the
former to 100 by default.  Clean up some of the less necessary
dependencies on FUNC_MAX_ARGS; however, the biggie (FunctionCallInfoData)
remains.
2005-03-29 03:01:32 +00:00
Bruce Momjian 6b7ef076b5 Have libpgport link before libpq so that PG client applications are more
immunte to changes in libpq's usage of pgport between major versions.
2005-03-25 18:17:14 +00:00
Tom Lane 91728fa26c Add temp_buffers GUC variable to allow users to determine the size
of the local buffer arena for temporary table access.
2005-03-19 23:27:11 +00:00
Tom Lane 2e629080f7 Put 'dump complete' message in the right place, so it comes out where
it's supposed to when --file option is used.
2005-03-18 17:32:55 +00:00
Neil Conway d663d3ba3a This patch makes \d on tables and views sort fk constraints, triggers
and rules alphabetically in the output.  This makes it the same as
for indexes and stops the irritating random or reverse ordering it
currently has.

Chris KL
2005-03-16 23:52:18 +00:00
Bruce Momjian 712f053587 Add sprintf support, that were were missing.
Add support for snprintf '+', 'h', and %* length settings.
2005-03-16 21:27:23 +00:00
Tom Lane 28bcc344b5 Make pg_dump emit a useful error message, instead of just dumping core,
if it finds a pg_rewrite entry for which there is no pg_class entry.
Per report from Andrew Slobodyanyk.
2005-03-14 18:57:33 +00:00
Bruce Momjian e7fb9f18bf Add support for Win1252 encoding.
Roland Volkmann
2005-03-14 18:31:25 +00:00
Bruce Momjian 3bc6bdf322 Define snprintf() to call pg_snprintf() so our own snprintf-like
implementation doesn't export out via libpq and get used by a user
application.
2005-03-11 17:20:35 +00:00
Bruce Momjian 6521cd9ae1 Add 'static' to initdb.c file-global variables. 2005-03-11 15:36:27 +00:00
Neil Conway 30c1aa06bc Replace an instance of $Id$ and an instance of $Header$ with $PostgreSQL$ 2005-03-07 22:59:43 +00:00
Bruce Momjian e3d7de6b99 Rename canonical encodings, per Peter:
UNICODE => UTF8
	ALT => WIN866
	WIN => WIN1251
	TCVN => WIN1258

The old codes continue to work.
2005-03-07 04:30:55 +00:00
Tom Lane 0fc4ecf935 Finish up the flat-files project: get rid of GetRawDatabaseInfo() hack
in favor of looking at the flat file copy of pg_database during backend
startup.  This should finally eliminate the various corner cases in which
backend startup fails unexpectedly because it isn't able to distinguish
live and dead tuples in pg_database.  Simplify locking on pg_database
to be similar to the rules used with pg_shadow and pg_group, and eliminate
FlushRelationBuffers operations that were used only to reduce the odds
of failure of GetRawDatabaseInfo.
initdb forced due to addition of a trigger to pg_database.
2005-02-26 18:43:34 +00:00
Bruce Momjian 0542b1e2fe Use _() macro consistently rather than gettext(). Add translation
macros around strings that were missing them.
2005-02-22 04:43:23 +00:00
Tom Lane ee467c3530 Fix minor thinko in logic to set dump order when dumping from a pre-7.3
database: aggregates should be dumped in the same pass as operators,
not in the same pass as functions.
2005-02-03 23:38:58 +00:00
Tom Lane bb1bd3276e Adjust mkdir_p to do stat() before trying mkdir(). Avoids problems on
Solaris and should be a little faster anyway, since in most scenarios
all but perhaps the last path component will already exist.
2005-01-28 00:34:32 +00:00
Tom Lane 7969649bd5 Minor tweak to avoid unnecessary memory bloat when dumping extremely wide
column values in -d mode.  Per report from Marty Scholes.  This doesn't
completely solve the issue, because we still need multiple copies of the
field value, but at least one copy can be got rid of painlessly ...
2005-01-26 21:24:12 +00:00
Tom Lane 9d58b9645e Make pg_dump and pg_restore handle binary archive formats correctly
when using stdout/stdin on Windows.
2005-01-26 19:44:43 +00:00
Tom Lane 889f038129 Use SHGetFolderPath instead of SHGetSpecialFolderPath to find the
APPDATA directory on Windows.  Magnus Hagander
2005-01-26 19:24:03 +00:00
Tom Lane fd5437c78b Fix breakage created by addition of separate 'acl pass' in pg_dump.
Also clean up incredibly poor style in TocIDRequired() usage.
2005-01-25 22:44:31 +00:00
Peter Eisentraut 5ca9687fe4 Add missing "ko". 2005-01-25 17:32:00 +00:00
Bruce Momjian 0960dc2293 Document why CREATE CONSTRAINT TRIGGER doesn't tab complete. 2005-01-23 15:58:50 +00:00
Tom Lane bdbfd343a2 pg_dump dumped the wrong tablespace for an index (ie, the parent table's
tablespace instead of the index's own), except when the index was created
as a constraint.  Report and fix by Tanida Yutaka.
2005-01-23 00:30:26 +00:00
Tom Lane 3e2e58ba37 New routine _getObjectDescription() failed to cope with some aspects of
pre-7.3 pg_dump archive files: namespace isn't there, and in some cases
te->tag may already be quotified.  Per report from Alan Pevec and
followup testing.
2005-01-23 00:03:54 +00:00
Neil Conway fa471dac02 Trivial fix: remove some stray leading whitespace. 2005-01-20 22:54:57 +00:00
Peter Eisentraut f87e5b295c Translation updates 2005-01-17 21:21:18 +00:00
Peter Eisentraut bb60ef23ed Translation updates 2005-01-17 14:55:34 +00:00
Peter Eisentraut f099cb0ede Translation updates 2005-01-17 10:00:06 +00:00
Peter Eisentraut 0d45116eb0 Translation updates 2005-01-17 03:09:08 +00:00
Peter Eisentraut 0be1166352 New translation 2005-01-17 03:05:37 +00:00
Peter Eisentraut 83ef003f2c Translation updates 2005-01-17 02:41:50 +00:00
Tom Lane 299ae4356b Adjust warning message about Windows console code page to point to
the right place in the docs, and gettext()ify it.
2005-01-15 05:43:06 +00:00
Peter Eisentraut 75112d4b5d Translation updates 2005-01-14 08:57:06 +00:00
Bruce Momjian 29e58330a6 Change Win32 client configuration files from *.txt to *.conf. 2005-01-14 00:25:56 +00:00
Peter Eisentraut 66d8165a8b Translation updates 2005-01-13 21:24:40 +00:00
Peter Eisentraut f680aaeafa Translation updates 2005-01-13 19:06:37 +00:00
Tom Lane 5f0a468454 Fix tracking of dump-order dependencies for stand-alone composite types.
Per report from Robert Koepferl.
2005-01-11 17:55:25 +00:00
Tom Lane 38498a28df Clean up pg_dump's handling of ownership for indexes (including
pkey/unique constraint indexes) and schemas.  Per report from
Michael Fuhr.
2005-01-11 05:14:13 +00:00
Peter Eisentraut 84620860d9 New translations 2005-01-09 17:38:19 +00:00
Peter Eisentraut a58e738cd7 Translation updates 2005-01-09 17:32:05 +00:00
Peter Eisentraut 11ca6d580c Translation updates 2005-01-09 17:07:27 +00:00
Tom Lane 8afe005f42 Consistently use geteuid() not getuid(); there were a few places deviating
from our long-established standard.
2005-01-08 22:51:15 +00:00
Tom Lane a3f98d5795 Adjust lookup of client-side profile files (.pgpass and so on) as per
discussion on pgsql-hackers-win32 list.  Documentation still needs to
be tweaked --- I'm not sure how to refer to the APPDATA folder in
user documentation.
2005-01-06 18:29:11 +00:00
Dennis Bjorklund b8139ea397 Translation updates 2005-01-06 12:23:33 +00:00
Dennis Bjorklund 90f1507275 Translation updates 2005-01-06 12:14:36 +00:00
Dennis Bjorklund 883730edc8 Translation updates 2005-01-06 11:44:12 +00:00
Peter Eisentraut 381de28eb0 Translation updates 2005-01-06 09:07:17 +00:00
Peter Eisentraut c43bd11683 Translation updates 2005-01-06 08:46:07 +00:00
Tom Lane fdbeaaf90a Keep translations in step with synopses. 2005-01-06 00:11:56 +00:00
Tom Lane d877de9e6b Make pg_dump --oids work when default_with_oids = off. Per report from
Michael Fuhr.
2005-01-04 22:27:46 +00:00
Peter Eisentraut a2a5526ecb Translation updates 2005-01-03 22:39:24 +00:00
Tom Lane a17e589046 Adjust a few more copyright notices to match the format expected by
the src/tools/copyright script.
2005-01-01 22:14:33 +00:00
Tom Lane 7e1c8ef4fc Some more missed copyright notices. Many of these look like they
should have been caught by the src/tools/copyright script ... why
weren't they?
2005-01-01 20:44:34 +00:00
Bruce Momjian 2daed8c5b3 Update copyrights that were missed. 2005-01-01 05:43:09 +00:00
PostgreSQL Daemon 2ff501590b Tag appropriate files for rc3
Also performed an initial run through of upgrading our Copyright date to
extend to 2005 ... first run here was very simple ... change everything
where: grep 1996-2004 && the word 'Copyright' ... scanned through the
generated list with 'less' first, and after, to make sure that I only
picked up the right entries ...
2004-12-31 22:04:05 +00:00
Peter Eisentraut e14018dc5e Translation updates 2004-12-29 02:30:16 +00:00
Tom Lane d9236a69fc Make libpq default to localhost connections on machines without Unix-domain
sockets, rather than failing as it formerly did.  Revert the
thereby-obsoleted patch to make psql supply the localhost default.
2004-12-28 23:17:54 +00:00
Tom Lane 361f354109 Make sure --with-pgport option propagates into postgresql.conf.
Per gripe from Josh Berkus.
2004-12-27 20:39:21 +00:00
Peter Eisentraut 6dac6b89a0 Translation update 2004-12-27 14:24:22 +00:00
Tom Lane 9405e14e00 Switch order of WHERE clauses in tab completion queries, as suggested
by Rod Taylor.  The foo_is_visible() functions are relatively slow and
so it pays to check them after checking the name pattern match.
2004-12-24 15:42:05 +00:00
Tom Lane 63a90720b4 Remove extra parenthesis. 2004-12-23 00:03:24 +00:00
Bruce Momjian c21c658b36 Add error checking for starting a win32 service using pg_ctl. 2004-12-21 17:58:30 +00:00
Bruce Momjian 556e72124c Return proper error exit code on pg_ctl -w start failure. 2004-12-21 17:38:01 +00:00
Peter Eisentraut ca4736ab92 Translation update 2004-12-21 11:14:18 +00:00
Tom Lane 59bffa3707 Adjust pg_resetxlog to handle 8.0 WAL file names properly. 2004-12-20 01:42:11 +00:00
Tom Lane 1553be4a0b Prevent evaluation of backticks while discarding unwanted arguments
after an unknown or failed psql backslash command, and also while
discarding "extra" arguments of a putatively valid backslash command.
In the case of an unknown/failed command, make sure we discard the
whole rest of the line, rather than trying to resume at the next
backslash.  Per discussion with Thomer Gil.
2004-12-19 19:39:47 +00:00
Peter Eisentraut cd380b99cd Translation updates 2004-12-16 11:31:55 +00:00
Peter Eisentraut 6ad835f55f New translations 2004-12-15 17:50:20 +00:00
Peter Eisentraut fe4d1df375 Translation updates 2004-12-15 17:39:54 +00:00
Tom Lane 86a069bbed Cope with circularities involving a view's ON SELECT rule. I originally
thought there couldn't be any, but the folly of this was exposed by an
example from andrew@supernews.com 5-Dec-2004.  The patch applies the
identical logic already used for table constraints and defaults to ON
SELECT rules, so I have reasonable confidence in it even though it might
look like complicated logic.
2004-12-14 22:16:32 +00:00
Tom Lane 94e467061e Fix pg_dump to ensure that a comment on a table CHECK constraint cannot
be emitted too soon.  The previous code got this right in the case where
the CHECK was emitted as a separate ALTER TABLE command, but not in the
case where the CHECK is emitted right in CREATE TABLE.  Per report from
Slawomir Sudnik.

Note: this code is pretty ugly; it'd perhaps be better to treat comments
as independently sortable dump objects.  That'd be much too invasive a
change for RC time though.
2004-12-14 21:35:20 +00:00
Peter Eisentraut ec4aa14b68 Fix typo 2004-12-14 11:11:20 +00:00
Neil Conway 75e39c441e Prevent pg_resetxlog from being run as root. If this is allowed, some
root-owned files will be written to the data directory, leaving it in an
unusable state.
2004-12-14 01:59:41 +00:00
Peter Eisentraut 6ccb04f341 Translation updates 2004-12-13 21:49:10 +00:00
Peter Eisentraut 5483936ed3 New translations 2004-12-13 16:30:53 +00:00
Peter Eisentraut 965dd791f4 Translation updates 2004-12-13 16:28:23 +00:00
Peter Eisentraut f9a6ba184a Add missing newlines at end of error messages. 2004-12-12 18:26:29 +00:00
Peter Eisentraut 373825c9cd Translation updates 2004-12-12 18:09:18 +00:00
Peter Eisentraut b89df8fe60 Translation updates 2004-12-11 20:19:24 +00:00
Peter Eisentraut a31ec86ebe Translation updates 2004-12-11 20:10:14 +00:00
Peter Eisentraut e82cd783a1 Translation updates 2004-12-11 19:56:07 +00:00
Peter Eisentraut 4de679c710 Translation updates 2004-12-11 19:45:34 +00:00
Peter Eisentraut 10e960fb39 Translation updates 2004-12-11 19:09:08 +00:00
Peter Eisentraut 022a00b5f3 Translation updates 2004-12-11 19:03:49 +00:00
Peter Eisentraut 8efc721d52 Translation updates 2004-12-06 22:10:42 +00:00
Neil Conway b3f3092cad Fix off-by-1 bug in pg_ctl in -D handling, per report from pjmodos@parba.cz 2004-12-06 01:09:20 +00:00
Tom Lane 2ee3a720a4 Adjust help message for --no-owner, per Alvaro Herrera. 2004-12-03 18:48:19 +00:00
Bruce Momjian a6c1377085 Add \n to end of output for psql \s with no history file name.
This prevents the next psql prompt from showing up on the end of the
last history line.
2004-11-30 20:00:34 +00:00
Bruce Momjian f44c64c727 Quote SHELL arguments only on Win32. 2004-11-30 19:01:28 +00:00
Tom Lane 66cd815063 Clean up initdb's error handling so that it prints something more
useful than just \'failed\' when there's a problem.  Per gripe from
Chris Albertson.

In an unrelated change, use VACUUM FULL; VACUUM FREEZE; rather than
a single VACUUM FULL FREEZE command, to respond to my worries of a
couple days ago about the reliability of doing this in one go.
2004-11-29 03:05:03 +00:00
Bruce Momjian 5548122829 Add comment explaining possible compiler warning:
/*
     *  Some compilers with throw a warning knowing this test can never be
     *  true because off_t can't exceed the compared maximum.
     */
    if (th->fileLen > MAX_TAR_MEMBER_FILELEN)
        die_horribly(AH, modulename, "archive member too large for tar format\n");
2004-11-29 03:01:54 +00:00
Bruce Momjian ee814b4511 Have initdb display relative paths to start postmaster if used to invoke
initdb, and display in a path-native way.
2004-11-29 01:14:45 +00:00
Peter Eisentraut 99b735cc03 Work around lack of NLS support in libpgport by making those components
who use it scan the relevant source files for their own catalog.  It
creates a bit of duplicate work for translators, but it gets the job done
for now.
2004-11-27 22:44:15 +00:00
Tom Lane 90c3ebe4d7 Fix HAVE_OPTRESET to be HAVE_INT_OPTRESET. Typos spotted by Lorne Sunley. 2004-11-27 18:51:08 +00:00
Neil Conway e17766c12e Trivial fix for a bug introduced in r1.94 of help.c: we want to only
include "\s" in \? output when readline is enabled, but that commit
supressed "\s" whether readline was enabled or not.
2004-11-24 04:58:42 +00:00
Peter Eisentraut 2663e0c2e9 New translations 2004-11-23 23:13:26 +00:00
Peter Eisentraut 98f5efe774 Translation updates 2004-11-23 22:16:04 +00:00
Peter Eisentraut 050a0074c2 Translation update 2004-11-18 10:09:59 +00:00
Tom Lane c36496a101 Include <getopt.h> if available, to avoid warnings on Windows. 2004-11-17 21:37:47 +00:00
Tom Lane 6444bc3535 Set DEFAULT_EDITOR to notepad.exe on Windows, as per recent discussion. 2004-11-17 18:32:31 +00:00
Tom Lane 5d72ef83fd Miscellaneous Cygwin build fixes from Reini Urban. 2004-11-17 17:46:24 +00:00
Tom Lane 18b58350db Be sure length limit passed to snprintf matches what malloc was given.
Just paranoia ...
2004-11-17 16:34:42 +00:00
Peter Eisentraut 8a1821ab5b Translation update 2004-11-16 22:58:44 +00:00
Tom Lane 3d1e269e7e Don't quote the value of EDITOR on Unix, only on Windows. Per discussion. 2004-11-15 23:15:12 +00:00
Tom Lane f6474586ea Use English-style quotes in error messages, per Serguei Mokhov. 2004-11-14 23:36:53 +00:00
Bruce Momjian fc402fdf2d pg_restore --help improvements, from Tom Lane:
!       printf(_("  -d, --dbname=NAME        connect to database name\n"));

!       printf(_("  -C, --create             create the target database\n"));
2004-11-11 17:06:46 +00:00
Peter Eisentraut e9c05281b5 Get rid of perror(), substitute some better phrased error messages.
malloc() doesn't set errno, so most uses were buggy anyway.
2004-11-09 15:57:57 +00:00
Peter Eisentraut 1813d94664 Translation updates 2004-11-09 14:46:37 +00:00
Peter Eisentraut 7d8578a0c2 Clarify some strings 2004-11-09 14:39:44 +00:00
Peter Eisentraut ea182a9ef4 Translation update 2004-11-09 14:38:48 +00:00
Bruce Momjian 0d3b8e9a50 Allow win32/cygwin link against the first matching library symbol rather
than erroring out.  This is the Unix behavior.
2004-11-08 05:23:26 +00:00
Peter Eisentraut c22b4fa386 New translation 2004-11-07 23:38:19 +00:00
Peter Eisentraut 58b33f2e85 Translation updates 2004-11-07 23:28:20 +00:00
Tom Lane 04baa0ebf9 Update pg_dump to use SET DEFAULT_TABLESPACE instead of explicit
tablespace clauses; this should improve compatibility of dump files.
Philip Warner, some rework by Tom Lane.
2004-11-06 19:36:02 +00:00
Bruce Momjian 1d13bed735 Remove directory from cmd.exe default shell. 2004-11-06 17:56:40 +00:00
Bruce Momjian 86100de856 Variable initializer no longer necessary. 2004-11-06 05:20:41 +00:00
Bruce Momjian 7ba377431e Tests for COMSPEC in the right place and supply a reasonable shell
default on Win32.
2004-11-06 04:29:40 +00:00
Tom Lane 98e8b48053 Create 'default_tablespace' GUC variable that supplies a TABLESPACE
clause implicitly whenever one is not given explicitly.  Remove concept
of a schema having an associated tablespace, and simplify the rules for
selecting a default tablespace for a table or index.  It's now just
(a) explicit TABLESPACE clause; (b) default_tablespace if that's not an
empty string; (c) database's default.  This will allow pg_dump to use
SET commands instead of tablespace clauses to determine object locations
(but I didn't actually make it do so).  All per recent discussions.
2004-11-05 19:17:13 +00:00
Bruce Momjian 54691d414d Fix psql \e and \! for Win32. 2004-11-04 22:25:14 +00:00
Peter Eisentraut d0066b9fa4 Tab completion for CREATE TABLESPACE arguments. Patch by Joachim Wieland. 2004-11-02 16:10:05 +00:00
Peter Eisentraut bb2d1ce8f1 Translation updates 2004-11-02 09:28:41 +00:00
Peter Eisentraut 005b1b5fc8 Translation updates 2004-11-02 09:20:22 +00:00
Bruce Momjian 7fad5fff0d That's just the lovely way windows handles a "segfault". Gotta be really
interesting for MS to catch all those dumps...

Anyway. Oops. Seems I ran my regression tests with the old psql, and
just managed to update the backend, when I tested that patch. Turns out
there are codepaths where we'd access the Critical Section before it was
initialized. Attached patch breaks the initializeation off to a separate
part and adds that one to a much earlier position in the program.

Magnus Hagander
2004-11-01 19:21:50 +00:00
Tom Lane 44e8a968e3 Invent a new, more thread-safe version of PQrequestCancel, called PQcancel.
Use this new function in psql.  Implement query cancellation in psql for
Windows.  Code by Magnus Hagander, documentation and minor editorialization
by Tom Lane.
2004-10-30 23:11:27 +00:00
Peter Eisentraut 94c502f1db Translation updates 2004-10-28 09:01:06 +00:00
Peter Eisentraut fc4cfc366d Translation updates 2004-10-28 08:54:09 +00:00
Bruce Momjian a7049b52e3 Have pg_ctl status always output to stdout, even stopped status, not stderr. 2004-10-27 19:44:14 +00:00
Bruce Momjian 3fe704209a Canonicalize Win32 path coming in from pg_ctl -D, idea from Magnus. 2004-10-27 17:17:09 +00:00
Peter Eisentraut 2514e904da New translation 2004-10-27 11:44:09 +00:00
Peter Eisentraut ad6b3975c9 Translation updates 2004-10-27 11:22:18 +00:00
Peter Eisentraut 2db0bde40e Translation update 2004-10-27 11:13:29 +00:00
Peter Eisentraut cd92d85d11 Translation updates 2004-10-27 11:09:33 +00:00
Peter Eisentraut 979b0be4c3 Translation updates 2004-10-27 10:22:47 +00:00
Peter Eisentraut eb7fc3eb1f Translation updates 2004-10-27 10:13:49 +00:00
Tom Lane 85b2facdd8 Write config files as text not binary, per Magnus Hagander. 2004-10-24 15:55:29 +00:00
Dennis Bjorklund 8b9aaea888 Translation update 2004-10-23 14:48:03 +00:00
Dennis Bjorklund fea9cf6231 Translation updates 2004-10-23 07:29:27 +00:00
Dennis Bjorklund 3b15cc9129 Translation update 2004-10-23 06:48:59 +00:00
Dennis Bjorklund f4eaed6bd9 Translation updates 2004-10-23 06:40:24 +00:00
Dennis Bjorklund 0b7705fff8 Translation updates 2004-10-23 06:32:53 +00:00
Tom Lane 521408a56f Don't use LC_MESSAGES value on WIN32, since it doesn't work.
Magnus Hagander
2004-10-22 22:30:57 +00:00
Peter Eisentraut 4733dcc592 Translation updates 2004-10-22 16:05:02 +00:00
Peter Eisentraut 77c0204a37 Message styling 2004-10-22 16:04:35 +00:00
Dennis Bjorklund c70b7b7a6c Translation update 2004-10-22 14:14:24 +00:00
Dennis Bjorklund f4eb440279 New swedish translation of pg_config 2004-10-22 14:13:04 +00:00
Dennis Bjorklund cae2018b49 Translation updates 2004-10-22 13:41:47 +00:00
Tom Lane c58675b428 Prevent pg_ctl from being run as root. Since it uses configuration files
owned by postgres, doing "pg_ctl start" as root could allow a privilege
escalation attack, as pointed out by iDEFENSE.  Of course the postmaster would
fail, but we ought to fail a little sooner to protect sysadmins unfamiliar
with Postgres.  The chosen fix is to disable root use of pg_ctl in all cases,
just to be confident there are no other holes.
2004-10-22 00:24:18 +00:00
Peter Eisentraut 3371b99e65 New translation 2004-10-19 13:39:27 +00:00
Peter Eisentraut 9f2d5df3b9 Organize the help output a little better. Improve clarity of some messages. 2004-10-19 13:38:53 +00:00
Peter Eisentraut 6e53f18b84 New translation 2004-10-18 22:19:15 +00:00
Peter Eisentraut 2aa8d0a807 Might want to initialize the gettext library, if we're going to do all that
translation work.
2004-10-18 22:19:00 +00:00
Peter Eisentraut a465f24a1e Translation update 2004-10-18 22:18:03 +00:00