Commit graph

1521 commits

Author SHA1 Message Date
Tom Lane
76f39619d7 Fix bogus backslash sequences, per Kris Jurka. 2005-07-18 17:48:30 +00:00
Tom Lane
e3d0bd8d48 Guard against duplicate IDs in input file in SortTocFromFile().
Per report from Brian Hackett.
2005-05-17 17:31:15 +00:00
Neil Conway
0d8cdcfe88 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.

This patch fixes a bug in pg_dump (triggers with formatting sequences
in their names are not dumped correctly) and some related pg_dump
code that looks dubious; cleanups for more harmless instances have
been applied to more recent branches.
2005-04-30 08:42:17 +00:00
Neil Conway
8f54b05551 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-30 08:01:29 +00:00
Tom Lane
0b83c1f272 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:33 +00:00
Peter Eisentraut
6122f38b0a Translation updates 2004-04-05 09:02:37 +00:00
Peter Eisentraut
6f8f414d30 Translation updates 2004-04-05 08:45:37 +00:00
Tom Lane
e921472fef Always schema-qualify the name of a function referenced in CREATE CAST.
The former coding failed if the cast function was not in the pg_catalog
schema.  How'd this escape detection?
2004-03-02 21:15:15 +00:00
Tom Lane
8fd0eb8c7a Back-patch fix for ReadOffset with off_t wider than int. 2004-02-05 22:12:48 +00:00
Tom Lane
0847c879a9 Don't choke when the handler for a procedural language is located in
the pg_catalog schema.  Per bug report some months back from Jochem van Dieten.
2003-10-28 21:05:39 +00:00
Bruce Momjian
243f11ccf1 [ Patch applied only to 7.3.X.]
Hi There's a bug in the clusterdb script where it looks like the arguments
to the psql command are being passed in the wrong order, so it fails when
you run it on a database that is not on localhost.
Here's the output from the command:

133 anands-Computer:bin/scripts> clusterdb -h wooster -U rr granada
psql: warning: extra option wooster ignored
psql: warning: extra option -U ignored
psql: warning: extra option rr ignored
psql: warning: extra option -F: ignored
psql: warning: extra option -P ignored
psql: warning: extra option format=unaligned ignored
psql: warning: extra option -t ignored
psql: warning: extra option -c ignored
psql: warning: extra option SELECT nspname, pg_class.relname,
pg_class_2.relname FROM pg_class, pg_class AS pg_class_2 JOIN pg_namespace
ON (pg_namespace.oid=relnamespace), pg_index WHERE
pg_class.oid=pg_index.indrelid AND pg_class_2.oid=pg_index.indexrelid AND
pg_index.indisclustered AND pg_class.relowner=(SELECT usesysid FROM
pg_user WHERE usename=current_user) ignored
psql: FATAL:  user "-h" does not exist



I'm attaching a patch that fixes the problem. The diff was run on
postgresql 7.3.4

Thanks a lot.
Anand Ranganathan
2003-09-29 18:53:08 +00:00
Jan Wieck
6518b4cdf7 Backpatched changes for rules when casts are dumped according to
discussion on hackers.


Jan
2003-09-28 17:46:19 +00:00
Peter Eisentraut
ba91f3b1de Fix translation mistake. 2003-08-24 21:26:54 +00:00
Bruce Momjian
612cbaf5ed [ Backpatch to 7.3.X.]
If they're not, the below causes problems, as the foreign key is added
after the CHECK.  Cluster depends on the index name, so I thought it
wise to ensure all names are available, rather than leaving off the
CONSTRAINT "$n" portion for internally named constraints.

CREATE TABLE jkey (col integer primary key);
CREATE TABLE j (col integer REFERENCES jkey);
ALTER TABLE j ADD CHECK(col > 5);


