Commit Graph

2639 Commits

Author SHA1 Message Date
Bruce Momjian 6441288ec9 Add 'output file' option for pg_dumpall, especially useful for Win32,
where output redirection of child processes (pg_dump) doesn't work.

Dave Page
2007-01-25 03:30:43 +00:00
Bruce Momjian d37881fd90 Allow pg_dumpall to specify a database name rather than the default
'template1'.

Dave Page
2007-01-25 02:46:33 +00:00
Bruce Momjian 5ce94b28cc Add --tablespaces-only and --roles-only options to pg_dumpall.
Dave Page
2007-01-25 02:30:32 +00:00
Tom Lane 379958128c Update pg_dump to support dumping operator families. 2007-01-23 17:54:50 +00:00
Tom Lane 5a7471c307 Add COST and ROWS options to CREATE/ALTER FUNCTION, plus underlying pg_proc
columns procost and prorows, to allow simple user adjustment of the estimated
cost of a function call, as well as control of the estimated number of rows
returned by a set-returning function.  We might eventually wish to extend this
to allow function-specific estimation routines, but there seems to be
consensus that we should try a simple constant estimate first.  In particular
this provides a relatively simple way to control the order in which different
WHERE clauses are applied in a plan node, which is a Good Thing in view of the
fact that the recent EquivalenceClass planner rewrite made that much less
predictable than before.
2007-01-22 01:35:23 +00:00
Neil Conway 479ee09059 List disabled triggers separately in psql's "\d <table>" output.
Previously, disabled triggers were not displayed any differently than
enabled ones, which was quite misleading. Patch from Brendan Jurd.
2007-01-20 21:17:30 +00:00
Peter Eisentraut 2cc01004c6 Remove remains of old depend target. 2007-01-20 17:16:17 +00:00
Bruce Momjian f5f9577e50 Modify max_fsm_pages in postgresql.conf.sample to show a typical value,
rather than a value too high.
2007-01-20 17:04:58 +00:00
Neil Conway 4945a8fad4 Teach psql's \lo slash commands to respect quiet mode, and to output
HTML in HTML mode. Patch from Jeremy Drake.
2007-01-20 16:57:31 +00:00
Bruce Momjian 945d0b4b09 Allow Borland CC to compile libpq and psql.
L Bayuk
2007-01-11 02:39:52 +00:00
Bruce Momjian c3578a68f8 Allow initdb to specify the pg_xlog directory.
Euler Taveira de Oliveira
2007-01-06 19:40:00 +00:00
Bruce Momjian 29dccf5fe0 Update CVS HEAD for 2007 copyright. Back branches are typically not
back-stamped for this.
2007-01-05 22:20:05 +00:00
Andrew Dunstan 226e9fffc8 Call setrlimit if possible in pg_regress to allow core file generation, and provide a switch for similar behaviour in pg_ctl. 2007-01-05 16:17:55 +00:00
Tom Lane 2ee56b6a3a Tweak pg_dumpall to add GRANT CONNECT ON DATABASE ... TO PUBLIC when dumping
database privileges from a pre-8.2 server.  This ensures that the reloaded
database will maintain the same behavior it had in the previous installation,
ie, everybody has connect privilege.  Per gripe from L Bayuk.
2007-01-04 17:49:37 +00:00
Tom Lane 5725b9d9af Support type modifiers for user-defined types, and pull most knowledge
about typmod representation for standard types out into type-specific
typmod I/O functions.  Teodor Sigaev, with some editorialization by
Tom Lane.
2006-12-30 21:21:56 +00:00
Tom Lane 3a7f5459d7 fflush the \o file, if any, after each backslash command. We already
do this for ordinary SQL commands, so it seems consistent to do it for
backslash commands too.  Per gripe from Rajesh Kumar Mallah.
2006-12-28 00:29:13 +00:00
Tom Lane 6bb7b467c0 Print combining characters (those reported as having zero width by
PQdsplen()) normally, instead of replacing them by \uXXXX sequences.
Assume that they in fact occupy zero screen space for formatting purposes.
Per gripe from Michael Fuhr and ensuing discussion.
2006-12-27 19:45:36 +00:00
Tom Lane 506a9893b7 Make HISTCONTROL=ignoredups work again (broken by misordering of
operations during recent code refactoring).  Per bug #2840 from Ned Crigler.
2006-12-24 19:14:28 +00:00
Tom Lane a78fcfb512 Restructure operator classes to allow improved handling of cross-data-type
cases.  Operator classes now exist within "operator families".  While most
families are equivalent to a single class, related classes can be grouped
into one family to represent the fact that they are semantically compatible.
Cross-type operators are now naturally adjunct parts of a family, without
having to wedge them into a particular opclass as we had done originally.

