summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2005-07-10This patch addresses the problem mentioned in the "process crashBruce Momjian
when a plpython function returns unicode" thread: http://archives.postgresql.org/pgsql-bugs/2005-06/msg00105.php In several places PL/Python was calling PyObject_Str() and then PyString_AsString() without checking if the former had returned NULL to indicate an error. PyString_AsString() doesn't expect a NULL argument, so passing one causes a segmentation fault. This patch adds checks for NULL and raises errors via PLy_elog(), which prints details of the underlying Python exception. The patch also adds regression tests for these checks. All tests pass on my Solaris 9 box running HEAD and Python 2.4.1. In one place the patch doesn't call PLy_elog() because that could cause infinite recursion; see the comment I added. I'm not sure how to test that particular case or whether it's even possible to get an error there: the value that the code should check is the Python exception type, so I wonder if a NULL value "shouldn't happen." This patch converts NULL to "Unknown Exception" but I wonder if an Assert() would be appropriate. The patch is against HEAD but the same changes should be applied to earlier versions because they have the same problem. The patch might not apply cleanly against earlier versions -- will the committer take care of little differences or should I submit different versions of the patch? Michael Fuhr
2005-07-10I made the patch that implements regexp_replace again.Bruce Momjian
The specification of this function is as follows. regexp_replace(source text, pattern text, replacement text, [flags text]) returns text Replace string that matches to regular expression in source text to replacement text. - pattern is regular expression pattern. - replacement is replace string that can use '\1'-'\9', and '\&'. '\1'-'\9': back reference to the n'th subexpression. '\&' : entire matched string. - flags can use the following values: g: global (replace all) i: ignore case When the flags is not specified, case sensitive, replace the first instance only. Atsushi Ogawa
2005-07-10Add psql \pset numericsep to allow output numbers like 100,000.0 orBruce Momjian
100.000,0. Eugen Nedelcu
2005-07-08Fix config file lexer to not barf if postgresql.conf ends with a commentTom Lane
that has no terminating newline. Per report from maps.on at gmx.net.
2005-07-08Try connecting to both postgres and template1 databases to do the initialTom Lane
inspection of shared catalogs. This allows pg_dumpall to continue to work with pre-8.1 servers that likely won't have a database named postgres. Also, suppress output of SYSID options for users and groups, since server no longer does anything with these except emit a rude message. There is much more to be done to update pg_dumpall for the roles feature, but this at least makes it usable again. Per gripe from Chris K-L.
2005-07-08Make libpq_gettext save and restore errno in a Windows-compatible way.Tom Lane
Also, back-patch fix into back branches.
2005-07-08testing activitymailPostgreSQL Daemon
2005-07-08Remove some dead code for handling XLOG_DBASE_CREATE_OLD andNeil Conway
XLOG_DBASE_DROP_OLD WAL records -- these records are no longer created in current sources. Adjust numbering of XLOG_DBASE_CREATE and XLOG_DBASE_DROP and bump the catversion. Patch from Gavin Sherry, adjusted by Neil Conway.
2005-07-08Even though I'd like to see full_page_writes go away before 8.1,Tom Lane
a minimum requirement is that it not completely break the system meanwhile. Put the test in the right place.
2005-07-07Track dependencies on shared objects (which is to say, roles; we alreadyTom Lane
have adequate mechanisms for tracking the contents of databases and tablespaces). This solves the longstanding problem that you can drop a user who still owns objects and/or has access permissions. Alvaro Herrera, with some kibitzing from Tom Lane.
2005-07-07Fix plperl expected output.Bruce Momjian
Andrew Dunstan
2005-07-07pg_column_size() cleanup for messages and code cleanup.Bruce Momjian
Mark Kirkwood
2005-07-06Currently, nonfatal warnings are not trapped (as they should be) byBruce Momjian
plperl - the attached small patch remedies that omission, and adds a small regression test for error and warning output - the new regression input and expected output are in separate attached files. Andrew Dunstan
2005-07-06Currently, nonfatal warnings are not trapped (as they should be) byBruce Momjian
plperl - the attached small patch remedies that omission. Andrew Dunstan
2005-07-06Complete zic patch backout by removing NO_PGPORT workaround.Bruce Momjian
2005-07-06Reverse out because the lack of using pgport in timezone/ is causingBruce Momjian
problems: --------------------------------------------------------------------------- Support cross compilation by compiling "zic" with a native compiler. This relies on the output of zic being platform independent, but that is currently the case.
2005-07-06Add pg_column_size() to return storage size of a column, includingBruce Momjian
possible compression. Mark Kirkwood
2005-07-06Sync dlopen error handling for the *BSDs ... seems to me I've done thisTom Lane
before, but they were out of sync again. Per Kris Jurka.
2005-07-06Add a check for trigger function with declared arguments. This pathTom Lane
could not be reached before, but now that there is a plpgsql validator function, it can be. Check is needed to prevent core dump reported by Satoshi Nagayasu. Besides, this gives a more specific and useful error message for a fairly common novice error.
2005-07-06Save and restore errno across bindtextdomain call, per discussion.Tom Lane
2005-07-06Attached is a patch that enhances the "\h" capability in psql. I oftenBruce Momjian
find myself typing a command and then wanting to get the syntax for it. So I do a ctrl-a and add a \h: but psql does not recognize the command, because I have stuff attached to it (e.g. "alter table foobar"), so I have to scroll over and delete everything except the name of the command itself. This patch gives \h three chances to match: if nothing matches the complete string (current behavior), it tries to match the first two words (e.g. "ALTER TABLE"). If that fails, it tries to match the first word (e.g. "DELETE"). Greg Sabino Mullane
2005-07-05Add GUC full_page_writes to control writing full pages to WAL.Bruce Momjian
2005-07-05Fix contrib/pgcrypto to autoconfigure for OpenSSL when --with-opensslTom Lane
is used in the toplevel configure. Per Marko Kreen.
2005-07-05Back out patch. This should be done like other server-side languages.Bruce Momjian
--------------------------------------------------------------------------- This patch allows the PL/Python module to do (SRF) functions. The patch was taken from the CVS version. I have modified the plpython.c file and have added a test sql script for testing the functionality. It was actually the script that was in the 8.0.3 version but have since been removed. In order to signal the end of a set, the called python function must simply return plpy.EndOfSet and the set would be returned. Gerrit van Dyk
2005-07-05Add NO_PGPORT defines to fix win32/cygwin builds for new target platformBruce Momjian
build of zic.
2005-07-04Restructure zic #define fprintf checks to use a NO_PGPORT macro instead.Bruce Momjian
2005-07-04I have to admit that I got the case of the preprocessor symbol on amd64Bruce Momjian
wrong. __AMD64__ is not defined, __amd64__ is. Christof Petig
2005-07-04This patch allows the PL/Python module to do (SRF) functions.Bruce Momjian
The patch was taken from the CVS version. I have modified the plpython.c file and have added a test sql script for testing the functionality. It was actually the script that was in the 8.0.3 version but have since been removed. In order to signal the end of a set, the called python function must simply return plpy.EndOfSet and the set would be returned. Gerrit van Dyk
2005-07-04I made the patch that improved the performance of replace_text().Bruce Momjian
The content of the patch is as follows: (1)Create shortcut when subtext was not found. (2)Stop using LEFT and RIGHT macro. In LEFT and RIGHT macro, TEXTPOS is executed by the same content as execution immediately before. The execution frequency of TEXTPOS can be reduced by using text_substring instead of LEFT and RIGHT macro. (3)Add appendStringInfoText, and use it instead of appendStringInfoString. There is an overhead of PG_TEXT_GET_STR when appendStringInfoString is executed by text type. This can be reduced by appendStringInfoText. (4)Reduce execution of TEXTDUP. The effect of the patch that I measured is as follows: - The Data for test was created by 'pgbench -i'. - Test SQL: select replace(aid, '9', 'A') from accounts; - Test results: Linux(CPU: Pentium III, Compiler option: -O2) original: 1.515s patched: 1.250s Atsushi Ogawa
2005-07-04Fix compile if zic because it now doesn't use libpgport.Bruce Momjian
2005-07-04Fix date_trunct for December dates that are in the next year, e.g.:Bruce Momjian
SELECT date_trunc('week', '2002-12-31'::date); Backpatch to 8.0.X. Per report from Nick Johnson.
2005-07-04Arrange for the postmaster (and standalone backends, initdb, etc) toTom Lane
chdir into PGDATA and subsequently use relative paths instead of absolute paths to access all files under PGDATA. This seems to give a small performance improvement, and it should make the system more robust against naive DBAs doing things like moving a database directory that has a live postmaster in it. Per recent discussion.
2005-07-04Reverse this patch:Bruce Momjian
--------------------------------------------------------------------------- > A quick look shows that when you use --with-libraries=/foo/bar the > generated link line for libraries says > > -L/foo/bar -lpq > > and it should probably be the other way around (as it is for the > executables). > > So I suspect we need some makefile tuning. You were correct. This patch fixes it. Jim C. Nasby
2005-07-04Fix build break for out of tree (vpath) builds, induced by recent zicNeil Conway
changes.
2005-07-03Fix memory leak in plperl_hash_from_tuple(), per report from Jean-Max Reymond.Tom Lane
2005-07-03Don't try to constant-fold functions returning RECORD. We were neverTom Lane
able to do this before, but I had tried to make an exception for functions with OUT parameters. Michael Fuhr found one problem with it already, and I found another, which was it didn't work for strict functions with a NULL input. While both of these could be worked around, the probability that there are more gotchas seems high; I think prudence dictates just reverting to the former behavior for now. Accordingly, remove the kluge added to get_expr_result_type() for Michael's case.
2005-07-03Support cross compilation by compiling "zic" with a native compiler. ThisPeter Eisentraut
relies on the output of zic being platform independent, but that is currently the case.
2005-07-03Improve outer-join-deduction logic to be able to propagate equalitiesTom Lane
through multiple join clauses.
2005-07-02> A quick look shows that when you use --with-libraries=/foo/bar theBruce Momjian
> generated link line for libraries says > > -L/foo/bar -lpq > > and it should probably be the other way around (as it is for the > executables). > > So I suspect we need some makefile tuning. You were correct. This patch fixes it. Jim C. Nasby
2005-07-02Teach planner about some cases where a restriction clause can beTom Lane
propagated inside an outer join. In particular, given LEFT JOIN ON (A = B) WHERE A = constant, we cannot conclude that B = constant at the top level (B might be null instead), but we can nonetheless put a restriction B = constant into the quals for B's relation, since no inner-side rows not meeting that condition can contribute to the final result. Similarly, given FULL JOIN USING (J) WHERE J = constant, we can't directly conclude that either input J variable = constant, but it's OK to push such quals into each input rel. Per recent gripe from Kim Bisgaard. Along the way, remove 'valid_everywhere' flag from RestrictInfo, as on closer analysis it was not being used for anything, and was defined backwards anyway.
2005-07-02Improve wrapping of long lines in postgresql.conf.Bruce Momjian
2005-07-02Use on/off consistently for GUC variables in postgresql.conf and theBruce Momjian
documentation, to match SHOW.
2005-07-02Add E'' to internally created SQL strings that contain backslashes.Bruce Momjian
Improve code clarity by using macros for E'' processing.
2005-07-02In PL/PgSQL, allow a block's label to be optionally specified at theNeil Conway
end of the block: <<label>> begin ... end label; Similarly for loops. This is per PL/SQL. Update the documentation and add regression tests. Patch from Pavel Stehule, code review by Neil Conway.
2005-07-01Fix platform-dependency in recently added regression tests.Tom Lane
Per buildfarm results.
2005-07-01Add code to pg_dump to use E'' strings when backslashes are used in dumpBruce Momjian
files.
2005-07-01Avoid function name conflict when plpgsql and rangefuncs regression testsTom Lane
execute in parallel. Spotted by Peter.
2005-07-01Migrate rtree_gist functionality into the core system, and add someTom Lane
basic regression tests for GiST to the standard regression tests. I took the opportunity to add an rtree-equivalent gist opclass for circles; the contrib version only covered boxes and polygons, but indexing circles is very handy for distance searches.
2005-07-01Update to autoconf 2.59 as well as updates of related scriptsPeter Eisentraut
2005-07-01Clarify code to double \\ and '.Bruce Momjian