Commit Graph

3214 Commits

Author SHA1 Message Date
Bruce Momjian f340648939 Update for longer NAMEDATALEN. 2002-08-13 20:41:13 +00:00
Bruce Momjian 46bb23ac01 Change NAMEDATALEN to 64, INDEX_MAX_KEYS/MAX_FUNC_ARGS to 32, per discussion on hackers. 2002-08-13 20:40:44 +00:00
Peter Eisentraut 1e4c4f9eb7 Remove obsolete uses of lanispl. Only used in pg_dump now, but can be
removed altogether if pg_dump doesn't need it anymore.
2002-08-13 17:22:08 +00:00
Bruce Momjian ccf15026e6 Add bitmap index mention. 2002-08-13 05:08:35 +00:00
Bruce Momjian b6d8df67d3 Update:
> * Use bitmaps to fetch heap pages in sequential order [performance]
> * Use bitmaps to combine existing indexes [performance]
2002-08-13 04:32:28 +00:00
Peter Eisentraut 282a5884de Correct description of sequence privileges. 2002-08-12 20:02:09 +00:00
Tom Lane 77a7e9968b Change memory-space accounting mechanism in tuplesort.c and tuplestore.c
to make a reasonable attempt at accounting for palloc overhead, not just
the requested size of each memory chunk.  Since in many scenarios this
will make for a significant reduction in the amount of space acquired,
partially compensate by doubling the default value of SORT_MEM to 1Mb.
Per discussion in pgsql-general around 9-Jun-2002..
2002-08-12 00:36:12 +00:00
Tom Lane e44beef712 Code review of CLUSTER patch. Clean up problems with relcache getting
confused, toasted data getting lost, etc.
2002-08-11 21:17:35 +00:00
Peter Eisentraut 9bccdf17f7 Create/drop cast now requires ownership of at least one of the types. 2002-08-11 17:44:12 +00:00
Tom Lane 014a86ac47 Editorial improvements. 2002-08-11 02:43:57 +00:00
Bruce Momjian 5c3102d6d1 Mention ANALYZE after CLUSTER. 2002-08-10 21:03:33 +00:00
Bruce Momjian 7dc40a2be0 Major improvement in CLUSTER which preserves table characteristics using
relfilenode.

I sent the CLUSTER patch a few days ago and I think it was missed.  I
append it again, this time including the regression test files.  For the
committer, please note that you have to cvs add the files as they don't
exist.  Maybe add to the parallel and serial schedules also, but I don't
know such stuff.

Alvaro Herrera (<alvherre[a]atentus.com>)
2002-08-10 20:43:46 +00:00
Tom Lane 8be9bd83ac psql prints its version number in its startup message, per recent
discussion.  Also, cause the \timing command to display time in a
format consistent with the backend's EXPLAIN ANALYZE output.
2002-08-10 19:35:01 +00:00
Tom Lane a5e6e99357 Allow schema-qualified operator names to be used in the optional
arguments of CREATE OPERATOR.
2002-08-10 19:01:53 +00:00
Peter Eisentraut 029aa97f2d Make sure all clients have the same understanding of default user name
and database.  In particular, make script wrappers understand the
PGDATABASE environment variable.
2002-08-10 16:57:32 +00:00
Tom Lane 039cb47988 psql backslash commands are schema-aware. Pattern matching behavior
follows recent pghackers discussion.  This commit includes all the
relevant fixes from Greg Mullane's patch of 24-June.
2002-08-10 03:56:24 +00:00
Peter Eisentraut 6ce4a4e3e1 Make sure monetary, numeric, and time locale categories are set to C and
are only activated temporarily to read out formatting information.
2002-08-09 22:52:04 +00:00
Tom Lane 4ab8e69094 has_table_privilege spawns scions has_database_privilege, has_function_privilege,
has_language_privilege, has_schema_privilege to let SQL queries test
all the new privilege types in 7.3.  Also, add functions pg_table_is_visible,
pg_type_is_visible, pg_function_is_visible, pg_operator_is_visible,
pg_opclass_is_visible to test whether objects contained in schemas are
visible in the current search path.  Do some minor cleanup to centralize
accesses to pg_database, as well.
2002-08-09 16:45:16 +00:00
Bruce Momjian 41e7328068 Done:
> 	o -Fix PL/PgSQL to handle quoted mixed-case identifiers
2002-08-08 23:50:38 +00:00
Bruce Momjian 54916d57b3 Add:
> * Allow INET subnet tests using non-constants
2002-08-08 23:20:11 +00:00
Tom Lane d176fad580 Some improvements in geometric-operators documentation. 2002-08-08 14:29:07 +00:00
Tatsuo Ishii f84002176f Fix bug in encoding conversion table 2002-08-08 08:21:52 +00:00
Tatsuo Ishii 6206a880cf Add SQL99 CONVERT() function. 2002-08-06 05:40:47 +00:00
Bruce Momjian 7b30ed8fa4 This patch fixes two typos in the documentation for the newly added
START TRANSACTION command.

