Commit Graph

6683 Commits

Author SHA1 Message Date
Tom Lane 473165aff8 For a SQL function declared to return a named composite type, make
sure the tuple datums it returns actually show that type and not RECORD.
2004-07-15 13:51:38 +00:00
Bruce Momjian e47cbb3bad Add has_tablespace_privilege().
Christopher Kings-Lynne
2004-07-12 20:23:59 +00:00
Bruce Momjian a4c71af2c0 Put back canonicalization of PGDATA environment variable. 2004-07-12 19:15:14 +00:00
Bruce Momjian 76e7e2e776 Use strdup in pg_ctl for canonicalize_path on environment variable.
Simplify postmaster call too.
2004-07-12 18:17:13 +00:00
Tom Lane c14a43f657 Remove TABLESPACE option of CREATE SEQUENCE; sequences will now always
live in database or schema's default tablespace, as per today's discussion.
Also, remove some unused keywords from the grammar (PATH, PENDANT,
VERSION), and fix ALSO, which was added as a keyword but not added
to the keyword classification lists, thus making it worse-than-reserved.
2004-07-12 05:38:11 +00:00
Bruce Momjian 298e58cbc4 Fix library_path with canonicalization. 2004-07-12 02:22:51 +00:00
Bruce Momjian 118ec0daa8 Canonicalize preload_libraries after it is split up, not before. 2004-07-12 00:09:07 +00:00
Bruce Momjian 421089dc35 Cleanup for canonicalization fixes, from Tom. 2004-07-11 23:49:51 +00:00
Tom Lane af4de81469 ALTER TABLE SET TABLESPACE. Gavin Sherry, some rework by Tom Lane. 2004-07-11 23:13:58 +00:00
Bruce Momjian 5ff9566686 Remove postgresql.conf of 'info' as a valid client_min_messages level. 2004-07-11 21:48:25 +00:00
Bruce Momjian 7b0f060d54 Use canonicalize_path for -D, GUC paths, and paths coming in from
environment variables.
2004-07-11 21:34:04 +00:00
Tom Lane 8801110b20 Move TablespaceCreateDbspace() call into smgrcreate(), which is where it
probably should have been to begin with; this is to cover cases like
needing to recreate the per-db directory during WAL replay.
Also, fix heap_create to force pg_class.reltablespace to be zero instead
of the database's default tablespace; this makes the world safe for
CREATE DATABASE to handle all tables in the default tablespace alike,
as per previous discussion.  And force pg_class.reltablespace to zero
when creating a relation without physical storage (eg, a view); this
avoids possibly having dangling references in this column after a
subsequent DROP TABLESPACE.
2004-07-11 19:52:52 +00:00
Tom Lane 94d4d240bb Rename XLOG_BTREE_NEWPAGE xlog record type into XLOG_HEAP_NEWPAGE, and
shift support code into heapam.c accordingly.  This is in service of
soon-to-be-committed ALTER TABLE SET TABLESPACE code that will want to
use this same record type for both heaps and indexes.

Theoretically I should have forced initdb for this, but in practice there
is no change in xlog contents because CVS tip will never really emit this
record type anyhow...
2004-07-11 18:01:45 +00:00
Tom Lane c8c40bbc9e Cause the format of BC timestamptz output to be 'datetime zone BC' rather
than 'datetime BC zone', because the former is accepted by the timestamptz
input converter while the latter may not be depending on spacing.  This
is not a loss of compatibility w.r.t. 7.4 and before, because until very
recently there was never a case where we'd output both zone and 'BC'.
2004-07-11 04:57:20 +00:00
Bruce Momjian 130f89e93f Allow configuration files to be placed outside the data directory.
Add new postgresql.conf variables to point to data, pg_hba.conf, and
pg_ident.conf files.

Needs more documentation.
2004-07-11 00:18:45 +00:00
Tom Lane 5dfd5063e2 Defend against overrun of ExtraOptions array --- strictly paranoia,
since the person or script starting the postmaster has to be trusted
anyway.
2004-07-10 23:29:16 +00:00
Tom Lane 82f755ec80 Test HAVING condition before computing targetlist of an Aggregate node.
This is required by SQL spec to avoid failures in cases like
  SELECT sum(win)/sum(lose) FROM ... GROUP BY ... HAVING sum(lose) > 0;
