Commit Graph

17876 Commits

Author SHA1 Message Date
Bruce Momjian eebad1a74f ECPG preprocessor for PostgreSQL 7.4.1, 7.4.2 doubles const,
volatile, static, and register keywords before variables,
declared as VARCHAR.

Sergey N. Yatskevich
2004-06-11 17:32:39 +00:00
Tom Lane bbf0ebadaf StrategyDirtyBufferList wasn't being careful to honor max_buffers limit.
Bug is only latent given that sole caller is passing NBuffers, but it
could bite someone in the rear someday.
2004-06-11 17:20:39 +00:00
Bruce Momjian 2597056cc3 Use sizeof() rather than strlen() in array size. 2004-06-11 17:09:13 +00:00
Tom Lane e6cba71503 Add some code to Assert that when we release pin on a buffer, we are
not holding the buffer's cntx_lock or io_in_progress_lock.  A recent
report from Litao Wu makes me wonder whether it is ever possible for
us to drop a buffer and forget to release its cntx_lock.  The Assert
does not fire in the regression tests, but that proves little ...
2004-06-11 16:43:24 +00:00
Bruce Momjian 8d64b56206 Cleanup use of Win32 START by using "" for title. No need for temp
batch files anymore.
2004-06-11 16:36:31 +00:00
Bruce Momjian 800910fe97 Add URL about Win32 quoting behavior. 2004-06-11 16:10:09 +00:00
Bruce Momjian eae2a7204f Another fix for Win32 START. 2004-06-11 04:17:21 +00:00
Bruce Momjian 1261fe18ff The attached tiny patch removes spurious carriage returns that might be
copied by the script that generates psql's help. (You can get the
spurious CRs if you use a CVS client on Windows that does line end
translation.)  Elsewhere, the patch should be totally benign.

This removes quite a number of the compile warnings I posted the other
day.