Neil Conway
2002-08-06 05:32:16 +00:00
Peter Eisentraut 35cd432b18 Forgot to add/remove files. 2002-08-05 19:44:58 +00:00
Peter Eisentraut 6f4a9fb119 Add User's Guide chapters on Data Definition and Data Manipulation.
Still needs to be filled with more information, but it gives us a
framework to have a User's Guide with complete coverage of the basic
SQL operations.  Move arrays into data type chapter, inheritance into
DDL chapter (for now).

Make <comment>s show up in the output while the version number ends in
"devel".

Allow cross-book references with entities &cite-user; etc.
2002-08-05 19:43:31 +00:00
Tom Lane 07f9682de4 Preliminary code review for anonymous-composite-types patch: fix breakage
of functions returning domain types, update documentation for typtype,
move get_typtype to lsyscache.c (actually, resurrect the old version),
add defense against creating pseudo-typed table columns, fix some
bogus list-parsing in grammar.  Issues remain with respect to alias
handling and type checking; Joe is on those.
2002-08-05 02:30:50 +00:00
Bruce Momjian d7859a9570 Rename backend_pid to pg_backend_pid, move docs to monitoring section. 2002-08-04 19:51:30 +00:00
Bruce Momjian 9218689b69 Attached are two patches to implement and document anonymous composite
types for Table Functions, as previously proposed on HACKERS. Here is a
brief explanation:

1. Creates a new pg_type typtype: 'p' for pseudo type (currently either
     'b' for base or 'c' for catalog, i.e. a class).

2. Creates new builtin type of typtype='p' named RECORD. This is the
     first of potentially several pseudo types.

3. Modify FROM clause grammer to accept:
     SELECT * FROM my_func() AS m(colname1 type1, colname2 type1, ...)
     where m is the table alias, colname1, etc are the column names, and
     type1, etc are the column types.

4. When typtype == 'p' and the function return type is RECORD, a list
     of column defs is required, and when typtype != 'p', it is
disallowed.

5. A check was added to ensure that the tupdesc provide via the parser
     and the actual return tupdesc match in number and type of
attributes.

When creating a function you can do:
     CREATE FUNCTION foo(text) RETURNS setof RECORD ...

When using it you can do:
     SELECT * from foo(sqlstmt) AS (f1 int, f2 text, f3 timestamp)
       or
     SELECT * from foo(sqlstmt) AS f(f1 int, f2 text, f3 timestamp)
       or
     SELECT * from foo(sqlstmt) f(f1 int, f2 text, f3 timestamp)

Included in the patches are adjustments to the regression test sql and
expected files, and documentation.

p.s.
     This potentially solves (or at least improves) the issue of builtin
     Table Functions. They can be bootstrapped as returning RECORD, and
     we can wrap system views around them with properly specified column
     defs. For example:

     CREATE VIEW pg_settings AS
       SELECT s.name, s.setting
       FROM show_all_settings()AS s(name text, setting text);

     Then we can also add the UPDATE RULE that I previously posted to
     pg_settings, and have pg_settings act like a virtual table, allowing
     settings to be queried and set.


