summaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.c
AgeCommit message (Collapse)Author
2002-06-20Update copyright to 2002.Bruce Momjian
2002-06-20Improve COPY syntax to use WITH clause, keep backward compatibility.Bruce Momjian
2002-06-18Change CREATE DATABASE to use DefElem instead of constructing structureBruce Momjian
members in gram.y. This is the prefered method for WITH and arbitrary param/value pairs.
2002-05-25AlterDatabaseSet() forgot to update the indexes on pg_database.Tom Lane
2002-05-21Remove global variable scanCommandId in favor of storing a command IDTom Lane
in snapshots, per my proposal of a few days ago. Also, tweak heapam.c routines (heap_insert, heap_update, heap_delete, heap_mark4update) to be passed the command ID to use, instead of doing GetCurrentCommandID. For catalog updates they'll still get passed current command ID, but for updates generated from the main executor they'll get passed the command ID saved in the snapshot the query is using. This should fix some corner cases associated with functions and triggers that advance current command ID while an outer query is still in progress.
2002-05-20Restructure indexscan API (index_beginscan, index_getnext) perTom Lane
yesterday's proposal to pghackers. Also remove unnecessary parameters to heap_beginscan, heap_rescan. I modified pg_proc.h to reflect the new numbers of parameters for the AM interface routines, but did not force an initdb because nothing actually looks at those fields.
2002-05-17Merge the last few variable.c configuration variables into the genericTom Lane
GUC support. It's now possible to set datestyle, timezone, and client_encoding from postgresql.conf and per-database or per-user settings. Also, implement rollback of SET commands that occur in a transaction that later fails. Create a SET LOCAL var = value syntax that sets the variable only for the duration of the current transaction. All per previous discussions in pghackers.
2002-04-27Support toasting of shared system relations, and provide toast tables forTom Lane
pg_database, pg_shadow, pg_group, all of which now have potentially-long fields. Along the way, get rid of SharedSystemRelationNames list: shared rels are now identified in their include/pg_catalog/*.h files by a BKI_SHARED_RELATION macro, while indexes and toast rels inherit sharedness automatically from their parent table. Fix some bugs with failure to detoast pg_group.grolist during ALTER GROUP.
2002-04-21Restructure AclItem representation so that we can have more than eightTom Lane
different privilege bits (might as well make use of the space we were wasting on padding). EXECUTE and USAGE bits for procedures, languages now are separate privileges instead of being overlaid on SELECT. Add privileges for namespaces and databases. The GRANT and REVOKE commands work for these object types, but we don't actually enforce the privileges yet...
2002-04-11Make sure that usesuper is always accessed through superuser(), so that thePeter Eisentraut
single-user escape path always works.
2002-03-06Change made to elog:Bruce Momjian
o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
2002-03-01User and database-specific session defaults for run-time configurationPeter Eisentraut
variables. New commands ALTER DATABASE ... SET and ALTER USER ... SET.
2002-02-24Add OWNER option to CREATE DATABASE, so superusers can create databasesTom Lane
on behalf of unprivileged users. Also, make '=' optional in CREATE DATABASE syntax. From Gavin Sherry, with kibitzing and docs by Tom Lane.
2002-02-23Guard against createdb --location=PGDATA foo; without this, the codeTom Lane
tries to create a symlink pointing at itself. Per trouble report from Kenneth McDowell.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-09-06Commit Karel's patch.Tatsuo Ishii
------------------------------------------------------------------- Subject: Re: [PATCHES] encoding names From: Karel Zak <[email protected]> To: Peter Eisentraut <[email protected]> Cc: pgsql-patches <[email protected]> Date: Fri, 31 Aug 2001 17:24:38 +0200 On Thu, Aug 30, 2001 at 01:30:40AM +0200, Peter Eisentraut wrote: > > - convert encoding 'name' to 'id' > > I thought we decided not to add functions returning "new" names until we > know exactly what the new names should be, and pending schema Ok, the patch not to add functions. > better > > ...(): encoding name too long Fixed. I found new bug in command/variable.c in parse_client_encoding(), nobody probably never see this error: if (pg_set_client_encoding(encoding)) { elog(ERROR, "Conversion between %s and %s is not supported", value, GetDatabaseEncodingName()); } because pg_set_client_encoding() returns -1 for error and 0 as true. It's fixed too. IMHO it can be apply. Karel PS: * following files are renamed: src/utils/mb/Unicode/KOI8_to_utf8.map --> src/utils/mb/Unicode/koi8r_to_utf8.map src/utils/mb/Unicode/WIN_to_utf8.map --> src/utils/mb/Unicode/win1251_to_utf8.map src/utils/mb/Unicode/utf8_to_KOI8.map --> src/utils/mb/Unicode/utf8_to_koi8r.map src/utils/mb/Unicode/utf8_to_WIN.map --> src/utils/mb/Unicode/utf8_to_win1251.map * new file: src/utils/mb/encname.c * removed file: src/utils/mb/common.c -- Karel Zak <[email protected]> http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
2001-08-26Transaction IDs wrap around, per my proposal of 13-Aug-01. MoreTom Lane
documentation to come, but the code is all here. initdb forced.
2001-08-10Make OIDs optional, per discussions in pghackers. WITH OIDS is still theTom Lane
default, but OIDS are removed from many system catalogs that don't need them. Some interesting side effects: TOAST pointers are 20 bytes not 32 now; pg_description has a three-column key instead of one. Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey has some usefulness; pg_dump dumps comments on indexes, rules, and triggers in a valid order. initdb forced.
2001-08-04Fix handling of SIGCHLD, per recent pghackers discussion: on someTom Lane
platforms system(2) gets confused unless the signal handler is set to SIG_DFL, not SIG_IGN. pgstats.c now uses pqsignal() as it should, not signal(). Also, arrange for the stats collector process to show a reasonable ID in 'ps', rather than looking like a postmaster.
2001-07-02First non-stub implementation of shared free space map. It's not superTom Lane
useful as yet, since its primary source of information is (full) VACUUM, which makes a concerted effort to get rid of free space before telling the map about it ... next stop is concurrent VACUUM ...
2001-06-12Clean up various to-do items associated with system indexes:Tom Lane
pg_database now has unique indexes on oid and on datname. pg_shadow now has unique indexes on usename and on usesysid. pg_am now has unique index on oid. pg_opclass now has unique index on oid. pg_amproc now has unique index on amid+amopclaid+amprocnum. Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache. Remove index on pg_listener and associated syscache for performance reasons (caching rows that are certain to change before you need 'em again is rather pointless). Change pg_attrdef's nonunique index on adrelid into a unique index on adrelid+adnum. Fix various incorrect settings of pg_class.relisshared, make that the primary reference point for whether a relation is shared or not. IsSharedSystemRelationName() is now only consulted to initialize relisshared during initial creation of tables and indexes. In theory we might now support shared user relations, though it's not clear how one would get entries for them into pg_class &etc of multiple databases. Fix recently reported bug that pg_attribute rows created for an index all have the same OID. (Proof that non-unique OID doesn't matter unless it's actually used to do lookups ;-)) There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap relations. Convert them into plain system catalogs without hardwired entries in pg_class and friends. Unify global.bki and template1.bki into a single init script postgres.bki, since the alleged distinction between them was misleading and pointless. Not to mention that it didn't work for setting up indexes on shared system relations. Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do). Also, hold locks until transaction commit where necessary.
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-23Fix all the places that called heap_update() and heap_delete() withoutTom Lane
bothering to check the return value --- which meant that in case the update or delete failed because of a concurrent update, you'd not find out about it, except by observing later that the transaction produced the wrong outcome. There are now subroutines simple_heap_update and simple_heap_delete that should be used anyplace that you're not prepared to do the full nine yards of coping with concurrent updates. In practice, that seems to mean absolutely everywhere but the executor, because *noplace* else was checking.
2001-01-14Need to do BufferSync at end of DROP DATABASE as well as CREATE DATABASE.Tom Lane
Otherwise, newly connecting backends will still think the deleted DB is valid, and will generate unexpected error messages.
2000-11-30No more #ifdef XLOG.Vadim B. Mikheev
2000-11-18Put back BufferSync() for WAL after database creation.Tom Lane
Also, add some comments about what it's for...
2000-11-16Change SearchSysCache coding conventions so that a reference count isTom Lane
maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
2000-11-14Extend CREATE DATABASE to allow selection of a template database to beTom Lane
cloned, rather than always cloning template1. Modify initdb to generate two identical databases rather than one, template0 and template1. Connections to template0 are disallowed, so that it will always remain in its virgin as-initdb'd state. pg_dumpall now dumps databases with restore commands that say CREATE DATABASE foo WITH TEMPLATE = template0. This allows proper behavior when there is user-added data in template1. initdb forced!
2000-11-12Keep track of the last active slot in the shared ProcState array, soTom Lane
that search loops only have to scan that far and not through all maxBackends entries. This eliminates a performance penalty for setting maxBackends much higher than the average number of active backends. Also, eliminate no-longer-used 'backend tag' concept. Remove setting of environment variables at backend start (except for CYR_RECODE), since none of them are being examined by the backend any longer.
2000-11-08Clean up compiler warnings.Tom Lane
2000-11-08Reimplement alternative database locations with symlinks. No changes inPeter Eisentraut
user interface.
2000-10-28WALVadim B. Mikheev
2000-10-22Add new datlastsysoid to pg_database.Philip Warner
This field stores the last allocated OID after the database was created. Used by pg_dump in deciding what is user-defined vs. system-defined.
2000-10-16New file naming. Database OID is used as "tablespace" id andVadim B. Mikheev
relation OID is used as file node on creation but may be changed later if required. Regression Tests Approved (c) -:)))
2000-09-06Code cleanup of user name and user id handling in the backend. The currentPeter Eisentraut
user is now defined in terms of the user id, the user name is only computed upon request (for display purposes). This is kind of the opposite of the previous state, which would maintain the user name and compute the user id for permission checks. Besides perhaps saving a few cycles (integer vs string), this now creates a single point of attack for changing the user id during a connection, for purposes of "setuid" functions, etc.
2000-08-03More functions updated to new fmgr style --- money, name, tid datatypes.Tom Lane
We're reaching the mopup stage here (good thing too, this is getting tedious).
2000-07-05Update textin() and textout() to new fmgr style. This is just phaseTom Lane
one of updating the whole text datatype, but there are so dang many calls of these two routines that it seems worth a separate commit.
2000-06-02If create/drop database are going to call closeAllVfds(), they oughtTom Lane
to do it at the last moment before calling system() ... not at some randomly-chosen earlier point in the routine ...
2000-05-30Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian
2000-05-28First round of changes for new fmgr interface. fmgr itself and theTom Lane
key call sites are changed, but most called functions are still oldstyle. An exception is that the PL managers are updated (so, for example, NULL handling now behaves as expected in plperl and plpgsql functions). NOTE initdb is forced due to added column in pg_proc.
2000-05-25On solaris, createdb/dropdb fails because of strange behavior of system().Tatsuo Ishii
(it returns error with errno ECHILD upon successful completion of commands). This fix ignores an error from system() if errno == ECHILD.
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-03-26Updated user's guide to match new psql's output formatPeter Eisentraut
Fixed bug in createdb/alternative location
2000-03-15Remove gratuitous and incorrect begin/commit transaction calls inTom Lane
CREATE DB/DROP DB. If you didn't think they were wrong, try what happens when you compile with -DCLOBBER_FREED_MEMORY --- database name displayed in error messages is trashed, because transaction abort freed it. Also, remove trailing periods in error messages, per our prevailing style.
2000-01-26Add:Bruce Momjian
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
2000-01-13Fixed everything in and surrounding createdb and dropdb to make it morePeter Eisentraut
error-proof. Rearranged some old code and removed dead sections.
1999-12-20Clean up some minor gcc warnings.Tom Lane
1999-12-12Meanwhile, database names with single quotes in names don't work very wellBruce Momjian
at all, and because of shell quoting rules this can't be fixed, so I put in error messages to that end. Also, calling create or drop database in a transaction block is not so good either, because the file system mysteriously refuses to roll back rm calls on transaction aborts. :) So I put in checks to see if a transaction is in progress and signal an error. Also I put the whole call in a transaction of its own to be able to roll back changes to pg_database in case the file system operations fail. The alternative location issues I posted recently were untouched, awaiting the outcome of that discussion. Other than that, this should be much more fool-proof now. The docs I cleaned up as well. Peter Eisentraut Sernanders väg 10:115
1999-12-10Rename several destroy* functions/tags to drop*.Bruce Momjian