Commit Graph

2384 Commits

Author SHA1 Message Date
Tom Lane 188c7c8ccf Add ALTER TABLE ENABLE/DISABLE TRIGGER commands. Change pg_dump to
use these instead of its previous hack of changing pg_class.reltriggers.
Documentation is lacking, will add that later.
Patch by Satoshi Nagayasu, review and some extra work by Tom Lane.
2005-08-23 22:40:47 +00:00
Tom Lane 83357da684 Cause ALTER INDEX OWNER to generate a warning and do nothing, rather than
erroring out as it has done for the last couple weeks.  Document that this
form is now ignored because indexes can't usefully have different owners
from their parent tables.  Fix pg_dump to not generate ALTER OWNER commands
for indexes.
2005-08-22 19:40:37 +00:00
Tom Lane f88e8070b7 Use an initdb-time test to see if the local version of getaddrinfo()
chokes on IPv6 addresses, and comment out the IPv6 entry in the default
pg_hba.conf if so.  Per Andrew Dunstan.
2005-08-22 16:27:36 +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 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 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 721e53785d Solve the problem of OID collisions by probing for duplicate OIDs
whenever we generate a new OID.  This prevents occasional duplicate-OID
errors that can otherwise occur once the OID counter has wrapped around.
Duplicate relfilenode values are also checked for when creating new
physical files.  Per my recent proposal.
2005-08-12 01:36:05 +00:00
Tom Lane cbd015d718 Extend pg_config to be able to report the build-time values of CC,
CPPFLAGS, CFLAGS, CFLAGS_SL, LDFLAGS, LDFLAGS_SL, and LIBS.  Change it
so that invoking pg_config with no arguments reports all available
information, rather than just giving an error message.  Per discussion.
2005-08-09 22:47:03 +00:00
Tom Lane 74888b9349 Add ERROR_NO_MORE_FILES workaround to check_data_dir(). This may or
may not be obsolete, but since every other readdir loop in our code
has it, I think this should too.
2005-08-02 15:16:27 +00:00
Tom Lane d42cf5a42a Add per-user and per-database connection limit options.
This patch also includes preliminary update of pg_dumpall for roles.
Petr Jelinek, with review by Bruce Momjian and Tom Lane.
2005-07-31 17:19:22 +00:00
Bruce Momjian 1f54d43075 Add GUC variables to control keep-alive times for idle, interval, and
count.

Oliver Jowett
2005-07-30 15:17:26 +00:00
Bruce Momjian 85e9a5a014 Move reindexdb from /contrib to /bin.
Euler Taveira de Oliveira
2005-07-29 15:13:11 +00:00
Bruce Momjian ef85f5fabc Add tab completion syntax for PREPARE 2-phase commit syntax.
There's no tab-completion for "PREPARE TRANSACTION 'xxx'" since that
would be ambigous with "PREPARE xxx AS xx".

Heikki Linnakangas
2005-07-28 22:14:30 +00:00
Neil Conway a4c75ece82 Fix a few macro definitions to ensure that unary minus is enclosed in
parentheses. This avoids possible operator precedence problems, and
is consistent with most of the macro definitions in the tree.
2005-07-27 12:44:10 +00:00
Neil Conway a43bbe34ff Avoid crashing pg_dump if we can't connect to the database server, and
no database has been explicitly specified. Per gripe from Omar Kilani.
2005-07-27 05:14:12 +00:00
Bruce Momjian f5df006a04 Add username for psql password prompt, if the username was specified.
Adrian Maier
2005-07-25 17:17:41 +00:00
Tom Lane 4a2972d691 Awhile back we replaced all uses of strcasecmp and strncasecmp with
pg_strcasecmp and pg_strncasecmp ... but I see some of the former have
crept back in.
Eternal vigilance is the price of locale independence, apparently.
2005-07-25 04:52:32 +00:00
Tom Lane d007a95055 Simple constraint exclusion. For now, only child tables of inheritance
scans are candidates for exclusion; this should be fixed eventually.
Simon Riggs, with some help from Tom Lane.
2005-07-23 21:05:48 +00:00
Bruce Momjian 507465525e \pset numericsep -> numericlocale. 2005-07-18 20:57:53 +00:00
Bruce Momjian 71d0cabecd Fix len so decimal length is only added when a period appears in the output. 2005-07-18 19:27:37 +00:00
Tom Lane affcb4371c Avoid use of E'', and thereby creating an unnecessary version-dependency,
by using LIKE...ESCAPE instead.  Per suggestion by andrew@supernews.
2005-07-18 19:12:09 +00:00
Tom Lane fdd84469f7 Avoid need for E'' construct by using regexp instead of LIKE. More
readable, and more like the other places in this file.
2005-07-18 19:09:09 +00:00
Bruce Momjian adeede1391 Fix numiericsep length computations.
Eugen Nedelcu
2005-07-18 18:58:45 +00:00
Tom Lane df38d799ea Adjust psql describe queries so that any pg_foo_is_visible() condition
is applied last, after other constraints such as name patterns.  This
is useful first because the pg_foo_is_visible() functions are relatively
expensive, and second because it minimizes the prospects for race
conditions.  The change is fragile though since it makes unwarranted
assumptions about planner behavior, ie, that WHERE clauses will be
executed in the original order if there's not reason to change it.
This should fix ... or at least hide ... an intermittent failure in the
prepared_xacts regression test, while we think about what else to do.
2005-07-18 17:40:14 +00:00
Bruce Momjian bd15782164 Enable multi-byte thousands_sep and decimal_point for numericsep. 2005-07-14 21:12:41 +00:00
Bruce Momjian fbc11b9dcf Make better thousands_sep default based on decimal marker value. 2005-07-14 15:54:21 +00:00
Bruce Momjian 45a19efa9e Change numericsep to a boolean, and make it locale-aware. 2005-07-14 08:42:37 +00:00
Bruce Momjian 4a8bbbd2ee Add numeric separator support for latex and troff output methods. 2005-07-14 07:32:01 +00:00
Bruce Momjian 52d1d2e67c barebones variable name -> tuples_only, for consistency. 2005-07-14 06:49:58 +00:00
Bruce Momjian cff9c5748a Fix malloc length for new numeric separator patch.
Centralize malloc into function.
2005-07-14 06:46:17 +00:00
Bruce Momjian e8a3e6b8a0 Rename xmalloc to pg_malloc for consistency with psql usage.
Add missing plperl include.
2005-07-10 16:13:13 +00:00
Bruce Momjian f86c63ab6a Reverse pg_malloc patch because psql/print.c is used in scripts files
that don't have pg_malloc.
2005-07-10 15:53:42 +00:00
Bruce Momjian 8c9393c640 Use failure-safe pg_malloc consistently in psql/print.c. 2005-07-10 15:48:14 +00:00
Bruce Momjian d1cffe2f77 Add --encoding to pg_dump.
The Problem:  Occassionally a DBA needs to dump a database to a new
encoding.   In instances where the current encoding, (or lack of an
encoding, like SQL_ASCII) is poorly supported on the target  database
server, it can be useful to dump into a particular  encoding.  But,
currently the only way to set the encoding of  a pg_dump file is to
change  client_encoding in postgresql.conf and restart postmaster.
This is more  than a little awkward for production systems.