Joe Conway
2002-08-04 19:48:11 +00:00
Thomas G. Lockhart a19d9d3c4c Add IS OF type predicate. 2002-08-04 06:17:29 +00:00
Thomas G. Lockhart 6045f39bfd Add Myannar Time, Iran Time variant name, and Marquesas Time. 2002-08-04 06:15:45 +00:00
Tom Lane 0a4fc8556c Fix broken markup. 2002-08-04 05:46:02 +00:00
Tom Lane 5f9ba042a7 Neil's patch claimed a column list didn't work for COPY BINARY.
Which was true when he submitted it, but is so no longer.
2002-08-04 05:22:02 +00:00
Bruce Momjian 7926259de3 Add missing file; new docs for start_transaction. 2002-08-04 05:14:06 +00:00
Bruce Momjian 6b64704e4f This patch fixes a probably harmless write of uninitialized memory in
the statistics collector and makes a number of corrections to the
documentation for SET, SHOW, and COPY.

Neil Conway
2002-08-04 05:09:36 +00:00
Bruce Momjian 19e0e35bcd The attached patch implements START TRANSACTION, per SQL99. The
functionality of the command is basically identical to that of
BEGIN; it just accepts a few extra options (only one of which
PostgreSQL currently implements), and is standards-compliant.
The patch includes a simple regression test and documentation.

[ Regression tests removed, per Peter.]

Neil Conway
2002-08-04 04:31:44 +00:00
Bruce Momjian 79e77c6501 *** empty log message *** 2002-08-04 04:17:06 +00:00
Bruce Momjian 6be43c981e *** empty log message *** 2002-08-04 04:16:47 +00:00
Bruce Momjian 7ef5634701 Here is a doc patch for the SHOW X changes and new config-settings
functions. If there are no objections, please apply.

Joe Conway
2002-08-04 03:53:11 +00:00
Bruce Momjian 21cf6b2166 Remove unused drop TODO.detail. 2002-08-02 20:03:48 +00:00
Bruce Momjian 7c63a0db29 No need for TODO.detail link anymore:
> 	o -Add ALTER TABLE DROP COLUMN feature
2002-08-02 20:03:23 +00:00
Bruce Momjian 543409a752 Done:
> 	o -Add ALTER TABLE DROP COLUMN feature [drop]
2002-08-02 20:02:56 +00:00
Tom Lane 38bb77a5d1 ALTER TABLE DROP COLUMN works. Patch by Christopher Kings-Lynne,
code review by Tom Lane.  Remaining issues: functions that take or
return tuple types are likely to break if one drops (or adds!)
a column in the table defining the type.  Need to think about what
to do here.

Along the way: some code review for recent COPY changes; mark system
columns attnotnull = true where appropriate, per discussion a month ago.
2002-08-02 18:15:10 +00:00
Tom Lane ce7565ab91 Instead of having a configure-time DEFAULT_ATTSTATTARGET, store -1 in
attstattarget to indicate 'use the default'.  The default is now a GUC
variable default_statistics_target, and so may be changed on the fly.  Along
the way we gain the ability to have pg_dump dump the per-column statistics
target when it's not the default.  Patch by Neil Conway, with some kibitzing
from Tom Lane.
2002-07-31 17:19:54 +00:00
Bruce Momjian 8be3cfbbd5 Done:
> * -Remove LockMethodTable.prio field, not used (Bruce)
2002-07-31 03:13:16 +00:00
Bruce Momjian 52457ca6af Move backend_pid to functions/misc. 2002-07-31 02:27:29 +00:00
Bruce Momjian 1107531c91 Rename pid function to backend_pid(). 2002-07-31 01:49:13 +00:00
Bruce Momjian b8efa8755c Done:
> * -Add getpid() function to backend
2002-07-31 00:40:20 +00:00
Bruce Momjian 2c2c43d05f Updated:
< 	o ALTER TABLE ADD COLUMN column SET DEFAULT should fill existing
> 	o ALTER TABLE ADD COLUMN column DEFAULT should fill existing
2002-07-30 19:47:09 +00:00
Bruce Momjian b30ccbe32a Clarification from Tom:
< 	o ALTER TABLE ALTER COLUMN column SET DEFAULT should fill existing
> 	o ALTER TABLE ADD COLUMN column SET DEFAULT should fill existing
2002-07-30 19:43:20 +00:00
Bruce Momjian f514bb3e25 Would it be wise to have the plsql.sgml file renamed to plpgsql.sgml?
All of the internal tags are of the latter.

