Commit Graph

20913 Commits

Author SHA1 Message Date
Bruce Momjian 97bb6e89be Fix LRU/ALL description mismatch for GUC parameter. 2005-08-19 18:58:18 +00:00
Bruce Momjian 0c7786bdfc Consistently align comments in postgresql.conf, move some slightly to
the right to stand out.
2005-08-19 01:55:18 +00:00
Tom Lane 77b4bd3b43 Update some obsolete comments --- code is using t_self now, not t_ctid. 2005-08-18 21:34:20 +00:00
Tom Lane dfdf07aab1 Fix up LIMIT/OFFSET planning so that we cope with non-constant LIMIT
or OFFSET clauses by using estimate_expression_value().  The main advantage
of this is that if the expression is a Param and we have a value for the
Param, we'll use that value rather than defaulting.  Also, fix some
thinkos in the logic for combining LIMIT/OFFSET with an externally
supplied tuple fraction (this covers cases like EXISTS(...LIMIT...)).
And make sure the results of all this are shown by EXPLAIN.  Per a
gripe from Merlin Moncure.
2005-08-18 17:51:12 +00:00
Bruce Momjian 96f63aebc8 Add:
> 	o Remove unnecessary abstractions in pg_dump source code
2005-08-18 14:14:31 +00:00
Bruce Momjian 7be1b3ba74 Add hint for to_char(interval) invalid format specifications. 2005-08-18 13:43:08 +00:00
Bruce Momjian a11fe54507 Done:
> * -Prevent to_char() on interval from returning meaningless values
2005-08-18 04:42:41 +00:00
Bruce Momjian e20261128d Fix to_char(interval) to return proper year and century values.
Fix to_char(interval) to return large year/month/day/hour values that
are larger than possible timestamp values.
Prevent to_char(interval) format specifications that make no sense, like
Month.
Clean up formatting.c code to more logically handle return lengths.
2005-08-18 04:37:08 +00:00
Tom Lane f8d0a82bf9 Avoid an Assert failure if OuterUserId hasn't been set yet during
AbortTransaction.  This can happen if a backend's InitPostgres transaction
fails (eg, because the given username is invalid).  Per Alvaro.
2005-08-17 22:14:34 +00:00
Bruce Momjian 63f850cd4d More formatting.c cleanups. 2005-08-17 22:06:53 +00:00
Bruce Momjian 9cd3fb172d Small cleanup. 2005-08-17 21:54:50 +00:00
Bruce Momjian 420fc28ac5 Adjust to_char/from_char code to use boolean "is_to_char" rather than
integer with flags.
2005-08-17 21:47:55 +00:00
Tom Lane cb6a08c9b3 Remove unnecessary configure test for inet_ntop(), per Andrew Dunstan. 2005-08-17 20:20:10 +00:00
Tom Lane ff15b3dac5 Fix declaration of dumpacl, per Alvaro. 2005-08-17 19:45:51 +00:00
Bruce Momjian 28d0515d18 Fix FSM warning to mention increasing max_fsm_pages. Was incorrectly
max_fsm_relations.
2005-08-17 03:50:59 +00:00
Bruce Momjian 26b9dcb640 Minor cleanup. 2005-08-17 01:45:20 +00:00
Bruce Momjian e19e382804 Update comments. 2005-08-16 19:29:38 +00:00
Bruce Momjian e7fb5563af Improve comment. 2005-08-16 19:23:31 +00:00
Bruce Momjian f2ad4cadbf Update pgcvslog comment on how to find branch start time.
Run autoconf/autoheader in case someone forgot in the past.
2005-08-16 17:46:57 +00:00
Tom Lane 6629bc79f1 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.
2005-08-16 00:48:12 +00:00
Bruce Momjian 070a3ad76b Rename pg_stat_file columns to be more consistent. Split apart change
and creation columns to behave for Unix or Win32.
2005-08-15 23:00:14 +00:00
Tom Lane 24bd9447ac Clean up recent patch for PL handler functions in pg_catalog: the patch
caused PL languages and handlers to be dumped ALWAYS, even in the face
of contrary --schema or --table switches.  Adopt a slightly saner
definition.
2005-08-15 21:50:15 +00:00
Tom Lane 9a9328003d Make createlang and droplang proof against weird search_path settings
by forcing search_path to be just pg_catalog.
2005-08-15 21:02:26 +00:00
Tom Lane 866ffc2fe3 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.
2005-08-15 19:40:20 +00:00
Tom Lane e6a30121be 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.
2005-08-15 19:05:16 +00:00
Tom Lane 87808aef05 Allow the pgstat views to show toast tables as well as regular tables
(the stats system has always collected this info, but the views were
filtering it out).  Modify autovacuum so that over-threshold activity
in a toast table can trigger a VACUUM of the parent table, even if the
parent didn't appear to need vacuuming itself.  Per discussion a month
or so back about "short, wide tables".
2005-08-15 16:25:19 +00:00
Tom Lane 2498d8296e Clean up some stray remaining references to pg_shadow, pg_user, pg_group. 2005-08-15 02:40:36 +00:00
Tom Lane f590ed12f6 Change pg_dump to use pg_roles instead of pg_user on 8.1 and up,
so that it will correctly dump owners of objects owned by non-login roles.
2005-08-15 02:36:30 +00:00
Tom Lane 840b7f5205 Update administrator's guide chapters for ROLEs patch. 2005-08-14 23:35:38 +00:00
Peter Eisentraut bf86bacb2c Change standard_compliant_strings to standard_conforming_strings. 2005-08-14 22:19:50 +00:00
Tom Lane 8ae0d476a9 Update the createuser utility for the ROLEs world. Alvaro Herrera 2005-08-14 20:16:03 +00:00
Tom Lane e36de18191 Fix psql's \d commands to use pg_roles instead of pg_user, so that
they don't miss owners that are NOLOGIN.
2005-08-14 19:20:45 +00:00
Tom Lane 84ccf7212c Fix up tab completion for ROLEs and add some more completion logic for
other stuff; change \du and \dg to be role-aware (Stefan Kaltenbrunner).
Also make tab completion fetch the list of GUC variables from pg_settings
instead of having a hard-wired copy of the list (Tom Lane).
2005-08-14 18:49:30 +00:00
Tom Lane f60d176a5e Tweak catalog cache management algorithms to reduce cost of
SearchCatCacheList and ReleaseCatCacheList.  Previously, we incremented
and decremented the refcounts of list member tuples along with the list
itself, but that's unnecessary, and very expensive when the list is big.
It's cheaper to change only the list refcount.  When we are considering
deleting a cache entry, we have to check not only its own refcount but
its parent list's ... but it's easy to arrange the code so that this
check is not made in any commonly-used paths, so the cost is really nil.
The bigger gain though is to refrain from DLMoveToFront'ing each individual
member tuple each time the list is referenced.  To keep some semblance
of fair space management, lists are just marked as used or not since the
last cache cleanout search, and we do a MoveToFront pass only when about
to run a cleanout.  In combination, these changes reduce the costs of
SearchCatCacheList and ReleaseCatCacheList from about 4.5% of pgbench
runtime to under 1%, according to my gprof results.
2005-08-13 22:18:07 +00:00
Tom Lane 2af9a44fa9 Make pg_stat_file() use OUT parameters so that the user doesn't have to
remember the output parameter set for himself.  It's a bit of a kluge
but fixing array_in to work in bootstrap mode looks worse.
I removed the separate pg_file_length() function, as it no longer has any
real notational advantage --- you can write (pg_stat_file(...)).length.
2005-08-13 19:02:34 +00:00
Bruce Momjian f547909db7 Remove API file.
Marko Kreen
2005-08-13 15:27:41 +00:00
Bruce Momjian 03be45fbe6 CREATE TABLE has optional column names, so change {} to [].
Alvaro.
2005-08-13 02:48:18 +00:00
Bruce Momjian 87688ddf87 The large one adds support for RSA keys and reorganizes
the pubkey functions a bit.  The actual RSA-specific code
there is tiny, most of the patch consists of reorg of the
pubkey code, as lots of it was written as elgamal-only.