This commit restructures the catalogs and cleans up enough of the fallout so
that everything still works at least as well as before, but most of the work
needed to actually improve the planner's behavior will come later.  Also,
there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
to create a new family right now is to allow CREATE OPERATOR CLASS to make
one by default.  I owe some more documentation work, too.  But that can all
be done in smaller pieces once this infrastructure is in place.
2006-12-23 00:43:13 +00:00
Andrew Dunstan 6b4fe0460c fix thinko in placement of TimeValStruct typedef in Windows case, as reported by Magnus. 2006-12-18 14:17:41 +00:00
Andrew Dunstan 7bdc55cc71 enable \timing oputput for \copy commands 2006-12-16 00:38:43 +00:00
Tom Lane 0cb91ccba9 Remove the logId/logSeg fields from pg_control, because they are not needed
in normal operation, and we can avoid rewriting pg_control at every log
segment switch if we don't insist that these values be valid.  Reducing
the number of pg_control updates is a good idea for both performance and
reliability.  It does make pg_resetxlog's life a bit harder, but that seems
a good tradeoff; and anyway the change to pg_resetxlog amounts to automating
something people formerly needed to do by hand, namely look at the existing
pg_xlog files to make sure the new WAL start point was past them.

In passing, change the wording of xlog.c's "database system was interrupted"
messages: describe the pg_control timestamp as "last known up at" rather than
implying it is the exact time of service interruption.  With this change the
timestamp will generally be the time of the last checkpoint, which could be
many minutes before the failure; and we've already seen indications that
people tend to misinterpret the old wording.

initdb forced due to change in pg_control layout.  Simon Riggs and Tom Lane
2006-12-08 19:50:53 +00:00
Bruce Momjian 50a073916c Fix pg_dump linking on Win32 with MSVS win32.mak:
The module link is insufficient.:-(

---- Sorry, japanese message change to xxx ---
link.exe @C:\DOCUME~1\hi-saito\LOCALS~1\Temp\nmk03360.
common.obj : error LNK2001: xxxxxx "_pg_qsort" xxxxxx
pg_dump_sort.obj : error LNK2001: xxxxx "_pg_qsort" xxxxx
.\Release\pg_dump.exe : fatal error LNK1120: xxxxxxx
NMAKE : fatal error U1077: 'link.exe' : xxxxx '0x460'
Stop.

Hiroshi Saito
2006-12-04 22:26:17 +00:00
Peter Eisentraut 339483928d Translation updates 2006-12-02 01:16:16 +00:00
Tom Lane df3a6fe477 Fix psql's \copy command to ensure that it cycles libpq back to the idle state
(in particular, causing the ReadyForQuery message to be eaten) before
returning from do_copy.  The only known consequence of failing to do so is
that get_prompt might show a wrong result for the %x transaction status
escape, as reported by Bernd Helmle; but it's possible there are other issues.

Back-patch as far as 7.4, the oldest version supporting %x.
2006-11-24 23:06:50 +00:00
Peter Eisentraut 2c82df2a06 Translation updates 2006-11-24 17:11:57 +00:00
Tom Lane 617f123f06 Get rid of retail definitions of HAVE_STRDUP and HAVE_VSNPRINTF in
some of the Windows-only makefiles; the correct place to assert these
things is pg_config.h.win32.  Per bug #2677.
2006-11-21 23:26:47 +00:00
Tom Lane 5fc2d7e451 Suppress timezone (%Z) part of timestamp display when running on Windows,
because on that platform strftime produces localized zone names in varying
encodings.  Even though it's only in a comment, this can cause encoding
errors when reloading the dump script.  Per suggestion from Andreas
Seltenreich.  Also, suppress %Z on Windows in the %s escape of
log_line_prefix ... not sure why this one is different from the other two,
but it shouldn't be.
2006-11-21 22:19:46 +00:00
Neil Conway 415b925345 Fix a memory leak in psql: we'd leak a few PGresult handles if
a connectivity error occurred while executing one of the queries
for "\d <table>". Not serious, but still worth fixing. Patch from
Brendan Jurd.
2006-11-08 01:22:55 +00:00
Tom Lane 19d0c46def pg_restore failed on tar-format archives if they contained large objects
(blobs) with comments, per bug #2727 from Konstantin Pelepelin.
Mea culpa for not having tested this case.
Back-patch to 8.1; prior branches don't dump blob comments at all.
2006-11-01 15:59:26 +00:00
Peter Eisentraut 9c2c41646a Translations update 2006-10-21 21:03:04 +00:00
Tom Lane 1314983fd3 Code review for --no-data-for-failed-tables patch. Instead of trashing
one of the program's core data structures, make use of the existing
ability to selectively exclude TOC items by ID.  Slightly more code but
much less likely to create future maintenance problems.
2006-10-14 23:07:22 +00:00
Tom Lane a50606de91 Remove somebody's ill-considered free() call, per report from Chander Ganesan.
No, I do not care whether Coverity considers this a memory leak.
It's entirely not worth the code space to do it correctly.
2006-10-12 05:14:49 +00:00
Bruce Momjian ed95aea27d MSVC/BCC Win32 compiler fixes.
Hiroshi Saito
2006-10-10 21:31:44 +00:00
Tom Lane 24e9752863 Revise psql pattern-matching switches as per discussion. The rule is now
to process all inclusion switches then all exclusion switches, so that the
behavior is independent of switch ordering.
Use of -T does not cause non-table objects to be suppressed.  And
the patterns are now interpreted the same way psql's \d commands do it,
rather than as pure regex commands; this allows for example -t schema.tab
to do what it should have been doing all along.  Re-enable the --blobs
switch to do something useful, ie, add back blobs into a dump they were
otherwise suppressed from.
2006-10-09 23:36:59 +00:00
Tom Lane 39ed8c4049 Move processNamePattern into dumputils.c in preparation for using it in
pg_dump as well as psql.  Since psql already uses dumputils.c, while there's
not any code sharing in the other direction, this seems the easiest way.
Also, fix misinterpretation of patterns using regex | by adding parentheses
(same bug found previously in similar_escape()).  This should be backpatched.
2006-10-09 23:30:33 +00:00
Tom Lane 0629030962 Fix ancient oversight in psql's \d pattern processing code: when seeing two
quote chars inside quote marks, should emit one quote *and stay in inquotes
mode*.  No doubt the lack of reports of this have something to do with the
poor documentation of the feature ...
2006-10-07 22:21:38 +00:00
Peter Eisentraut 2b25e1169f The -X option in pg_dump was supposed to be a workaround for the lack of
portable long options.  But we have had portable long options for a long
time now, so this is obsolete.  Now people have added options which *only*
work with -X but not as regular long option, so I'm putting a stop to this:
-X is deprecated; it still works, but it has been removed from the
documentation, and please don't add more of them.
2006-10-07 20:59:05 +00:00
Peter Eisentraut b9b4f10b5b Message style improvements 2006-10-06 17:14:01 +00:00
Tom Lane ff40057116 Fix initdb's logic for picking shared_buffers/max_fsm_pages, which had
gotten rather thoroughly whacked out by careless recent changes: the
intended ratio between the two was off by a lot, and the minimum number
of shared buffers tried had increased by a lot.  Problem exposed by
failures on buildfarm members with smaller SHMMAX values.
2006-10-04 18:58:08 +00:00
Bruce Momjian f99a569a2e pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
Bruce Momjian ed80f5701b pgevent fixes:
1) Make vcbuild actually build the pgevent dll.
2) Change the pgevent DLL file so it doens't specify ordinal for the
functions. You're not supposed to do that. You're actually supposed to
declare them as PRIVATE as well, but mingw doesn't support that. VC++
will throw a warning and not an error though, so we can live with it.