The other thing I noticed is that most of the quick examples in the file
use a para and synopsis.  Is there a reason we're not using <example/> ?

Rod Taylor
2002-07-30 19:36:13 +00:00
Bruce Momjian 6c01708c46 Added for Neil Conway:
> * Use CHECK constraints to improve optimizer decisions
2002-07-30 19:34:05 +00:00
Tom Lane 65b6868b13 Replace ad-hoc insertions into pg_opclass and friends with CREATE
OPERATOR CLASS commands.  Further tweaking of documentation for same.
2002-07-30 17:34:37 +00:00
Bruce Momjian 620abeb271 Done:
> 	o -Generate failure on short COPY lines rather than pad NULLs
2002-07-30 16:56:15 +00:00
Bruce Momjian 874148fe34 IMPROVED VERSION APPLIED:
The attached patch completes the following TODO item:

    * Generate failure on short COPY lines rather than pad NULLs

I also restructed a lot of the existing COPY code, did some code
review on the column list patch sent in by Brent Verner a little
while ago, and added some regression tests. I also added an
explicit check (and resultant error) for extra data before
the end-of-line.

Neil Conway
2002-07-30 16:55:06 +00:00
Bruce Momjian 23a8b77d42 Here are two patches. The guc_and_tablefunc patch addresses the two
changes mentioned above, and also adds a new function to the tablefunc
API. The tablefunc API change adds the following function:

* Oid foidGetTypeId(Oid foid) - Get a function's typeid given the
* function Oid. Use this together with TypeGetTupleDesc() to get a
* TupleDesc which is derived from the function's declared return type.

In the next post I'll send the contrib/tablefunc patch, which
illustrates the usage of this new function. Also attached is a doc patch
for this change. The doc patch also adds a function that I failed to
document previously.

Joe Conway
2002-07-30 16:20:03 +00:00
Bruce Momjian bf7d8e4299 Update contributions link. 2002-07-30 15:05:17 +00:00
Tom Lane c2d0ebce75 Rewrite xindex.sgml for CREATE OPERATOR CLASS. catalogs.sgml finally
contains descriptions of every single system table.  Update 'complex'
tutorial example too.
2002-07-30 05:24:56 +00:00
Bruce Momjian 5bf55525c3 Move item:
< * Allow logging of query durations
2002-07-30 03:12:37 +00:00
Bruce Momjian 122b0cd86f Update FAQ. 2002-07-30 01:35:29 +00:00
Bruce Momjian be347dcba6 Update FAQ. 2002-07-29 23:56:53 +00:00
Tom Lane ea4686e3e1 Implement CREATE/DROP OPERATOR CLASS. Work still remains: need more
documentation (xindex.sgml should be rewritten), need to teach pg_dump
about it, need to update contrib modules that currently build pg_opclass
entries by hand.  Original patch by Bill Studenmund, grammar adjustments
and general update for 7.3 by Tom Lane.
2002-07-29 22:14:11 +00:00
Bruce Momjian b9459c6adb Fix from Neil Conway:
< 	o ALTER TABLE ADD COLUMN column SET DEFAULT should fill existing
> 	o ALTER TABLE ALTER COLUMN column SET DEFAULT should fill existing
2002-07-29 21:41:19 +00:00
Peter Eisentraut 06ad580f75 Structure reference pages consistently. Document that structure.
Add information about environment variables.
2002-07-28 15:22:21 +00:00
Peter Eisentraut b02c56f584 Clean documentation subtree during make clean. 2002-07-28 15:19:59 +00:00
Peter Eisentraut b0c3c48eb3 Assemble portability modules into libpgport library.
Some makefile simplifications.
2002-07-27 20:10:05 +00:00
Peter Eisentraut 739adf32ee Remove unused system table columns:
pg_language.lancompiler
pg_operator.oprprec
pg_operator.oprisleft
pg_proc.proimplicit
pg_proc.probyte_pct
pg_proc.properbyte_cpu
pg_proc.propercall_cpu
pg_proc.prooutin_ratio
pg_shadow.usetrace
pg_type.typprtlen
pg_type.typreceive
pg_type.typsend

