Teodor Sigaev [Thu, 15 Sep 2005 11:56:58 +0000 (11:56 +0000)]
Update Snowball. I have to update it because of
old version doesn't available on Snowball's site and new version
of stemmers can't be compiled with old interface.
Tom Lane [Mon, 12 Sep 2005 22:20:30 +0000 (22:20 +0000)]
Ensure that any memory leaked during an error inside the bgwriter is
recovered. I did not see any actual leak while testing this in CVS tip,
but 8.0 definitely has a problem with leaking the space temporarily
palloc'd by BufferSync(). In any case this seems a good idea to forestall
similar problems in future. Per report from Arjen van der Meijden.
Neil Conway [Mon, 12 Sep 2005 18:49:08 +0000 (18:49 +0000)]
Fix a mistake in the documentation for SPI_getbinval(), per Michael Fuhr.
Michael Meskes [Mon, 12 Sep 2005 11:58:33 +0000 (11:58 +0000)]
Fixed transaction command handling to not ignore savepoints and to correctly check for errors.
Tom Lane [Sun, 11 Sep 2005 00:36:35 +0000 (00:36 +0000)]
Avoid changing stdin/stdout to binary mode on Windows unless that is
really the source or destination of the archive. I think this will
resolve recent complaints that password prompting is broken in pg_restore
on Windows. Note that password prompting and reading from stdin is an
unworkable combination on Windows ... but that was true anyway.
Tom Lane [Thu, 8 Sep 2005 16:49:18 +0000 (16:49 +0000)]
Update regression tests for new USA timezone data. Mea culpa for not
realizing that the regression tests could be affected.
Tom Lane [Wed, 7 Sep 2005 21:39:41 +0000 (21:39 +0000)]
Update timezone data files to release 2005m of the zic database.
Among other changes, this reflects the recently passed change in USA
daylight savings rules.
Peter Eisentraut [Sat, 3 Sep 2005 07:41:58 +0000 (07:41 +0000)]
Translation update
Teodor Sigaev [Tue, 30 Aug 2005 07:57:48 +0000 (07:57 +0000)]
Fix missing rows in query
update a=.. where a... with GiST index on column 'a'
Tom Lane [Mon, 29 Aug 2005 00:41:44 +0000 (00:41 +0000)]
Sigh, looks like you need '.set mips2' before you can access MIPS
SYNC instruction.
Tom Lane [Sun, 28 Aug 2005 18:26:07 +0000 (18:26 +0000)]
Add a SYNC instruction to the S_UNLOCK sequence for MIPS.
Tom Lane [Sat, 27 Aug 2005 16:22:58 +0000 (16:22 +0000)]
Get the MIPS assembler syntax right. Also add a separate sync command;
the reference I consulted yesterday said SC does a SYNC, but apparently
this is not true on newer MIPS processors, so be safe.
Bruce Momjian [Sat, 27 Aug 2005 14:13:31 +0000 (14:13 +0000)]
Fix typo:
sql_information_info -> sql_implementation_info
Robert Treat
Tom Lane [Fri, 26 Aug 2005 22:04:53 +0000 (22:04 +0000)]
Another try at the inlined MIPS spinlock code. Can't test this myself,
but for sure it's not any more broken than the prior version.
Tom Lane [Fri, 26 Aug 2005 14:48:13 +0000 (14:48 +0000)]
Back-port recent MIPS and M68K spinlock improvements to 8.0 branch.
Tom Lane [Thu, 25 Aug 2005 19:45:06 +0000 (19:45 +0000)]
Back-patch fixes for problems with VACUUM destroying t_ctid chains too soon,
and with insufficient paranoia in code that follows t_ctid links.
This patch covers the 8.0 branch.
Michael Meskes [Wed, 24 Aug 2005 10:35:12 +0000 (10:35 +0000)]
- Check for NULL before checking whether argument is an array.
- Removed stray character from string quoting.
- Fixed check to report missing varchar pointer implementation.
Tom Lane [Tue, 23 Aug 2005 13:31:19 +0000 (13:31 +0000)]
Fix broken lrand48() implementation, per Merlin Moncure.
Tom Lane [Sat, 20 Aug 2005 19:19:31 +0000 (19:19 +0000)]
Invoke mksafefunc and mkunsafefunc with :: decoration. This seems a good
idea on consistency grounds, whether or not it really fixes bug #1831.
Michael Fuhr
Tom Lane [Wed, 17 Aug 2005 20:20:22 +0000 (20:20 +0000)]
Remove unnecessary configure test for inet_ntop(), per Andrew Dunstan.
Tom Lane [Tue, 16 Aug 2005 00:48:29 +0000 (00:48 +0000)]
Reject operator names >= NAMEDATALEN characters. These will not work
anyway, and in assert-enabled builds you are likely to get an assertion
failure. Backpatch as far as 7.3; 7.2 seems not to have the problem.
Tom Lane [Mon, 15 Aug 2005 19:40:43 +0000 (19:40 +0000)]
array_in() and array_recv() need to be more paranoid about validating
their OID parameter. It was possible to crash the backend with
select array_in('{123}',0,0); because that would bypass the needed step
of initializing the workspace. These seem to be the only two places
with a problem, though (record_in and record_recv don't have the issue,
and the other array functions aren't depending on user-supplied input).
Back-patch as far as 7.4; 7.3 does not have the bug.
Tom Lane [Mon, 15 Aug 2005 19:05:30 +0000 (19:05 +0000)]
int_array_enum function should be using fcinfo->flinfo->fn_extra for
working state, not fcinfo->context. Silly oversight on my part in last
go-round of fixes.
Bruce Momjian [Fri, 12 Aug 2005 21:38:00 +0000 (21:38 +0000)]
This patch fixes the event type used to log output from the
stderr-in-service or output-from-syslogger-in-service code. Previously
everything was flagged as ERRORs there, which caused all instances to
log "LOG: logger shutting down" as error...
Please apply for 8.1. I'd also like it considered for 8.0 since logging
non-errors as errors can be cause for alarm amongst people who actually
look at their logs...
Magnus Hagander
Bruce Momjian [Fri, 12 Aug 2005 21:23:18 +0000 (21:23 +0000)]
[ backpatched to 8.0.X.]
> >> 3) I restarted the postmaster both times. I got this error
> both times.
> >> :25: ERROR: could not load library "C:/Program
> >> Files/PostgreSQL/8.0/lib/testtrigfuncs.dll": dynamic load error
>
> > Yes. We really need to look at fixing that error message. I had
> > forgotten it completely :-(
>
> > Bruce, you think we can sneak that in after feature freeze? I would
> > call it a bugfix :-)
>
> Me too. That's been on the radar for awhile --- please do
> send in a patch.
Here we go, that wasn't too hard :-)
Apart from adding the error handling, it does one more thing: it changes
the errormode when loading the DLLs. Previously if a DLL was broken, or
referenced other DLLs that couldn't be found, a popup dialog box would
appear on the screen. Which had to be clicked before the backend could
continue. This patch also disables the popup error message for DLL
loads.
I think this is something we should consider doing for the entire
backend - disable those popups, and say we deal with it ourselves. What
do you other win32 hackers thinnk about this?
In the meantime, this patch fixes the error msgs. Please apply for 8.1
and please consider a backpatch to 8.0.
Magnus Hagander
Bruce Momjian [Fri, 12 Aug 2005 00:29:22 +0000 (00:29 +0000)]
Backpatch fseeko fix for seeking from end of file.
Bruce Momjian [Thu, 11 Aug 2005 13:54:10 +0000 (13:54 +0000)]
Backpatch new CVS home page URL.
Tom Lane [Mon, 8 Aug 2005 23:39:14 +0000 (23:39 +0000)]
Fix crash when reading 'timezone = unknown' from postgresql.conf during
SIGHUP; it's not OK for an assign_hook to return a non-malloc'd string.
Problem was introduced during timezone library rewrite.
Tom Lane [Sun, 7 Aug 2005 18:47:38 +0000 (18:47 +0000)]
Fix count_usable_fds() to stop trying to open files once it reaches
max_files_per_process. Going further than that is just a waste of
cycles, and it seems that current Cygwin does not cope gracefully
with deliberately running the system out of FDs. Per Andrew Dunstan.
Tom Lane [Tue, 2 Aug 2005 15:14:56 +0000 (15:14 +0000)]
rmtree() reported the wrong pathname if final rmdir failed.
Tom Lane [Tue, 2 Aug 2005 01:35:23 +0000 (01:35 +0000)]
Back-port several small portability fixes to get contrib building
cleanly on AIX in the 8.0 branch. Rocco Altier
Bruce Momjian [Sat, 30 Jul 2005 03:39:40 +0000 (03:39 +0000)]
Update AIX FAQ.
Chris Browne
Tom Lane [Fri, 29 Jul 2005 21:40:26 +0000 (21:40 +0000)]
Back-patch fix for NOT-below-a-NOT case.
Neil Conway [Wed, 27 Jul 2005 05:15:03 +0000 (05:15 +0000)]
Avoid crashing pg_dump if we can't connect to the database server, and
no database has been explicitly specified. Per gripe from Omar Kilani.
Tom Lane [Fri, 22 Jul 2005 19:12:33 +0000 (19:12 +0000)]
Fix compare_fuzzy_path_costs() to behave a bit more sanely. The original
coding would ignore startup cost differences of less than 1% of the
estimated total cost; which was OK for normal planning but highly not OK
if a very small LIMIT was applied afterwards, so that startup cost becomes
the name of the game. Instead, compare startup and total costs fuzzily
but independently. This changes the plan selected for two queries in the
regression tests; adjust expected-output files for resulting changes in
row order. Per reports from Dawid Kuroczko and Sam Mason.
Tom Lane [Mon, 18 Jul 2005 21:37:23 +0000 (21:37 +0000)]
It appears that Darwin (OS X) does not cope well with C functions that
have the same name as the containing shared library --- as best I can
tell, the compiler internally creates a function of that name, and does
not warn you about the conflict. Fix buildfarm failure in back branches
by renaming tsearch() trigger function at the C level.
Tom Lane [Mon, 18 Jul 2005 19:18:19 +0000 (19:18 +0000)]
Back-patch fix for erroneous backslashing of LIKE pattern.
Tom Lane [Mon, 18 Jul 2005 15:53:46 +0000 (15:53 +0000)]
MemSet() must not cast its pointer argument to int32* until after it has
checked that the pointer is actually word-aligned. Casting a non-aligned
pointer to int32* is technically illegal per the C spec, and some recent
versions of gcc actually generate bad code for the memset() when given
such a pointer. Per report from Andrew Morrow.
Tom Lane [Sun, 17 Jul 2005 18:29:13 +0000 (18:29 +0000)]
Make pg_regress accept a command-line option for the temporary installation's
port number, and use a default value for it that is dependent on the
configuration-time DEF_PGPORT. Should make the world safe for running
parallel 'make check' in different branches. Back-patch as far as 7.4
so that this actually is useful.
Tom Lane [Sun, 17 Jul 2005 04:05:49 +0000 (04:05 +0000)]
Back-patch recent changes to alter the order of -L flags inserted from
LDFLAGS versus those built into the Makefiles. This looks like it will
fix several buildfarm failures in the back branches.
Tom Lane [Fri, 15 Jul 2005 18:40:20 +0000 (18:40 +0000)]
Check for out-of-range varoattno in deparse_context_for_subplan.
I have seen this case in CVS tip due to new "physical tlist" optimization
for subqueries. I believe it probably can't happen in existing releases,
but the check is not going to hurt anything, so backpatch to 8.0 just
in case.
Tom Lane [Fri, 15 Jul 2005 17:09:50 +0000 (17:09 +0000)]
Fix overenthusiastic optimization of 'x IN (SELECT DISTINCT ...)' and related
cases: we can't just consider whether the subquery's output is unique on its
own terms, we have to check whether the set of output columns we are going to
use will be unique. Per complaint from Luca Pireddu and test case from
Michael Fuhr.
Tom Lane [Wed, 13 Jul 2005 15:26:06 +0000 (15:26 +0000)]
Fix libpq memory leak during PQreset() --- closePGconn() was not
freeing all transient state of the PGconn object.
Tom Lane [Fri, 8 Jul 2005 18:41:55 +0000 (18:41 +0000)]
Fix config file lexer to not barf if postgresql.conf ends with a comment
that has no terminating newline. Per report from maps.on at gmx.net.
Tom Lane [Fri, 8 Jul 2005 15:24:53 +0000 (15:24 +0000)]
Make libpq_gettext save and restore errno in a Windows-compatible way.
Also, back-patch fix into back branches.
Bruce Momjian [Mon, 4 Jul 2005 14:42:39 +0000 (14:42 +0000)]
Backpatch to 8.0.X openssl portability fixes to pgcrypto.
Bruce Momjian [Mon, 4 Jul 2005 14:12:45 +0000 (14:12 +0000)]
Fix date_trunct for December dates that are in the next year, e.g.:
SELECT date_trunc('week', '2002-12-31'::date);
Backpatch to 8.0.X.
Per report from Nick Johnson.
Tom Lane [Sun, 3 Jul 2005 21:56:27 +0000 (21:56 +0000)]
Fix memory leak in plperl_hash_from_tuple(), per report from Jean-Max Reymond.
Tom Lane [Mon, 27 Jun 2005 02:18:14 +0000 (02:18 +0000)]
Modify pg_dump to assume that a check constraint is inherited if its
name matches the name of any parent-table constraint, without looking
at the constraint text. This is a not-very-bulletproof workaround for
the problem exhibited by Berend Tober last month. We really ought to
record constraint inheritance status in pg_constraint, but it's looking
like that may not get done for 8.1 --- and even if it does, we will
need this kluge for dumping from older servers.
Tom Lane [Sat, 25 Jun 2005 22:47:49 +0000 (22:47 +0000)]
Force a checkpoint before committing a CREATE DATABASE command. This
should fix the recent reports of "index is not a btree" failures,
as well as preventing a more obscure race condition involving changes
to a template database just after copying it with CREATE DATABASE.
Tom Lane [Sat, 25 Jun 2005 16:54:00 +0000 (16:54 +0000)]
Fix ancient memory leak in index_create(): RelationInitIndexAccessInfo
was being called twice in normal operation, leading to a leak of one set
of relcache subsidiary info. Per report from Jeff Gold.
Neil Conway [Wed, 22 Jun 2005 02:02:09 +0000 (02:02 +0000)]
Correct some code in pg_restore when reading the header of a tar archive:
(1) The code doesn't initialize `sum', so the initial "does the checksum
match?" test is wrong.
(2) The loop that is intended to check for a "null block" just checks
the first byte of the tar block 512 times, rather than each of the
512 bytes one time (!), which I'm guessing was the intent.
It was only through sheer luck that this worked in the first place.
Per Coverity static analysis performed by EnterpriseDB.
Neil Conway [Tue, 21 Jun 2005 01:23:25 +0000 (01:23 +0000)]
Fix a potential backend crash during authentication when parsing a
malformed ident map file. This was introduced by the linked list
rewrite in 8.0 -- mea maxima culpa.
Per Coverity static analysis performed by EnterpriseDB.
Tom Lane [Mon, 20 Jun 2005 22:51:49 +0000 (22:51 +0000)]
exec_eval_datum leaks memory when dealing with ROW or REC values.
It never leaked memory before PG 8.0, so none of the callers are
expecting this. Cleanest fix seems to be to make it allocate the needed
memory in estate->eval_econtext, where it will be cleaned up by
the next exec_eval_cleanup. Per report from Bill Rugolsky.
Tom Lane [Mon, 20 Jun 2005 20:44:50 +0000 (20:44 +0000)]
plpgsql's exec_assign_value() freed the old value of a variable before
copying/converting the new value, which meant that it failed badly on
"var := var" if var is of pass-by-reference type. Fix this and a similar
hazard in exec_move_row(); not sure that the latter can manifest before
8.0, but patch it all the way back anyway. Per report from Dave Chapeskie.
Tom Lane [Sat, 18 Jun 2005 20:51:44 +0000 (20:51 +0000)]
When using C-string lookup keys in a dynahash.c hash table, use strncpy()
not memcpy() to copy the offered key into the hash table during HASH_ENTER.
This avoids possible core dump if the passed key is located very near the
end of memory. Per report from Stefan Kaltenbrunner.
Bruce Momjian [Fri, 17 Jun 2005 16:46:45 +0000 (16:46 +0000)]
NetBSD uses "options" not "option".
Peter Eisentraut [Fri, 17 Jun 2005 11:42:02 +0000 (11:42 +0000)]
Translation updates
Tom Lane [Tue, 14 Jun 2005 14:21:23 +0000 (14:21 +0000)]
The random selection in function linear() could deliver a value equal to max
if geqo_rand() returns exactly 1.0, resulting in failure due to indexing
off the end of the pool array. Also, since this is using inexact float math,
it seems wise to guard against roundoff error producing values slightly
outside the expected range. Per report from bug@zedware.org.
Tatsuo Ishii [Sat, 11 Jun 2005 02:46:16 +0000 (02:46 +0000)]
Fix bug in MIC -> EUC_JP conversion. Per Atsushi Ogawa.
Tom Lane [Thu, 9 Jun 2005 19:08:36 +0000 (19:08 +0000)]
Repair error in description of nonblocking usage of PQgetCopyData().
Per Volkan Yazici.
Tom Lane [Tue, 7 Jun 2005 14:05:01 +0000 (14:05 +0000)]
Use just NULL not NULL::TEXT --- the latter coding is unnecessary and
not schema-safe. Per report from Jochem van Dieten.
branch-fixup [Mon, 6 Jun 2005 16:30:42 +0000 (16:30 +0000)]
Add files from parent branch HEAD:
doc/src/FAQ/FAQ_hungarian.html
Bruce Momjian [Mon, 6 Jun 2005 16:30:42 +0000 (16:30 +0000)]
Update Hungarian FAQ and add an HTML version.
Laszlo Hornyak
Tom Lane [Mon, 6 Jun 2005 16:29:01 +0000 (16:29 +0000)]
Trivial markup improvement.
Tom Lane [Mon, 6 Jun 2005 04:13:36 +0000 (04:13 +0000)]
Nab some low-hanging fruit: replace the planner's base_rel_list and
other_rel_list with a single array indexed by rangetable index.
This reduces find_base_rel from O(N) to O(1) without any real penalty.
While find_base_rel isn't one of the major bottlenecks in any profile
I've seen so far, it was starting to creep up on the radar screen
for complex queries --- so might as well fix it.
Tom Lane [Sun, 5 Jun 2005 22:32:58 +0000 (22:32 +0000)]
Remove planner's private fields from Query struct, and put them into
a new PlannerInfo struct, which is passed around instead of the bare
Query in all the planning code. This commit is essentially just a
code-beautification exercise, but it does open the door to making
larger changes to the planner data structures without having to muck
with the widely-known Query struct.
Bruce Momjian [Sun, 5 Jun 2005 03:39:54 +0000 (03:39 +0000)]
Add description for backend termination:
< cleaned up properly. A new signal is needed for safe termination.
> cleaned up properly. A new signal is needed for safe termination
> because backends must first do a query cancel, then exit once they
> have run the query cancel cleanup routine.
Bruce Momjian [Sun, 5 Jun 2005 03:16:42 +0000 (03:16 +0000)]
Here's a patch to do the following:
1. Rename spi_return_next to return_next.
2. Add a new test for return_next.
3. Update the expected output.
4. Update the documentation.
Abhijit Menon-Sen
Tom Lane [Sun, 5 Jun 2005 01:49:06 +0000 (01:49 +0000)]
Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
prepared for HAVE_INT64_TIMESTAMP. Per report from Guillaume Beaudoin.
Bruce Momjian [Sun, 5 Jun 2005 00:46:13 +0000 (00:46 +0000)]
Add 2phase TODO.detail.
Bruce Momjian [Sun, 5 Jun 2005 00:45:22 +0000 (00:45 +0000)]
Add TODO.detail for 2phase commit:
> * Add two-phase commit [2phase]
Tom Lane [Sun, 5 Jun 2005 00:38:11 +0000 (00:38 +0000)]
Replace the parser's namespace tree (which formerly had the same
representation as the jointree) with two lists of RTEs, one showing
the RTEs accessible by qualified names, and the other showing the RTEs
accessible by unqualified names. I think this is conceptually simpler
than what we did before, and it's sure a whole lot easier to search.
This seems to eliminate the parse-time bottleneck for deeply nested
JOIN structures that was exhibited by phil@vodafone.
Bruce Momjian [Sun, 5 Jun 2005 00:28:36 +0000 (00:28 +0000)]
Add TODO.detail.
< logs
> logs [pitr]
130c130
< * Allow a warm standby system to also allow read-only queries
> * Allow a warm standby system to also allow read-only queries [pitr]
Bruce Momjian [Sun, 5 Jun 2005 00:22:35 +0000 (00:22 +0000)]
Remove duplicate emails.
Bruce Momjian [Sun, 5 Jun 2005 00:20:02 +0000 (00:20 +0000)]
Add TODO.detail for timezone:
< information, either zone name or offset from UTC
> information, either zone name or offset from UTC [timezone]
Bruce Momjian [Sun, 5 Jun 2005 00:18:42 +0000 (00:18 +0000)]
Add TODO.detail of standard timezone data type.
Bruce Momjian [Sat, 4 Jun 2005 23:33:17 +0000 (23:33 +0000)]
Add pg_upgrade TODO.detail.
Bruce Momjian [Sat, 4 Jun 2005 23:32:34 +0000 (23:32 +0000)]
Add TODO.detail:
> * Allow major upgrades without dump/reload, perhaps using pg_upgrade
> [pg_upgrade]
Bruce Momjian [Sat, 4 Jun 2005 23:07:15 +0000 (23:07 +0000)]
Add pg_dump TODO.detail for multiple -t / -n flags.
Bruce Momjian [Sat, 4 Jun 2005 23:06:29 +0000 (23:06 +0000)]
Add pg_dump to TODO.detail.
Bruce Momjian [Sat, 4 Jun 2005 22:57:22 +0000 (22:57 +0000)]
Back out patch:
---------------------------------------------------------------------------
Tom Lane <tgl@sss.pgh.pa.us> writes:
> a_ogawa <a_ogawa@hi-ho.ne.jp> writes:
> > It is a reasonable idea. However, the majority part of MemSet was not
> > able to be avoided by this idea. Because the per-tuple contexts are used
> > at the early stage of executor.
>
> Drat. Well, what about changing that? We could introduce additional
> contexts or change the startup behavior so that the ones that are
> frequently reset don't have any data in them unless you are working
> with pass-by-ref values inside the inner loop.
That might be possible. However, I think that we should change only
aset.c about this article.
I thought further: We can check whether context was used from the last
reset even when blocks list is not empty. Please see attached patch.
Bruce Momjian [Sat, 4 Jun 2005 20:56:13 +0000 (20:56 +0000)]
Add comment for multi-byte computation.
Bruce Momjian [Sat, 4 Jun 2005 20:42:43 +0000 (20:42 +0000)]
Allow kerberos name and username case sensitivity to be specified from
postgresql.conf.
---------------------------------------------------------------------------
Here's an updated version of the patch, with the following changes:
1) No longer uses "service name" as "application version". It's instead
hardcoded as "postgres". It could be argued that this part should be
backpatched to 8.0, but it doesn't make a big difference until you can
start changing it with GUC / connection parameters. This change only
affects kerberos 5, not 4.
2) Now downcases kerberos usernames when the client is running on win32.
3) Adds guc option for "krb_caseins_users" to make the server ignore
case mismatch which is required by some KDCs such as Active Directory.
Off by default, per discussion with Tom. This change only affects
kerberos 5, not 4.
4) Updated so it doesn't conflict with the rendevouz/bonjour patch
already in ;-)
Magnus Hagander
Bruce Momjian [Sat, 4 Jun 2005 20:33:06 +0000 (20:33 +0000)]
At 2005-05-21 20:18:50 +0530, ams@oryx.com wrote:
>
> > The second issue is where plperl returns a large result set.
I have attached the following seven patches to address this problem:
1. Trivial. Replaces some errant spaces with tabs.
2. Trivial. Fixes the spelling of Jan's name, and gets rid of many
inane, useless, annoying, and often misleading comments. Here's
a sample: "plperl_init_all() - Initialize all".
(I have tried to add some useful comments here and there, and will
continue to do so now and again.)
3. Trivial. Splits up some long lines.
4. Converts SRFs in PL/Perl to use a Tuplestore and SFRM_Materialize
to return the result set, based on the PL/PgSQL model.
There are two major consequences: result sets will spill to disk when
they can no longer fit in work_mem; and "select foo_srf()" no longer
works. (I didn't lose sleep over the latter, since that form is not
valid in PL/PgSQL, and it's not documented in PL/Perl.)
5. Trivial, but important. Fixes use of "undef" instead of undef. This
would cause empty functions to fail in bizarre ways. I suspect that
there's still another (old) bug here. I'll investigate further.
6. Moves the majority of (4) out into a new plperl_return_next()
function, to make it possible to expose the functionality to
Perl; cleans up some of the code besides.
7. Add an spi_return_next function for use in Perl code.
If you want to apply the patches and try them out, 8-composite.diff is
what you should use. (Note: my patches depend upon Andrew's use-strict
and %_SHARED patches being applied.)
Here's something to try:
create or replace function foo() returns setof record as $$
$i = 0;
for ("World", "PostgreSQL", "PL/Perl") {
spi_return_next({f1=>++$i, f2=>'Hello', f3=>$_});
}
return;
$$ language plperl;
select * from foo() as (f1 integer, f2 text, f3 text);
(Many thanks to Andrews Dunstan and Supernews for their help.)
Abhijit Menon-Sen
Bruce Momjian [Sat, 4 Jun 2005 20:14:12 +0000 (20:14 +0000)]
Tom Lane <tgl@sss.pgh.pa.us> writes:
> a_ogawa <a_ogawa@hi-ho.ne.jp> writes:
> > It is a reasonable idea. However, the majority part of MemSet was not
> > able to be avoided by this idea. Because the per-tuple contexts are used
> > at the early stage of executor.
>
> Drat. Well, what about changing that? We could introduce additional
> contexts or change the startup behavior so that the ones that are
> frequently reset don't have any data in them unless you are working
> with pass-by-ref values inside the inner loop.
That might be possible. However, I think that we should change only
aset.c about this article.
I thought further: We can check whether context was used from the last
reset even when blocks list is not empty. Please see attached patch.
The effect of the patch that I measured is as follows:
o Execution time that executed the SQL ten times.
(1)Linux(CPU: Pentium III, Compiler option: -O2)
- original: 24.960s
- patched : 23.114s
(2)Linux(CPU: Pentium 4, Compiler option: -O2)
- original: 8.730s
- patched : 7.962s
(3)Solaris(CPU: Ultra SPARC III, Compiler option: -O2)
- original: 37.0s
- patched : 33.7s
Atsushi Ogawa (a_ogawa)
Tom Lane [Sat, 4 Jun 2005 19:19:42 +0000 (19:19 +0000)]
Change expandRTE() and ResolveNew() back to taking just the single
RTE of interest, rather than the whole rangetable list. This makes
the API more understandable and avoids duplicate RTE lookups. This
patch reverts no-longer-needed portions of my patch of 2004-08-19.
Bruce Momjian [Sat, 4 Jun 2005 18:20:43 +0000 (18:20 +0000)]
Back out make_mkid change.
Bruce Momjian [Sat, 4 Jun 2005 18:13:59 +0000 (18:13 +0000)]
Improve readability of config location params by adding newline.
Bruce Momjian [Sat, 4 Jun 2005 18:12:38 +0000 (18:12 +0000)]
Add:
> * Allow pg_ctl to work properly with configuration files located outside
> the PGDATA directory
>
> pg_ctl can not read the pid file because it isn't located in the
> config directory but in the PGDATA directory. The solution is to
> allow pg_ctl to read and understand postgresql.conf to find the
> data_directory value.
>
Bruce Momjian [Sat, 4 Jun 2005 16:53:48 +0000 (16:53 +0000)]
Add description:
>
> O_DIRECT doesn't have the same media write guarantees as fsync, so it
> is in addition to the fsync method, not in place of it.
>
Bruce Momjian [Sat, 4 Jun 2005 14:12:50 +0000 (14:12 +0000)]
Fix NUMERIC modulus to properly truncate division in computation.
Division rounding was causing incorrect results. Test case:
test=> SELECT
12345678901234567890 % 123;
?column?
----------
78
(1 row)
Was returning -45.
Bruce Momjian [Sat, 4 Jun 2005 03:33:25 +0000 (03:33 +0000)]
Update Chinese FAQ to fix XHTML format.
Weiping (Laser)
Neil Conway [Sat, 4 Jun 2005 02:07:09 +0000 (02:07 +0000)]
Remove unused 'printCost' field from ExplainState, and simplify the code
accordingly (this field was always initialized to true). Patch from
Alvaro Herrera.
Tom Lane [Fri, 3 Jun 2005 23:05:30 +0000 (23:05 +0000)]
Revise handling of dropped columns in JOIN alias lists to avoid a
performance problem pointed out by phil@vodafone: to wit, we were
spending O(N^2) time to check dropped-ness in an N-deep join tree,
even in the case where the tree was freshly constructed and couldn't
possibly mention any dropped columns. Instead of recursing in
get_rte_attribute_is_dropped(), change the data structure definition:
the joinaliasvars list of a JOIN RTE must have a NULL Const instead
of a Var at any position that references a now-dropped column. This
costs nothing during normal parse-rewrite-plan path, and instead we
have a linear-time update to make when loading a stored rule that
might contain now-dropped columns. While at it, move the responsibility
for acquring locks on relations referenced by rules into this separate
function (which I therefore chose to call AcquireRewriteLocks).
This saves effort --- namely, duplicated lock grabs in parser and rewriter
--- in the normal path at a cost of one extra non-locked heap_open()
in the stored-rule path; seems a good tradeoff. A fringe benefit is
that it is now *much* clearer that we acquire lock on relations referenced
in rules before we make any rewriter decisions based on their properties.
(I don't know of any bug of that ilk, but it wasn't exactly clear before.)
Bruce Momjian [Fri, 3 Jun 2005 21:46:02 +0000 (21:46 +0000)]
Put back WAL TODO.detail entries.
Bruce Momjian [Fri, 3 Jun 2005 21:42:21 +0000 (21:42 +0000)]
Remove because it is partly done and we might not want to go farther:
< * -Compress WAL entries [wal]
Tom Lane [Fri, 3 Jun 2005 19:00:12 +0000 (19:00 +0000)]
Just noticed that you can't Query-Cancel a long planner run, because
no part of the planner did CHECK_FOR_INTERRUPTS(). Add one in a
suitably strategic spot.
Bruce Momjian [Fri, 3 Jun 2005 18:17:07 +0000 (18:17 +0000)]
Update Russian FAQ.
Viktor Vislobokov
Bruce Momjian [Fri, 3 Jun 2005 17:14:17 +0000 (17:14 +0000)]
Trim TODO.detail for wal completed items.