---------------------------------------------------------------------------

The SHLIB section was copy-pasted from somewhere and contains
several unnecessary libs.  This cleans it up a bit.

 -lcrypt
   we don't use system crypt()

 -lssl, -lssleay32
   no SSL here

 -lz in win32 section
   already added on previous line

 -ldes
   The chance anybody has it is pretty low.
   And the chance pgcrypto works with it is even lower.

Also trim the win32 section.

---------------------------------------------------------------------------

It is already disabled in Makefile, remove code too.

---------------------------------------------------------------------------

I was bit hasty making the random exponent 'k' a prime.  Further researh
shows that Elgamal encryption has no specific needs in respect to k,
any random number is fine.

It is bit different for signing, there it needs to be 'relatively prime'
to p - 1,  that means GCD(k, p-1) == 1, which is also a lot lighter than
full primality.  As we don't do signing, this can be ignored.

This brings major speedup to Elgamal encryption.

---------------------------------------------------------------------------

o  pgp_mpi_free: Accept NULLs
o  pgp_mpi_cksum: result should be 16bit
o  Remove function name from error messages - to be similar to other
   SQL functions, and it does not match anyway the called function
o  remove couple junk lines

---------------------------------------------------------------------------

o  Support for RSA encryption
o  Big reorg to better separate generic and algorithm-specific code.
o  Regression tests for RSA.