Attempts to use the obsoleted attributes of pg_operator or pg_proc
in the CREATE commands will be greeted by a warning.  For pg_type,
there is no warning (yet) because pg_dump scripts still contain these
attributes.

Also remove new but already obsolete spellings
isVolatile, isStable, isImmutable in WITH clause.  (Use new syntax
instead.)
2002-07-24 19:11:14 +00:00
Bruce Momjian f7ba1db755 Done:
> * -Add Intimate Shared Memory(ISM) for Solaris
2002-07-24 17:42:12 +00:00
Tatsuo Ishii 88b74dcddf Add pg_conversion system catalog. Update description for multibyte support. 2002-07-24 05:51:56 +00:00
Bruce Momjian b4b3c63b2b Done:
> * -Allow UPDATE/DELETE on inherited table
2002-07-23 23:28:36 +00:00
Peter Eisentraut e9c013f4bd Add unique index on pg_cast.oid, and document pg_cast table. 2002-07-22 20:23:19 +00:00
Tatsuo Ishii a7ffd69d4c Fix typo. 2002-07-22 13:00:00 +00:00
Tatsuo Ishii 8d25d5c5c7 Add CREATE CONVERSION/DROP CONVERSOION reference manual 2002-07-22 08:57:15 +00:00
Bruce Momjian f9d74d75e7 Schema TODO.detail file not needed anymore. 2002-07-21 04:39:52 +00:00
Bruce Momjian 17b28503d0 Mark items as done:
> * -Add GUC parameter for DATESTYLE
> 	o -Allow specification of column names
> 	o -Change syntax to WITH DELIMITER, (keep old syntax around?)
> 	o -Remove SET KSQO option now that OR processing is improved (Tom)
> 	o -Allow SHOW to output as a query result, like EXPLAIN
> * -Add SQL92 schemas (Tom)
2002-07-20 16:45:07 +00:00
Tom Lane c33a6343cd Code review for SHOW output changes; fix horology expected files for
new SHOW output format.
2002-07-20 15:12:56 +00:00
Tom Lane 59a471fc4c Make note that ALTER TABLE can change table owner these days. 2002-07-19 18:53:50 +00:00
Bruce Momjian d7d741afbe Done:
> * -Add BSD-licensed qsort() for Solaris
2002-07-19 17:26:35 +00:00
Bruce Momjian 4feeee17ce Done:
> * -HOLDER/HOLDERTAB rename to PROCLOCK/PROCLOCKTAG (Bruce)
2002-07-19 00:17:53 +00:00
Peter Eisentraut 97377048b4 pg_cast table, and standards-compliant CREATE/DROP CAST commands, plus
extension to create binary compatible casts.  Includes dependency tracking
as well.

pg_proc.proimplicit is now defunct, but will be removed in a separate
commit.

pg_dump provides a migration path from the previous scheme to declare
casts.  Dumping binary compatible casts is currently impossible, though.
2002-07-18 23:11:32 +00:00
Bruce Momjian a345ac8842 Done:
> * -Merge LockMethodCtl and LockMethodTable into one shared structure (Bruce)
2002-07-18 23:07:09 +00:00
Tom Lane 11333426f1 Implement DROP SCHEMA. It lacks support for dropping conversions and
operator classes, both of which are schema-local and so should really
be droppable.
2002-07-18 16:47:26 +00:00
Tom Lane 8bed350c4a Fix copy-and-pasteo (CASCADE/RESTRICT in wrong place). 2002-07-18 15:49:08 +00:00
Bruce Momjian fb94c09ae4 Done:
> * -Make sure all block numbers are unsigned to increase maximum table size
2002-07-18 05:01:51 +00:00
Bruce Momjian 5a5e46ea7e Here (finally ;-)) is a doc patch covering the Table Function C API. It
reflects the changes in the tablefunc-fix patch that I sent in the other
day. It also refers to "see contrib/tablefunc for more examples", which
is next on my list of things to finish and submit.

Joe Conway
2002-07-18 04:47:17 +00:00
Bruce Momjian a90db34b54 The attached patch (against HEAD) implements
COPY x (a,d,c,b) from stdin;
  COPY x (a,c) to stdout;