AFAICT we have gotten this wrong since day one.  Kudos to Holger Jakobs
for being the first to notice.
2004-07-10 18:39:23 +00:00
Tom Lane 07b4c48b6a Fix broken logic for pretty-printing parenthesis-suppression in UNION
et al.
2004-07-06 04:50:21 +00:00
Tom Lane ab50ed8f57 Fix unchecked mallocs/strdups added by recent placeholder-config-vars
patch.

Thomas Hallgren
2004-07-05 23:14:14 +00:00
Tom Lane f5c798ee82 Fix no-longer-correct bit-pushing in TransactionIdSetStatus, per Alvaro. 2004-07-03 02:55:56 +00:00
Tom Lane e34082ee3b Add missing operators of the form interval-plus-datetime, as required for
better SQL compliance in this area, per recent discussion.  Mark related
operators as commutators where possible.  (The system doesn't actually care
about commutator marking for operators not returning boolean, at the moment,
but this seems forward-thinking and besides it made it easier to verify
that we hadn't missed any.)
Also, remove interval-minus-time and interval-minus-timetz operators.
I'm not sure how these got in, but they are nonstandard and had very
obviously broken behavior.  (minus is not commutative in anyone's book.)
I doubt anyone had ever used 'em, because we'd surely have gotten a bug
report about it if so.
2004-07-02 22:50:23 +00:00
Joe Conway 0b89d261c7 Andreas Pflug wrote:
From an idea of Bruce, the attached patch implements the function
 pg_tablespace_databases(oid) RETURNS SETOF oid
 which delivers as set of database oids having objects in the selected
 tablespace, enabling an admin to examine only the databases affecting
 the tablespace for objects instead of scanning all of them.

initdb forced
2004-07-02 18:59:25 +00:00
Peter Eisentraut 6d6c8b0d96 Translation update 2004-07-02 15:07:10 +00:00
Tom Lane 25ee160acd More paranoia in AtEOSubXact_SPI: don't assume we can safely use SPI_finish
for cleaning up.  It seems possible that the memory contexts SPI_finish
would try to touch are already gone; and there's no need for SPI itself
to delete them, since the containing contexts will surely be going away
anyway at transaction end.
2004-07-01 21:17:13 +00:00
Tom Lane b6197fe069 Further review of xact.c state machine for nested transactions. Fix
problems with starting subtransactions inside already-failed transactions.
Clean up some comments.
2004-07-01 20:11:03 +00:00
Tom Lane 77a436ba55 Fix seriously nasty memory leak in new TransactionIdIsInProgress code. 2004-07-01 03:13:05 +00:00
Tom Lane 573a71a5da Nested transactions. There is still much left to do, especially on the
performance front, but with feature freeze upon us I think it's time to
drive a stake in the ground and say that this will be in 7.5.

Alvaro Herrera, with some help from Tom Lane.
2004-07-01 00:52:04 +00:00
Tom Lane 04ab0cb5c1 Remove some no-longer-needed #includes. 2004-06-28 01:19:11 +00:00
Tom Lane adc507f242 Fix some bogus code in ConstBit production --- it managed to work, but
only because 14627 still contained the same node that BitWithoutLength had
just produced.  Make it more transparent.  Also adjust ConstCharacter
to be coded the same way for consistency.
2004-06-28 00:18:47 +00:00
Dennis Bjorklund 4eb5f0a8e2 Translation updates 2004-06-27 09:35:14 +00:00
Tom Lane 0ceeb4cbbe Adjust pgstat message definitions so that the target message size is
specified in just one place and adhered to exactly, rather than just more
or less.  A side effect is to increase PGSTAT_ACTIVITY_SIZE (maximum
reported query length) from 256 to nearly 1000.
2004-06-26 16:32:04 +00:00
Dennis Bjorklund ac1cbcc961 Translation updates 2004-06-26 07:03:06 +00:00
Tom Lane 0adfa2c39d Support renaming of tablespaces, and changing the owners of
aggregates, conversions, functions, operators, operator classes,
schemas, types, and tablespaces.  Fold the existing implementations
of alter domain owner and alter database owner in with these.

Christopher Kings-Lynne
2004-06-25 21:55:59 +00:00
Dennis Bjorklund 1621192b11 Translation updates 2004-06-25 17:53:22 +00:00
Tom Lane a0e842d81b Add pg_get_serial_sequence() function, and cause pg_dump to use it.
This eliminates the assumption that a serial column's sequence will
have the same name on reload that it was given in the original database.

Christopher Kings-Lynne
2004-06-25 17:20:29 +00:00
Tom Lane ef2880263c #ifdef out file permissions check on SSL key file when on Windows, as
we also have done for the data directory permissions check.

Dave Page
2004-06-25 15:07:52 +00:00
Tom Lane b15f9b08ef Replace direct fprintf(stderr) calls by write_stderr(), and cause this
routine to do something appropriate on Win32.  Also, add a security check
on Win32 that parallels the can't-run-as-root check on Unix.

Magnus Hagander
2004-06-24 21:03:42 +00:00
Tom Lane 1a76550b3b Fix information schema views to return NULL for precision and scale of
an unconstrained numeric column.  Also, factor out some duplicate code
into functions, to ease future maintenance.
2004-06-22 22:30:32 +00:00
Tom Lane 5ca40c5d31 Add comment about rationale for continuing to use C library functions
instead of src/timezone for timestamping log entries.
2004-06-21 14:12:38 +00:00
Tom Lane f5f448fb3e Rename the built-in tablespaces to pg_default and pg_global, and prohibit
creation of user-defined tablespaces with names starting with 'pg_', as
per suggestion of Chris K-L.  Also install admin-guide tablespace
documentation from Gavin.
2004-06-21 04:06:07 +00:00
Bruce Momjian 483b7f8249 Rename pg_tablespaces directory to pg_tblspc, so it is more unique from
the pg_tablespace table.  Update catalog version.
2004-06-21 01:04:45 +00:00
Tom Lane c1d9dec3e3 Looks like s_lock_test needs <time.h> on some platforms. 2004-06-19 20:31:55 +00:00
Tom Lane 1232878159 s_lock_test requires libpgport to build now. 2004-06-19 19:43:11 +00:00
Tom Lane f0cc132621 Fix oversight in recent rowtype-handling improvements: transformTargetList
should recognize 'foo.*' when the star appears in A_Indirection, not only
in ColumnRef.  This allows 'SELECT something.*' to do what the user
expects when the something is an expression yielding a row.
2004-06-19 18:19:56 +00:00
Tom Lane 2467394ee1 Tablespaces. Alternate database locations are dead, long live tablespaces.
There are various things left to do: contrib dbsize and oid2name modules
need work, and so does the documentation.  Also someone should think about
COMMENT ON TABLESPACE and maybe RENAME TABLESPACE.  Also initlocation is
dead, it just doesn't know it yet.

Gavin Sherry and Tom Lane.
2004-06-18 06:14:31 +00:00
Tom Lane d70a42e642 Represent type-specific length coercion functions as pg_cast entries,
eliminating the former hard-wired convention about their names.  Allow
pg_cast entries to represent both type coercion and length coercion in
a single step --- this is represented by a function that takes an
extra typmod argument, just like a length coercion function.  This
nicely merges the type and length coercion mechanisms into something
at least a little cleaner than we had before.  Make use of the single-
coercion-step behavior to fix integer-to-bit coercion so that coercing
to bit(n) yields the rightmost n bits of the integer instead of the
leftmost n bits.  This should fix recurrent complaints about the odd
behavior of this coercion.  Clean up the documentation of the bit string
functions, and try to put it where people might actually find it.
Also, get rid of the unreliable heuristics in ruleutils.c about whether
to display nested coercion steps; instead require parse_coerce.c to
label them properly in the first place.
2004-06-16 01:27:00 +00:00
Tom Lane bbe42a1514 Arrange to explicitly stop the pgstat processes at the same time we
begin the shutdown checkpoint; there isn't anything left for them to do,
so we may as well ensure that they shut down sooner rather than later.
Per discussion.
2004-06-14 18:08:19 +00:00
Tom Lane 950d047ec5 Give inet/cidr datatypes their own hash function that ignores the inet vs
cidr type bit, the same as network_eq does.  This is needed for hash joins
and hash aggregation to work correctly on these types.  Per bug report
from Michael Fuhr, 2004-04-13.
Also, improve hash function for int8 as suggested by Greg Stark.
2004-06-13 21:57:28 +00:00
Peter Eisentraut c0dff99dbc Translation update 2004-06-13 21:41:33 +00:00
Tom Lane ba0f9ff3ba Code review for recently-added network functions. Get it to work when
log_hostname is enabled, clean up documentation.
2004-06-13 19:56:52 +00:00