Magnus Hagander
2006-10-03 22:12:14 +00:00
Bruce Momjian fb541a1b59 Fix yesno_prompt() memory leak in /script tools, reported by Converity. 2006-10-03 21:45:20 +00:00
Bruce Momjian 5441a64164 The attached patch changes units of the some default values in
postgresql.conf.

- shared_buffers = 32000kB => 32MB
- temp_buffers = 8000kB => 8MB
- wal_buffers = 8 => 64kB

The code of initdb was a bit modified to write MB-unit values.
Values greater than 8000kB are rounded out to MB.

GUC_UNIT_XBLOCKS is added for wal_buffers. It is like GUC_UNIT_BLOCKS,
but uses XLOG_BLCKSZ instead of BLCKSZ.

Also, I cleaned up the test of GUC_UNIT_* flags in preparation to
add more unit flags in less bits.

ITAGAKI Takahiro
2006-10-03 21:11:55 +00:00
Tom Lane 1d45168f4b Fix some misuses of strncat(). 2006-09-27 16:19:42 +00:00
Tom Lane 9ba4065312 Remove separate strdup.h header file; it's redundant with port.h. 2006-09-27 15:41:24 +00:00
Tom Lane ccfafb4716 Suppress useless warning on pre-XP versions of Windows. Magnus 2006-09-24 16:59:45 +00:00
Tom Lane beca984e5f Fix bugs in plpgsql and ecpg caused by assuming that isspace() would only
return true for exactly the characters treated as whitespace by their flex
scanners.  Per report from Victor Snezhko and subsequent investigation.

Also fix a passel of unsafe usages of <ctype.h> functions, that is, ye olde
char-vs-unsigned-char issue.  I won't miss <ctype.h> when we are finally
able to stop using it.
2006-09-22 21:39:58 +00:00
Tom Lane 6d0efd3a09 Surely this temp buffer needn't be static. 2006-09-22 19:51:14 +00:00
Peter Eisentraut cbb7acface Rearrange yes/no prompting code so that the prompts always show the
(possibly (un)translated) letters that are actually expected as input.
Also reject invalid responses instead of silenty taken them as "no".

with help from Bernd Helmle
2006-09-22 18:50:41 +00:00