as well as the corresponding changes to pg_dump to use the new
functionality.  This functionality is not available when using
the BINARY option.  If a column is not specified in the COPY FROM
statement, its default values will be used.

In addition to this functionality, I tweaked a couple of the
error messages emitted by the new COPY <options> checks.

Brent Verner
2002-07-18 04:43:51 +00:00
Bruce Momjian df432df9fa Done, not sure when, reported by Neil Conway:
> * -Report failure to find readline or zlib at end of configure run
2002-07-17 22:15:20 +00:00
Tom Lane 5af19e4227 Add more dependency insertions --- this completes the basic pg_depend
functionality.  Of note: dropping a table that has a SERIAL column
defined now drops the associated sequence automatically.
2002-07-16 22:12:20 +00:00
Bruce Momjian 93d6a8aa7d > pgsql-bugs@postgresql.org wrote:
>  > David Clark (dclarknospam@opsi.co.za) reports a bug with a severity
>  > Table 3-7 SQL Literal escaped octets shows the input escape
>  > representation for a single quote as '\\'' , but the third paragraph
>  > below table 3-8 SQL Output Escaped Octets says that the single quote
>  > must be input as '\''
>
> Nice catch. '\'' is correct as shown in the example in Table 3-7.
>
>  >
>  > Also in the same paragraph mentioned above it says input for the
>  > single quote must be '\'' (or '\\134') shouldn't this be (or '\\047')
>
> Also a bug. Should be '\\047', as you pointed out.
>

Here's a patch to fix the binary string doc errors.

Joe Conway
2002-07-16 17:05:46 +00:00
Bruce Momjian d76eef3e7c Add mention of TOAST storage for character columns. 2002-07-16 04:45:59 +00:00
Bruce Momjian b3341ddbf2 Mark 'line' as 'not implemented' in SGML and psql \dT, per Thomas
Lockhart.  initdb not forced.
2002-07-16 03:30:27 +00:00
Bruce Momjian 7fb9b5d434 This fixes 2 inaccuracies in the recently added SQL99 feature list docs.
UNIQUE and DISTINCT predicates are both listed as implemented -- AFAIK,
neither is.

I also included another trivial patch which adds the default location
of the DSSSL stylesheets on my system (Debian unstable, docbook-dsssl
1.76) to the list of paths that configure looks for.

Neil Conway
2002-07-16 00:51:37 +00:00
Bruce Momjian 1a6f91c9f3 Item not needed:
< * Use our own getopt() for FreeBSD/OpenBSD to allow --xxx flags (Bruce)
2002-07-15 23:34:34 +00:00
Bruce Momjian b9104e3a97 Remove certain Makefile dependencies by using full pathnames in
configure.in.
2002-07-15 21:34:05 +00:00
Bruce Momjian 91dfa1af97 Fix \? and \pset pager handling. \? wasn't honoring pager before. 2002-07-15 01:56:25 +00:00
Tom Lane c4fb2b4e9e Remove no-longer-appropriate notes about lack of CASCADE/RESTRICT behavior. 2002-07-14 22:47:56 +00:00
Bruce Momjian 59097af0bb Mark as done, per Rod:
> o -Add ALTER TABLE DROP non-CHECK CONSTRAINT
> * -Allow psql \d to show foreign keys
> * -Auto-destroy sequence on DROP of table with SERIAL; perhaps a separate
> * -Prevent column dropping if column is used by foreign key
> * -Automatically drop constraints/functions when object is dropped
> * -Make foreign key constraints clearer in dump file
> * -Make foreign keys easier to identify
2002-07-13 02:42:16 +00:00
Bruce Momjian fa064e9794 Both done:
o -Add SET or BEGIN timeout parameter to cancel query
> * -Add pg_depend table for dependency recording; use sysrelid, oid,
2002-07-13 02:21:15 +00:00
Bruce Momjian 4db8718e84 Add SET statement_timeout capability. Timeout is in ms. A value of
zero turns off the timer.
2002-07-13 01:02:14 +00:00
Bruce Momjian ccb3f90f06 Re-add -I documentation, per Tom. 2002-07-13 00:55:53 +00:00