This is a problem in 7.3 series as well as -Tip.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 04:09:15 +00:00
Peter Eisentraut
977adedda8 Small translation updates for 7.3.3 release. 2003-05-18 23:51:41 +00:00
Tom Lane
bdec4179b7 Back-patch fix to allow createuser to exit on control-C (Oliver Elphick) 2003-05-16 15:17:02 +00:00
Tom Lane
583736fad4 Back-patch fix from Oliver Elphick to force ISO datestyle in dumps. 2003-05-16 13:57:03 +00:00
Tom Lane
fd9dd1b964 Fix erroneous space calculation leading to core dump in dumpProcLangs,
per report from Olivier Prenant.  Also fix off-by-one space calculation
in ReadToc; this woould not have hurt us until we had more than 100
dependencies for a single object, but wrong is wrong.
2003-05-03 22:19:18 +00:00
Tom Lane
cb1ad8799b Correct oversight in createlang: test for pre-existing handler function
was broken by opaque->language_handler change.  I see this is already
fixed in CVS tip, but must back-patch for 7.3.3.
2003-04-26 15:19:05 +00:00
Tom Lane
66e0ea47a0 Back-patch fixes for zero-column tables in COPY, pg_dump. 2003-04-25 22:14:33 +00:00
Tom Lane
1a0172fbbd pg_dumpall failed on groups having no members. Per report from
Nick Eskelinen.
2003-03-14 22:45:56 +00:00
Tom Lane
db825e3743 pg_restore failed to restore blobs if -X disable-triggers is specified. 2003-03-09 19:38:59 +00:00
Tom Lane
8afc577123 Add missing --globals-only (long form of -g). 2003-03-06 21:45:57 +00:00
Tom Lane
5dc8478d20 Result of lo_read() is int, not size_t. Per Oleg Drokin. 2003-02-13 22:56:59 +00:00
Tom Lane
af30b95618 Cleaner solution to the problem of loading pre-7.3 dumps containing
columns of type lo (see contrib/lo).  Rather than hacking the function
definitions on-the-fly, just modify the queries issued by FixupBlobRefs
so that they work even if CREATE CAST hasn't been issued.
2003-02-01 22:07:14 +00:00
Tom Lane
90ad65a8ab Changes of 6-Sep-02 broke pg_restore's ability to recognize tar-format
files.  Fix it.
2003-02-01 19:29:26 +00:00
Tom Lane
938a562d22 Prevent core dump when die_horribly() is called with null AH pointer.
Problem reported and fixed by Oliver Elphick.
2003-01-27 00:23:49 +00:00
Tom Lane
a307ee1ccb Back-patch fix for not shell-quoting editor name, as it also fixes
silly buffer overrun (someone needs to learn to count characters...)
2003-01-24 05:23:55 +00:00
Tom Lane
c0f0d709e6 Fix bogus formatting of DROP DATABASE command, per Christopher Kings-Lynne. 2003-01-16 15:28:06 +00:00
Tom Lane
e2123a9708 Add missing <limits.h> for INT64_IS_BUSTED case. 2003-01-10 23:51:46 +00:00
Peter Eisentraut
b19a0c70d2 Translation updates 2003-01-04 10:26:28 +00:00
Tom Lane
d5a0f78848 Remove overenthusiastic free'ing of comment dependencies; could lead to
core dump in pg_dump when dumping views having comments.  See bug #855.
2002-12-27 17:10:55 +00:00
Tom Lane
a3feaba9aa Fix possible buffer overrun in \d command: substr(..., 128) produces
a result of at most 128 chars, but that could be more than 128 bytes.
Also ensure we don't try to pfree uninitialized pointers during error
cleanup.
2002-12-21 01:07:21 +00:00
Peter Eisentraut
ac3534f973 Translation updates 2002-12-10 20:00:27 +00:00
Tom Lane
dac011ebb3 Fix pg_dump failure against 7.1 or older servers, per
report from Philip Warner.
2002-12-01 18:44:09 +00:00
Bruce Momjian
f5d7da3041 Remove check for pg_group file as part of initdb -W password assignment
--- not needed.
2002-11-25 21:42:11 +00:00
Tom Lane
1e68232b35 Quote database name properly when invoking pg_dump. Per report from
Christopher Kings-Lynne.
2002-11-22 03:09:59 +00:00
Peter Eisentraut
f2ec243389 Update German translations. 2002-11-13 21:30:39 +00:00
Peter Eisentraut
2e28ef3663 Translation updates 2002-11-05 23:37:47 +00:00
Tom Lane
16cc5372e4 Avoid malloc(0) when printing a table of no columns. On some platforms
this returns NULL, which confuses the code.
2002-11-01 15:12:19 +00:00
Bruce Momjian
6d8c3d4eb3 Add popen/pclose -> _popen/_pclose() mapping for Win32. 2002-10-29 19:35:33 +00:00
Bruce Momjian
b064206c09 getopt.c now in /port, for MS Win. 2002-10-29 04:23:30 +00:00
Tom Lane
7a0671a37c Suppress compile warnings on OS X. 2002-10-27 02:52:10 +00:00
Bruce Momjian
3fd6d3260f Change to fseeko(), per Philip. 2002-10-25 03:47:30 +00:00
Bruce Momjian
fc5c577e34 Allow fseeko in pg_dump only if fseeko() will work for all supported file
sizes.
2002-10-25 01:33:17 +00:00
Bruce Momjian
b093f8825d Fix include files for new PageOutput call. 2002-10-24 01:33:50 +00:00
Bruce Momjian
641b658c26 Page \h output and centralize psql paging code in PageOutput(). 2002-10-23 19:23:57 +00:00
Bruce Momjian
2b287020f4 Allow 8-byte off_t to properly pg_dump, from Philip Warner with mods by Bruce. 2002-10-22 19:15:23 +00:00
Bruce Momjian
2110be0465 Cleanup for CLUSTERDB failure:
On Sat, Oct 19, 2002 at 12:11:32AM +0200, Peter Eisentraut wrote:
> $ ./clusterdb
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> clusterdb: While clustering peter, the following failed:
> $
>
> This could probably handled a little more gracefully.

Yes, sorry.  A patch for this is attached.  Please apply.

Alvaro Herrera
2002-10-21 20:32:33 +00:00
Peter Eisentraut
20f77d79a2 Translation updates 2002-10-21 18:51:03 +00:00