Magnus Hagander
2005-07-10 15:08:52 +00:00
Bruce Momjian 0793108036 This patch implements putting language handlers for the optional PLs
into pg_catalog rather than public, and supports dumping languages whose
handlers are found there. This will make it easier to drop the public
schema if desired.

Unlike the previous patch, the comments have been updated and I have
reformatted some code to meet Alvarro's request to stick to 80 cols. (I
actually aghree with this - it makes printing the code much nicer).

I think I did the right thing w.r.t versions earlier than 7.3, but I
have no real way of checking, so that should be checked by someone with
more/older knowledge than me ;-)

Andrew Dunstan
2005-07-10 14:26:30 +00:00
Bruce Momjian 73a7c322c3 Add psql \pset numericsep to allow output numbers like 100,000.0 or
100.000,0.

Eugen Nedelcu
2005-07-10 03:46:13 +00:00
Tom Lane 0ed5f90d73 Try connecting to both postgres and template1 databases to do the initial
inspection of shared catalogs.  This allows pg_dumpall to continue to
work with pre-8.1 servers that likely won't have a database named postgres.
Also, suppress output of SYSID options for users and groups, since server
no longer does anything with these except emit a rude message.
There is much more to be done to update pg_dumpall for the roles feature,
but this at least makes it usable again.  Per gripe from Chris K-L.
2005-07-08 16:51:30 +00:00
Tom Lane 59d1b3d99e Track dependencies on shared objects (which is to say, roles; we already
have adequate mechanisms for tracking the contents of databases and
tablespaces).  This solves the longstanding problem that you can drop a
user who still owns objects and/or has access permissions.
Alvaro Herrera, with some kibitzing from Tom Lane.
2005-07-07 20:40:02 +00:00
Bruce Momjian c3a69c3b3b Attached is a patch that enhances the "\h" capability in psql. I often
find myself typing a command and then wanting to get the syntax for it.
So I do a ctrl-a and add a \h: but psql does not recognize the command,
because I have stuff attached to it (e.g. "alter table foobar"), so I
have to scroll over and delete everything except the name of the command
itself. This patch gives \h three chances to match: if nothing matches
the complete string (current behavior), it tries to match the first two
words (e.g. "ALTER TABLE"). If that fails, it tries to match the first
word (e.g. "DELETE").

Greg Sabino Mullane
2005-07-06 03:14:48 +00:00
Tom Lane eb5949d190 Arrange for the postmaster (and standalone backends, initdb, etc) to
chdir into PGDATA and subsequently use relative paths instead of absolute
paths to access all files under PGDATA.  This seems to give a small
performance improvement, and it should make the system more robust
against naive DBAs doing things like moving a database directory that
has a live postmaster in it.  Per recent discussion.
2005-07-04 04:51:52 +00:00
Bruce Momjian 74b49a8129 Add E'' to internally created SQL strings that contain backslashes.
Improve code clarity by using macros for E'' processing.
2005-07-02 17:01:59 +00:00
Bruce Momjian 539bc9fc91 Add code to pg_dump to use E'' strings when backslashes are used in dump
files.
2005-07-01 21:03:25 +00:00
Bruce Momjian 2f7d369a5c Clarify code to double \\ and '. 2005-07-01 17:40:29 +00:00
Tom Lane 51c58812d9 Dump comments for large objects. 2005-06-30 03:03:04 +00:00
Tom Lane 365205dd2a Fix broken initdb -W option, per Michael Fuhr. 2005-06-28 15:38:12 +00:00
Tom Lane 7762619e95 Replace pg_shadow and pg_group by new role-capable catalogs pg_authid
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.
2005-06-28 05:09:14 +00:00