Andrew Dunstan
2004-06-11 03:56:46 +00:00
Bruce Momjian 3a8cdf33aa >> It certainly doesn't. There still was a bug with the locale stuff,
>> though - the GUC variable was not set in the child
>processes. So "show
>> lc_collate" would *always* return "C", for example. attached
>patch fixes
>> this.
>
>Hm.  Why were these vars not propagated by the regular
>mechanism for GUC
>variables (write_nondefault_variables or whatever it's called)?  If the
>problem is that it's not accepting PGC_INTERNAL values, then we need to
>fix it there not here, because otherwise we'll have to pass all the
>PGC_INTERNAL variables through the backend_variables file, which seems
>like a recipe for more of the same sort of bug.


Good point :-(

I think the problem is not only that it specifically does not deal with
PGC_INTERNAL variables. The problem is in the fact that
write_nondefault_variables is called *before* the locale is read
(because the locale is read from pg_control and not from any of the
"usual" ways to read it).

Attached patch is another stab at fixing it. It makes postmaster dump a
new copy of the file once it has started the database (before it accepts
any connections), which is when it will know about these parameters.
Also updates the reading code to set the context to the one where the
variable was originally set (PGC_POSTMASTER won't work for PGC_INTERNAL,
and the other way around).

We still pass lc_collate through the special file, because
set_config_option on lc_collate will speficially *not* call setlocale(),
and we need that call. But we no longer call set_config_option from
there.

Magnus Hagander
2004-06-11 03:54:54 +00:00
Bruce Momjian a28d04e6ee This patch updates pgpipe() on win32 to log exactly which part of the
call fails when it does. (As it is now, there is no way to figure out
the point of error). Shouldn't be a problem since it's most defintily
not a performance-critical path (only called on pgstat startup ATM).

This should help us debug the pipe error message that's on the win32
status page (which I myself have never been able to reproduce, and thus
haven't figured out a better way to debug yet)

Magnus Hagander
2004-06-11 03:48:35 +00:00
Tom Lane 7643bed58e When using extended-query protocol, postpone planning of unnamed statements
until Bind is received, so that actual parameter values are visible to the
planner.  Make use of the parameter values for estimation purposes (but
don't fold them into the actual plan).  This buys back most of the
potential loss of plan quality that ensues from using out-of-line
parameters instead of putting literal values right into the query text.

This patch creates a notion of constant-folding expressions 'for
estimation purposes only', in which case we can be more aggressive than
the normal eval_const_expressions() logic can be.  Right now the only
difference in behavior is inserting bound values for Params, but it will
be interesting to look at other possibilities.  One that we've seen
come up repeatedly is reducing now() and related functions to current
values, so that queries like ... WHERE timestampcol > now() - '1 day'
have some chance of being planned effectively.

Oliver Jowett, with some kibitzing from Tom Lane.
2004-06-11 01:09:22 +00:00
Bruce Momjian 5fe8c7d6e5 More restructuring to use Win32 START with paths needing quotes. 2004-06-11 00:57:25 +00:00
Bruce Momjian 6cc4175b25 Attached is a patch that takes care of the PATHSEP issue. I made a more
extensive change then what was suggested. I found the file path.c that
contained a lot of "Unix/Windows" agnostic functions so I added a function
there instead and removed the PATHSEP declaration in exec.c altogether. All
to keep things from scattering all over the code.

I also took the liberty of changing the name of the functions
"first_path_sep" and "last_path_sep". Where I come from (and I'm apparently
not alone given the former macro name PATHSEP), they should be called
"first_dir_sep" and "last_dir_sep". The new function I introduced, that
actually finds path separators, is now the "first_path_sep". The patch
contains changes on all affected places of course.

I also changed the documentation on dynamic_library_path to reflect the
chagnes.

Thomas Hallgren
2004-06-10 22:26:24 +00:00
Bruce Momjian d4117de50a More quoting cleanups for Win32's pg_ctl. 2004-06-10 22:20:53 +00:00
Tom Lane 3485cc3a7c Adjust cost_nonsequential_access() to have more reasonable behavior
when random_page_cost has a small value.  Per Manfred Koizar, though
I didn't use his equation exactly.
2004-06-10 21:02:00 +00:00
Bruce Momjian 387b38bec4 Done:
> * -Print table names with constraint names in error messages, or make constraint
2004-06-10 19:04:49 +00:00
Tom Lane 36af1dd299 Make ALTER TABLE ADD SERIAL work reasonably in inheritance cases, too. 2004-06-10 18:34:45 +00:00
Tom Lane 6121aed8a5 Fix oversight in recent ALTER TABLE improvements. We now support
ALTER TABLE tab ADD COLUMN col SERIAL, but we forgot to install the
dependency between the column and the sequence, so the sequence
would not go away if you dropped the table later.
2004-06-10 18:25:02 +00:00
Bruce Momjian c9d327b866 Use /B to start so a new window isn't created, per Andrew Dunstan. 2004-06-10 18:02:36 +00:00
Tom Lane 45616f5bbb Clean up generation of default names for constraints, indexes, and serial
sequences, as per recent discussion.  All these names are now of the
form table_column_type, with digits added if needed to make them unique.
Default constraint names are chosen to be unique across their whole schema,
not just within the parent object, so as to be more SQL-spec-compatible
and make the information schema views more useful.
2004-06-10 17:56:03 +00:00
Bruce Momjian 75db5a665f Add START background code for another code path, per Andrew Dunstan. 2004-06-10 17:45:09 +00:00
Bruce Momjian 3a854af433 Use START for pg_ctl background runs on Win32, from Magnus. 2004-06-10 17:26:14 +00:00
Peter Eisentraut 6de9abc359 Translation update 2004-06-10 17:18:14 +00:00
Peter Eisentraut 1159c484b2 New translation 2004-06-10 17:10:24 +00:00
Bruce Momjian 10a3d19ad4 Handle multiple double-quoted strings using Win32's system() call.
Document limitations.
2004-06-10 16:35:18 +00:00
Bruce Momjian 93db6f6ae2 Reword:
< * Allow hash buckets to fill disk pages, rather than being sparse
> * Pack hash index buckets onto disk pages more efficiently
2004-06-10 11:56:27 +00:00
Bruce Momjian 13c30084f6 Add:
> * Allow pg_dump to use multiple -t and -n switches
2004-06-10 04:33:51 +00:00
Bruce Momjian 741681b7b2 Modify:
< * Order heap pointers on hash index pages by hash value and ctid
> * Allow hash buckets to fill disk pages, rather than being sparse
2004-06-10 04:06:21 +00:00
Bruce Momjian c7099997ac Add Brazilian version of FAQ.
Euler Taveira de Oliveira
2004-06-10 03:46:11 +00:00
Bruce Momjian babd02af5a Add:
> * Order heap pointers on hash index pages by hash value and ctid
2004-06-10 03:45:30 +00:00
Bruce Momjian 6d1347b36f Add pg_ctl native language files for Russian.
Serguei A. Mokhov
2004-06-10 02:59:22 +00:00
Bruce Momjian 659660c116 Add regression tests for CSV COPY format. 2004-06-09 23:39:24 +00:00
Tom Lane 337f802460 Fix slightly-wrong syntax error messages from bootstrap parser, as per
report from Tom Cook.
2004-06-09 19:49:56 +00:00
Tom Lane 7e64dbc6b5 Support assignment to subfields of composite columns in UPDATE and INSERT.
As a side effect, cause subscripts in INSERT targetlists to do something
more or less sensible; previously we evaluated such subscripts and then
effectively ignored them.  Another side effect is that UPDATE-ing an
element or slice of an array value that is NULL now produces a non-null
result, namely an array containing just the assigned-to positions.
2004-06-09 19:08:20 +00:00
Bruce Momjian 3a0df651da Use single quotes around pg_dump call from pg_dumpall. 2004-06-09 17:37:28 +00:00
Bruce Momjian dc6c8c2d06 Use single quotes for pg_ctl system call. 2004-06-09 17:36:07 +00:00
Bruce Momjian 7ac67fd189 Add time.h to pg_dumpall. 2004-06-09 17:05:14 +00:00
Bruce Momjian 36b8654cb0 Use mkstemp instead of mktemp in thread test, per Jan. 2004-06-09 15:16:17 +00:00
Bruce Momjian a1ccbb9019 Previous code cleanup was for bufpage.c, not bufmgr.c.
This cleanup just cleans up a comment.
2004-06-09 13:11:34 +00:00
Bruce Momjian 69616f96ec Add:
> * Add ON COMMIT capability to CREATE TABLE AS SELECT
2004-06-09 03:15:51 +00:00
Tom Lane 32af13f03d Add missing check for too-few-inputs when replacing a zero-dimensional
array.
2004-06-08 20:28:21 +00:00
Bruce Momjian 327d86ca99 Fix mingw link check by using double-brackets. 2004-06-08 14:06:35 +00:00
Bruce Momjian ce04221a1e Stylistic changes in bufmgr.c
Basically replaces (*a).b with a->b as it is everywhere else in
	Postgres.

Manfred Koizar
2004-06-08 14:00:35 +00:00
Bruce Momjian 5e926cbb6b vacuum.c refactoring
. rename variables
     . cur_buffer -> dst_buffer
     . ToPage -> dst_page
     . cur_page -> dst_vacpage
   . move variable declarations into block where variable is used
   . various Asserts instead of elog(ERROR, ...)
   . extract functionality from repair_frag() into new routines
     . move_chain_tuple()
     . move_plain_tuple()
     . update_hint_bits()
   . create type ExecContext
   . add comments

Manfred Koizar
2004-06-08 13:59:36 +00:00
Bruce Momjian cd8b0fc5f1 Change PGETC to PGSYSCONFDIR and PGLOCALE to PGLOCALEDIR, per Peter. 2004-06-08 13:49:23 +00:00
Bruce Momjian b2a17038d7 Have strerror_r return "Unknown error". 2004-06-08 01:45:50 +00:00
Bruce Momjian a63d2168e9 Fix strerror_r by checking return type from configure. 2004-06-07 22:39:45 +00:00
Bruce Momjian 9136613803 Add start/stop times for pg_dump/pg_dumpall when verbose output is used. 2004-06-07 20:35:57 +00:00
Teodor Sigaev e25a6e185b Remove asymetrical word processing in query and text 2004-06-07 16:48:18 +00:00
Bruce Momjian 613c684a60 Update date. 2004-06-07 15:11:23 +00:00