> > comma).
>
> OK. But the documentation implies there is a comma, so it should probably
> get chenged then.
Yes, it should. (attached)
[ Backpatched to 7.3.X too.]
Rod Taylor
takes two parameters, an OID x and an integer y, and returns "true" with
probability 1/y (the OID argument is ignored). This can be useful -- for
example, it can be used to select a random sampling of the rows in a
table (which is what the "random" regression test uses it for).
This patch removes that function, because it was old and messy. The old
function had the following problems:
- it was undocumented
- it was poorly named
- it was designed to workaround an optimizer bug that no longer exists
(the OID argument is to ensure that the optimizer won't optimize away
calls to the function; AFAIK marking the function as 'volatile' suffices
nowadays)
- it used a different random-number generation technique than the other
PSRNG-related functions in the backend do (it called random() like they
do, but it had its own logic for setting a set and deciding when to
reseed the RNG).
Ok, this patch removes oidrand(), oidsrand(), and userfntest(), and
improves the SGML docs a little bit (un-commenting the setseed()
documentation).
Neil Conway
On Wed, 2003-01-08 at 21:59, Christopher Kings-Lynne wrote:
> I agree. I want to remove OIDs from heaps of our tables when we go to 7.3.
> I'd rather not have to do it in the dump due to down time.
Rod Taylor <rbt@rbt.ca>
> I don't care what you use for short options if all useful ones are taken.
> But the long option should be --schema.
Ok, fair enough: a revised patch is attached that uses the '-n' short
option and the '--schema' long option.
Neil Conway
rid of the assumption that sizeof(Oid)==sizeof(int). This is one small
step towards someday supporting 8-byte OIDs. For the moment, it doesn't
do much except get rid of a lot of unsightly casts.
expression accepted by the regex operators, per discussion yesterday.
Along the way, reduce deadlock_timeout from PGC_POSTMASTER to PGC_SIGHUP
category. It is probably best to insist that all backends share the same
setting, but that doesn't mean it has to be frozen at startup.
(extracted from Tcl 8.4.1 release, as Henry still hasn't got round to
making it a separate library). This solves a performance problem for
multibyte, as well as upgrading our regexp support to match recent Tcl
and nearly match recent Perl.
restriction was debatable to begin with, but it has now become obvious
that it breaks forward-porting of user-defined types; contrib/lo being
the most salient example.
for type 'time without time zone', as we already did for type
'timestamp without time zone'. This patch was proposed by Tom Lockhart
on 7-Nov-02, but he never got around to applying it. Adjust regression
tests and documentation to match.
value of MAX_TIME_PRECISION in floating-point-timestamp-storage case
from 13 to 10, which is as much as time_out is actually willing to print.
(The alternative of increasing the number of digits we are willing to
print looks risky; we might find ourselves printing roundoff garbage.)
passed to join selectivity estimators. Make use of this in eqjoinsel
to derive non-bogus selectivity for IN clauses. Further tweaking of
cost estimation for IN.
initdb forced because of pg_proc.h changes.
necessarily following the JOIN syntax to develop the query plan. The old
behavior is still available by setting GUC variable JOIN_COLLAPSE_LIMIT
to 1. Also create a GUC variable FROM_COLLAPSE_LIMIT to control the
similar decision about when to collapse sub-SELECT lists into their parent
lists. (This behavior existed already, but the limit was always
GEQO_THRESHOLD/2; now it's separately adjustable.)
that's selecting into a RECORD variable returns zero rows, make it
assign an all-nulls row to the RECORD; this is consistent with what
happens when the SELECT INTO target is not a RECORD. In support of
this, tweak the SPI code so that a valid tuple descriptor is returned
even when a SPI select returns no rows.
There are two implementation techniques: the executor understands a new
JOIN_IN jointype, which emits at most one matching row per left-hand row,
or the result of the IN's sub-select can be fed through a DISTINCT filter
and then joined as an ordinary relation.
Along the way, some minor code cleanup in the optimizer; notably, break
out most of the jointree-rearrangement preprocessing in planner.c and
put it in a new file prep/prepjointree.c.
including:
- replacing all the appropriate usages of <citetitle>PostgreSQL
...</citetitle> with &cite-user;, &cite-admin;, and so on
- fix an omission in the EXECUTE documentation
- add some more text to the EXPLAIN documentation
- improve the PL/PgSQL RETURN NEXT documentation (more work to do here)
- minor markup fixes
Neil Conway
containing a volatile function), rather than only on 'Var = Var' clauses
as before. This makes it practical to do flatten_join_alias_vars at the
start of planning, which in turn eliminates a bunch of klugery inside the
planner to deal with alias vars. As a free side effect, we now detect
implied equality of non-Var expressions; for example in
SELECT ... WHERE a.x = b.y and b.y = 42
we will deduce a.x = 42 and use that as a restriction qual on a. Also,
we can remove the restriction introduced 12/5/02 to prevent pullup of
subqueries whose targetlists contain sublinks.
Still TODO: make statistical estimation routines in selfuncs.c and costsize.c
smarter about expressions that are more complex than plain Vars. The need
for this is considerably greater now that we have to be able to estimate
the suitability of merge and hash join techniques on such expressions.
costs for expression evaluation, not only per-tuple cost as before.
This extension is needed in order to deal realistically with hashed or
materialized sub-selects.
>
> I'd suggest that the runtime.sgml description explicitly say "values of
> at least a few thousand are recommended for production installations".
Neil Conway
required if a datatype is to be accepted by GROUP BY, DISTINCT, or
ORDER BY. This is documentation for code changes made pursuant to
pgsql-hackers discussion around 29-Nov-02.
beginning/end of cursor.
Have MOVE return 0/1 depending on cursor position.
Matches SQL spec.
Pass cursor counter from parser as a long rather than int.
Doc updates.
< * Bruce is Bruce Momjian <pgman@candle.pha.pa.us>
< * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au>
< * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net>
> * Bruce is Bruce Momjian <pgman@candle.pha.pa.us> of Software Research Assoc.
> * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au> of
> Family Health Network
> * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net> of The Cain Gang Ltd.
460,461c461,462
< * Fernando Nasser <fnasser@redhat.com>
< * Gavin Sherry <swm@linuxworld.com.au>
> * Fernando Nasser <fnasser@redhat.com> of Red Hat
> * Gavin Sherry <swm@linuxworld.com.au> of Alcove Systems Engineering
464,466c465,467
< * Jan is Jan Wieck <wieck@sapserv.debis.de>
< * Liam is Liam Stewart <liams@redhat.com>
< * Marc is Marc Fournier <scrappy@hub.org>
> * Jan is Jan Wieck <JanWieck@Yahoo.com> of PeerDirect Corp.
> * Liam is Liam Stewart <liams@redhat.com> of Red Hat
> * Marc is Marc Fournier <scrappy@hub.org> of PostgreSQL, Inc.
468,469c469
< * Marko is Marko Kreen <marko@l-t.ee>
< * Michael is Michael Meskes <meskes@postgresql.org>
> * Michael is Michael Meskes <meskes@postgresql.org> of Credativ
472c472
< * Peter M is Peter T Mount <peter@retep.org.uk>
> * Peter M is Peter T Mount <peter@retep.org.uk> of Retep Software
474c474
< * Philip is Philip Warner <pjw@rhyme.com.au>
> * Philip is Philip Warner <pjw@rhyme.com.au> of Albatross Consulting Pty. Ltd.
477d476
< * Ryan is Ryan Bradetich <rbrad@hpb50023.boi.hp.com>
479,483c478,481
< * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp>
< * Thomas is Thomas Lockhart <lockhart@fourpalms.org>
< * Tom is Tom Lane <tgl@sss.pgh.pa.us>
< * TomH is Tom I Helbekkmo <tih@Hamartun.Priv.no>
< * Vadim is Vadim B. Mikheev <vadim4o@email.com>
> * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp> of Software Research Assoc.
> * Thomas is Thomas Lockhart <lockhart@fourpalms.org> of Jet Propulsion Labratory
> * Tom is Tom Lane <tgl@sss.pgh.pa.us> of Red Hat
> * Vadim is Vadim B. Mikheev <vadim4o@email.com> of Sector Data
> I'm not objecting to improving the text. I am objecting to deleting it
> outright...
Ok, fair enough. I've attached a revised version of the patch -- let me
know you think it needs further improvements.
Neil Conway
>
> In pg.py the attributes of DB are defined as being the same as
> the attributes of the corresponding pgobject "db", using the following
...
> The problem is that the attributes of db (which are read only)
> are not static (they are actually function calls to PostgreSQL),
> especially "status" and "error", but those attributes are copied
> and this is done only once when initializing the DB object.
>
> So, in effect, only the attribute "db.error" of a DB instance
> will be updated, but not the attribute "error". Same with "status".
> Don't copy the (read only) attributes of the pgobject to the
> DB object, but only the methods, and all of them, like this:
>
> --------------- change in pg.py ------------------
> # Create convience methods, in a way that is still overridable.
> for e in self.db.__methods__:
> setattr(self, e, getattr(self.db, e))
> ----------------------------------------------------
>
> Furthermore, make an addition to the documentation of the
> DB wrapper class (i.e. in pygresql-pg-db.html):
> After the sentence "All pgobject methods are included in this class also."
> add the following sentence "The pgobject read-only attributes can be
> accessed py adding the prefix 'db.' to them."
Christoph Zwerschke
* Add schema, cast, and conversion backslash commands to psql
I had to create a new publically available function,
pg_conversion_is_visible, as it seemed to be missing from the catalogs.
This required me to do no small amount of hacking around in namespace.c
I have updated the \? help and sgml docs.
\dc - list conversions [PATTERN]
\dC - list casts
\dn list schemas
I didn't support patterns with casts as there's nothing obvious to match
against.
Catalog version incremented --- initdb required.
Christopher Kings-Lynne
make VALUE a non-reserved word again, use less invasive method of passing
ConstraintTestValue into transformExpr, fix problems with nested constraint
testing, do correct thing with NULL result from a constraint expression,
remove memory leak. Domain checks still need much more work if we are going
to allow ALTER DOMAIN, however.
>
> * Wire Protocol Changes
> o Show transaction status in psql
> o Allow binding of query parameters, support for prepared queries
> o Add optional textual message to NOTIFY
> o Remove hard-coded limits on user/db/password names
> o Remove unused elements of startup packet (unused, tty, passlength)
> o Fix COPY/fastpath protocol?
> o Replication support?
> o Error codes
> o Dynamic character set handling
> o Special passing of binary values in platform-neutral format (bytea?)
> o ecpg improvements?
> o Add decoded type, length, precision
documentation and regression test mods. It seemed small and unobtrusive enough
to not require a specific proposal on the hackers list -- but if not, let me
know and I'll make a pitch. Otherwise, if there are no objections please apply.
Joe Conway
-hackers a couple days ago.
Notes/caveats:
- added regression tests for the new functionality, all
regression tests pass on my machine
- added pg_dump support
- updated PL/PgSQL to support per-statement triggers; didn't
look at the other procedural languages.
- there's (even) more code duplication in trigger.c than there
was previously. Any suggestions on how to refactor the
ExecXXXTriggers() functions to reuse more code would be
welcome -- I took a brief look at it, but couldn't see an
easy way to do it (there are several subtly-different
versions of the code in question)
- updated the documentation. I also took the liberty of
removing a big chunk of duplicated syntax documentation in
the Programmer's Guide on triggers, and moving that
information to the CREATE TRIGGER reference page.
- I also included some spelling fixes and similar small
cleanups I noticed while making the changes. If you'd like
me to split those into a separate patch, let me know.
Neil Conway
results due to doing arithmetic on uninitialized values. Add some
documentation about the AT TIME ZONE construct. Update some other
date/time documentation that seemed out of date for 7.3.
database access outside a transaction; revert bogus performance improvement
in SIBackendInit(); improve comments; add documentation (this part courtesy
Neil Conway).
parameter to allow it to be forced off for comparison purposes.
Add ORDER BY clauses to a bunch of regression test queries that will
otherwise produce randomly-ordered output in the new regime.
- CLUSTER ALL clusters all the tables that have some index with
indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
indisclustered set. If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
approach, similar to what VACUUM does.
Alvaro Herrera
before commit, not after :-( --- the original coding is not only unsafe
if an error occurs while it's processing, but it generates an invalid
sequence of WAL entries. Resurrect 7.2 logic for deleting items when
no longer needed. Use an enum instead of random macros. Editorialize
on names used for routines and constants. Teach backend/nodes routines
about new field in CreateTable struct. Add a regression test.
PL/PgSQL. Previously, it had been bundled together with the assign
statement implementation, for some reason that wasn't clear to me
(they certainly don't share any code with one another). So I separated
them and made PERFORM a statement like any other. No changes in
functionality.
Along the way, I added some regression tests for PERFORM, added a
bunch more SGML tags to the PL/PgSQL docs, and removed an obsolete
comment relating to the implementation of RETURN NEXT.
Neil Conway
"traditional" behavior, so the change should be transparent. Use the
command "\pset pager always" to turn it on. Anything else does the
normal toggle between "on" and "off"
Greg Sabino Mullane