---------------------------------------------------------------------------

o  Tom stuck a CVS id into file.  I doubt the usefulness of it,
   but if it needs to be in the file then rather at the end.
   Also tag it as comment for asciidoc.
o  Mention bytea vs. text difference
o  Couple clarifications

---------------------------------------------------------------------------

There is a choice whether to update it with pgp functions or
remove it.  I decided to remove it, updating is pointless.

I've tried to keep the core of pgcrypto relatively independent
from main PostgreSQL, to make it easy to use externally if needed,
and that is good.  Eg. that made development of PGP functions much
nicer.

But I have no plans to release it as generic library, so keeping such
doc
up-to-date is waste of time.  If anyone is interested in using it in
other products, he can probably bother to read the source too.

Commented source is another thing - I'll try to make another pass
over code to see if there is anything non-obvious that would need
more comments.

---------------------------------------------------------------------------

Marko Kreen
2005-08-13 02:06:21 +00:00
Bruce Momjian abecf1afc2 Add documentation:
>>>I think a more accurate description would be "permissions not
>>>inherited by children," and that isn't necessarily a bug.
>>
>>I agree it may not be a bug - but it's more than the permissions not
>>being inherited: the parent is affected.
>
>
> Not really, once you understand what's happening.  Unless you use
> FROM ONLY, selecting from the parent selects from the parent *and*
> its children.  The parent itself isn't affected, as queries with
> FROM ONLY should demonstrate.  I understand what you're saying --
> that there's an apparent effect on the parent -- but there really
> isn't.

Sean Burlington
2005-08-13 01:55:41 +00:00
Bruce Momjian f810cfb291 Disable strtoul() ERANGE check on Win32, because it isn't thread safe,
and it isn't really required.
2005-08-13 01:34:30 +00:00
Bruce Momjian 27639809d2 Reverse out Assert addition. 2005-08-12 23:13:54 +00:00
Tom Lane 59c016aa9f Pass the type OID as the typioparam for all non-array types, rather than
only composite types as we did in 8.0.  Per discussion with Martijn
van Oosterhout.
2005-08-12 21:49:47 +00:00
Bruce Momjian bb2ffe9acf Back out plpython makefile change. 2005-08-12 21:44:51 +00:00
Bruce Momjian fab177e64f Improve documention on loading large data sets into plperl.
David Fetter
2005-08-12 21:42:53 +00:00
Bruce Momjian ed63689b43 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
2005-08-12 21:36:59 +00:00
Tom Lane 65790b9e01 Un-break plperl for non-set case. 2005-08-12 21:26:32 +00:00
Bruce Momjian 7d781c62b1 [ 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
2005-08-12 21:23:10 +00:00
Bruce Momjian 479a8fd69e > Gavin Sherry <swm@linuxworld.com.au> writes:
> > I ran across this yesterday on HEAD:
>
> > template1=# grant select on foo, foo to swm;
> > ERROR:  tuple already updated by self
>
> Seems to fail similarly in every version back to 7.2; probably further,
> but that's all I have running at the moment.
>
> > We could do away with the error by producing a unique list of object names
> > -- but that would impose an extra cost on the common case.
>
> CommandCounterIncrement in the GRANT loop would be easier, likely.
> I'm having a hard time getting excited about it though...

Yeah, its not that exciting but that error message would throw your
average user.

I've attached a patch which calls CommandCounterIncrement() in each of the
grant loops.

Gavin Sherry
2005-08-12 21:20:24 +00:00
Bruce Momjian abc8a0a0fe More rsi assignment line too. 2005-08-12 21:09:34 +00:00
Tom Lane 0d1ebe0194 Fix up canonicalize_path to do the right thing in all cases (I think ...
this was harder than it seemed at first glance).  Also push code for
checking for ".." in file names into path.c where it belongs.
2005-08-12 21:07:53 +00:00