summaryrefslogtreecommitdiff
path: root/src/backend/commands/alter.c
Commit message (Collapse)AuthorAgeFilesLines
* Rearrange ALTER TABLE syntax processing as per my recent proposal: theTom Lane2008-06-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | grammar allows ALTER TABLE/INDEX/SEQUENCE/VIEW interchangeably for all subforms of those commands, and then we sort out what's really legal at execution time. This allows the ALTER SEQUENCE/VIEW reference pages to fully document all the ALTER forms available for sequences and views respectively, and eliminates a longstanding cause of confusion for users. The net effect is that the following forms are allowed that weren't before: ALTER SEQUENCE OWNER TO ALTER VIEW ALTER COLUMN SET/DROP DEFAULT ALTER VIEW OWNER TO ALTER VIEW SET SCHEMA (There's no actual functionality gain here, but formerly you had to say ALTER TABLE instead.) Interestingly, the grammar tables actually get smaller, probably because there are fewer special cases to keep track of. I did not disallow using ALTER TABLE for these operations. Perhaps we should, but there's a backwards-compatibility issue if we do; in fact it would break existing pg_dump scripts. I did however tighten up ALTER SEQUENCE and ALTER VIEW to reject non-sequences and non-views in the new cases as well as a couple of cases where they didn't before. The patch doesn't change pg_dump to use the new syntaxes, either.
* Support ALTER TYPE RENAME. Petr JelinekTom Lane2008-03-191-2/+6
|
* Some variants of ALTER OWNER tried to make the "object" field of theTom Lane2008-02-071-5/+5
| | | | | | | | | | statement be a list of bare C strings, rather than String nodes, which is what they need to be for copyfuncs/equalfuncs to work. Fortunately these node types never go out to disk (if they did, we'd likely have noticed the problem sooner), so we can just fix it without creating a need for initdb. This bug has been there since 8.0, but 8.3 exposes it in a more common code path (Parse messages) than prior releases did. Per bug #3940 from Vladimir Kokovic.
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-011-2/+2
|
* Tsearch2 functionality migrates to core. The bulk of this work is byTom Lane2007-08-211-1/+25
| | | | | | | | Oleg Bartunov and Teodor Sigaev, but I did a lot of editorializing, so anything that's broken is probably my fault. Documentation is nonexistent as yet, but let's land the patch so we can get some portability testing done.
* Add ALTER VIEW ... RENAME TO, and a RENAME TO clause to ALTER SEQUENCE.Neil Conway2007-07-031-2/+6
| | | | | | | Sequences and views could previously be renamed using ALTER TABLE, but this was a repeated source of confusion for users. Update the docs, and psql tab completion. Patch from David Fetter; various minor fixes by myself.
* Allow non-superuser database owners to create procedural languages.Tom Lane2007-03-261-1/+5
| | | | | | | | | | A DBA is allowed to create a language in his database if it's marked "tmpldbacreate" in pg_pltemplate. The factory default is that this is set for all standard trusted languages, but of course a superuser may adjust the settings. In service of this, add the long-foreseen owner column to pg_language; renaming, dropping, and altering owner of a PL now follow normal ownership rules instead of being superuser-only. Jeremy Drake, with some editorialization by Tom Lane.
* Add CREATE/ALTER/DROP OPERATOR FAMILY commands, also COMMENT ON OPERATORTom Lane2007-01-231-1/+9
| | | | | | FAMILY; and add FAMILY option to CREATE OPERATOR CLASS to allow adding a class to a pre-existing family. Per previous discussion. Man, what a tedious lot of cutting and pasting ...
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-051-2/+2
| | | | back-stamped for this.
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-141-5/+1
|
* Support the syntaxTom Lane2006-04-151-8/+9
| | | | | | | | | | | | | | CREATE AGGREGATE aggname (input_type) (parameter_list) along with the old syntax where the input type was named in the parameter list. This fits more naturally with the way that the aggregate is identified in DROP AGGREGATE and other utility commands; furthermore it has a natural extension to handle multiple-input aggregates, where the basetype-parameter method would get ugly. In fact, this commit fixes the grammar and all the utility commands to support multiple-input aggregates; but DefineAggregate rejects it because the executor isn't fixed yet. I didn't do anything about treating agg(*) as a zero-input aggregate instead of artificially making it a one-input aggregate, but that should be considered in combination with supporting multi-input aggregates.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-051-2/+2
|
* Revert patch becaues of locking concerns:Bruce Momjian2006-02-121-78/+3
| | | | | | Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME Joachim Wieland
* Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAMEBruce Momjian2006-02-111-3/+78
| | | | Joachim Wieland
* Standard pgindent run for 8.1.Bruce Momjian2005-10-151-9/+9
|
* Add ALTER object SET SCHEMA capability for a limited but useful set ofTom Lane2005-08-011-1/+33
| | | | | | object kinds (tables, functions, types). Documentation is not here yet. Original code by Bernd Helmle, extensive rework by Bruce Momjian and Tom Lane.
* Replace pg_shadow and pg_group by new role-capable catalogs pg_authidTom Lane2005-06-281-10/+6
| | | | | | | | and pg_auth_members. There are still many loose ends to finish in this patch (no documentation, no regression tests, no pg_dump support for instance). But I'm going to commit it now anyway so that Alvaro can make some progress on shared dependencies. The catalog changes should be pretty much done.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-311-2/+2
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Pgindent run for 8.0.Bruce Momjian2004-08-291-3/+3
|
* Update copyright to 2004.Bruce Momjian2004-08-291-2/+2
|
* Code review for ALTER INDEX patch.Tom Lane2004-08-221-1/+3
|
* Support renaming of tablespaces, and changing the owners ofTom Lane2004-06-251-1/+70
| | | | | | | | 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
* Reimplement the linked list data structure used throughout the backend.Neil Conway2004-05-261-2/+4
| | | | | | | | | | | | | | | | In the past, we used a 'Lispy' linked list implementation: a "list" was merely a pointer to the head node of the list. The problem with that design is that it makes lappend() and length() linear time. This patch fixes that problem (and others) by maintaining a count of the list length and a pointer to the tail node along with each head node pointer. A "list" is now a pointer to a structure containing some meta-data about the list; the head and tail pointers in that structure refer to ListCell structures that maintain the actual linked list of nodes. The function names of the list API have also been changed to, I hope, be more logically consistent. By default, the old function names are still available; they will be disabled-by-default once the rest of the tree has been updated to use the new API names.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-291-1/+1
|
* pgindent run.Bruce Momjian2003-08-041-41/+41
|
* Adjust 'permission denied' messages to be more useful and consistent.Tom Lane2003-08-011-2/+2
|
* Error message editing in backend/libpq, backend/postmaster, backend/tcop.Tom Lane2003-07-221-32/+3
| | | | | Along the way, fix some logic problems in pgstat_initstats, notably the bogus assumption that malloc returns zeroed memory.
* Another round of error message editing, covering backend/commands/.Tom Lane2003-07-201-6/+9
|
* First batch of object rename commands.Peter Eisentraut2003-06-271-0/+159