Commit Graph

528 Commits

Author SHA1 Message Date
Tatsuo Ishii 5e3a28f4de Refrect changes made by Tom Lane 2002-09-04 02:54:59 +00:00
Peter Eisentraut 77f7763b55 Remove all traces of multibyte and locale options. Clean up comments
referring to "multibyte" where it really means character encoding.
2002-09-03 21:45:44 +00:00
Tom Lane e167510a4f Clean out cruft left by nonstandard test procedure. 2002-09-03 04:01:05 +00:00
Tom Lane 74cbe50439 last-minute CreateTemplateTupleDesc fixes. 2002-09-03 04:00:37 +00:00
Bruce Momjian a02780ffd0 Add missing dblink files. 2002-09-02 06:32:41 +00:00
Bruce Momjian 81631ac435 Fixes for intagg regression tests to match new array internal handling.
mlw
2002-09-02 06:28:06 +00:00
Bruce Momjian f68fe6716c In case Florian and I don't finish his changes to this contrib before
beta, at least get this stuff in.

ftipatch.txt - Updates to docs and scripts.  Run in the fulltextindexdir
WARNING - Add to fulltextindex dir
uninstall.sql - Add to fulltextindex dir
2002-09-02 06:27:04 +00:00
Bruce Momjian 7b8eb0b4f1 Attached is a fairly sizeable update to contrib/dblink. I'd love to get
review/feedback if anyone is interested and can spend the time. But I'd
also love to get this committed and address changes as incremental
patches ;-), so if there are no objections, please apply.

Below I'll give a synopsis of the changes. More detailed descriptions
are now in a new doc directory under contrib/dblink. There is also a new

dblink.test.sql file which will give a pretty good overview of the
functions and their use.

Joe Conway
2002-09-02 06:13:31 +00:00
Bruce Momjian a12b4e279b I checked all the previous string handling errors and most of them were
already fixed by You. However there were a few left and attached patch
should fix the rest of them.

I used StringInfo only in 2 places and both of them are inside debug
ifdefs. Only performance penalty will come from using strlen() like all
the other code does.

I also modified some of the already patched parts by changing
snprintf(buf, 2 * BUFSIZE, ... style lines to
snprintf(buf, sizeof(buf), ... where buf is an array.

Jukka Holappa
2002-09-02 06:11:43 +00:00
Bruce Momjian 6aa4482f2f Attached is an update to contrib/tablefunc. It introduces a new
function, connectby(), which can serve as a reference implementation for

the changes made in the last few days -- namely the ability of a
function to return an entire tuplestore, and the ability of a function
to make use of the query provided "expected" tuple description.

Description:

   connectby(text relname, text keyid_fld, text parent_keyid_fld,
     text start_with, int max_depth [, text branch_delim])
   - returns keyid, parent_keyid, level, and an optional branch string
   - requires anonymous composite type syntax in the FROM clause. See
     the instructions in the documentation below.

Joe Conway
2002-09-02 05:44:05 +00:00
Tom Lane c7a165adc6 Code review for HeapTupleHeader changes. Add version number to page headers
(overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
per earlier discussion.  Simplify scheme for overlaying fields in tuple
header (no need for cmax to live in more than one place).  Don't try to
clear infomask status bits in tqual.c --- not safe to do it there.  Don't
try to force output table of a SELECT INTO to have OIDs, either.  Get rid
of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
has already caused one recent failure.  Improve documentation.
2002-09-02 01:05:06 +00:00
Tom Lane d803de50d4 intagg subdirectory was missing. 2002-08-30 01:44:00 +00:00
Tom Lane e107f3a7e3 PL/pgSQL functions can return sets. Neil Conway's patch, modified so
that the functionality is available to anyone via ReturnSetInfo, rather
than hard-wiring it to PL/pgSQL.
2002-08-30 00:28:41 +00:00
Bruce Momjian dbc4d615ca Add cube changes file. 2002-08-29 23:05:03 +00:00
Bruce Momjian 32784cddf1 The changes I have made are described in CHANGES. This was based on
diffs to 7.3-devel and may not be applicable to 7.2. I have included a
change covered by a previous bugfix patch I submitted (the problem with
-.1 not being accepted by cube_in). It does not include a fix for the
potential buffer overrun issue I reported for cube_yyerror in
cubeparse.y.


Bruno Wolff III
2002-08-29 23:03:58 +00:00
Peter Eisentraut 6d27cfdd89 Make pg_resetxlog options parsing more standard and prepare messages for
translation.
2002-08-29 22:19:03 +00:00
Bruce Momjian 1761990e38 please apply small patch for README.tsearch.
I've documented space usage and using CLUSTER command

Oleg Bartunov
2002-08-29 19:55:26 +00:00
Tom Lane e4186762ff Adjust nodeFunctionscan.c to reset transient memory context between calls
to the table function, thus preventing memory leakage accumulation across
calls.  This means that SRFs need to be careful to distinguish permanent
and local storage; adjust code and documentation accordingly.  Patch by
Joe Conway, very minor tweaks by Tom Lane.
2002-08-29 17:14:33 +00:00
D'Arcy J.M. Cain 5f97dc3e7c chkpass_rout returns text so change PG_RETURN_CSTRING to PG_RETURN_TEXT_P.
This is currently a cosmetic difference but I make the change now in case
the macros diverge one day.
2002-08-29 12:18:20 +00:00
Tom Lane 64505ed58b Code review for standalone composite types, query-specified composite
types, SRFs.  Not happy with memory management yet, but I'll commit these
other changes.
2002-08-29 00:17:06 +00:00
Tom Lane 7483749d82 Improve description of tablefunc. 2002-08-28 22:05:46 +00:00
Tom Lane 5cabcfccce Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements
the same way normal tuple access operations do --- viz, using the
tupmacs.h macros att_addlength and att_align.  This makes the world
safe for arrays of cstrings or intervals, and should make it much
easier to write array-type-polymorphic functions; as examples see
the cleanups of array_out and contrib/array_iterator.  By Joe Conway
and Tom Lane.
2002-08-26 17:54:02 +00:00
Tatsuo Ishii cf7ee638a7 Adapt for SRF(Set Returning Function). 2002-08-23 08:19:49 +00:00
Bruce Momjian 52ee800ed3 Patch resolve ERROR problem for non-goog query_txt.
Teodor Sigaev
2002-08-23 02:56:36 +00:00
Tom Lane ceb9e60e8e Update contrib regression tests for OPAQUE datatype changes. 2002-08-23 00:04:52 +00:00
Tom Lane b663f3443b Add a bunch of pseudo-types to replace the behavior formerly associated
with OPAQUE, as per recent pghackers discussion.  I still want to do some
more work on the 'cstring' pseudo-type, but I'm going to commit the bulk
of the changes now before the tree starts shifting under me ...
2002-08-22 00:01:51 +00:00
Tom Lane e1b040a7c3 Fix potential buffer overrun in cube_out(), per report from
Bruno Wolff.
2002-08-18 20:15:52 +00:00
Tom Lane 675a7b8280 Cleanup. 2002-08-17 04:06:48 +00:00
Bruce Momjian 6945ea3445 Move pg_controldata to /bin. 2002-08-17 02:43:08 +00:00
Bruce Momjian cd1f4087c9 Move pg_controldata from /contrib to src/bin. 2002-08-16 20:34:06 +00:00
Bruce Momjian 2860041bf0 August 13, 2002
Use parser of OpenFTS v0.33.

--
Teodor Sigaev
2002-08-15 03:02:08 +00:00
Bruce Momjian 66eb8df6a4 The attached patch changes most of the usages of sprintf() to
snprintf() in contrib/. I didn't touch the places where pointer
arithmatic was being used, or other areas where the fix wasn't
trivial. I would think that few, if any, of the usages of sprintf()
were actually exploitable, but it's probably better to be paranoid...

Neil Conway
2002-08-15 02:58:29 +00:00
Bruce Momjian 45e2544584 As discussed on several occasions previously, the new anonymous
composite type capability makes it possible to create a system view
based on a table function in a way that is hopefully palatable to
everyone. The attached patch takes advantage of this, moving
show_all_settings() from contrib/tablefunc into the backend (renamed
all_settings(). It is defined as a builtin returning type RECORD. During
initdb a system view is created to expose the same information presently
available through SHOW ALL. For example:

test=# select * from pg_settings where name like '%debug%';
          name          | setting
-----------------------+---------
  debug_assertions      | on
  debug_pretty_print    | off
  debug_print_parse     | off
  debug_print_plan      | off
  debug_print_query     | off
  debug_print_rewritten | off
  wal_debug             | 0
(7 rows)


Additionally during initdb two rules are created which make it possible
to change settings by updating the system view -- a "virtual table" as
Tom put it. Here's an example:

Joe Conway
2002-08-15 02:51:27 +00:00
Bruce Momjian 106c733c34 Spacing improvement. 2002-08-14 03:01:43 +00:00
Bruce Momjian 87cfb8eb29 Fixed very stupid but important bug: mixing calls of some founctions from
contrib/tsearch and contrib/ltree :)

Teodor Sigaev
2002-08-10 20:46:24 +00:00
Bruce Momjian be2de3b9c8 The patch solves this problem, I hope...
Christopher Kings-Lynne wrote:
> I'm still getting ltree failures on 64bit freebsd:
>
> sed 's,MODULE_PATHNAME,$libdir/ltree,g' ltree.sql.in >ltree.sql
> gcc -pipe -O -g -Wall -Wmissing-prototypes -Wmissing-declarations -fpic -DPI
> C -DLOWER_NODE -I. -I../../src/include   -c -o ltree_io.o ltree_io.c -MMD
> ltree_io.c: In function `ltree_in':
> ltree_io.c:57: warning: int format, different type arg (arg 3)
> ltree_io.c:63: warning: int format, different type arg (arg 4)
> ltree_io.c:68: warning: int format, different type arg (arg 3)

Teodor Sigaev
2002-08-10 20:45:48 +00:00
Bruce Momjian 181ca96e7a August 6, 2002
1. Reworked patch from Andrey Oktyabrski (ano@spider.ru) with
      functions: icount, sort, sort_asc, uniq, idx, subarray
      operations: #, +, -, |, &

FUNCTIONS:

  int   icount(int[]) - the number of elements in intarray
  int[] sort(int[], 'asc' | 'desc') - sort intarray
  int[] sort(int[]) - sort in ascending order
  int[] sort_asc(int[]),sort_desc(int[]) - shortcuts for sort
  int[] uniq(int[]) - returns unique elements
  int   idx(int[], int item) - returns index of first intarray matching element
                               to item, or '0' if matching failed.
  int[] subarray(int[],int START [, int LEN]) - returns part of intarray
                               starting from element number START (from 1)
                               and length LEN.
OPERATIONS:

  int[] && int[]  - overlap - returns TRUE if arrays has at least one common elements.
  int[] @  int[]  - contains - returns TRUE if left array contains right array
  int[] ~ int[]   - contained - returns TRUE if left array is contained in right array
  # int[]         - return the number of elements in array
  int[] + int     - push element to array ( add to end of array)
  int[] + int[]   - merge of arrays (right array added to the end of left one)
  int[] - int     - remove entries matched by right argument from array
  int[] - int[]   - remove left array from right
  int[] | int     - returns intarray - union of arguments
  int[] | int[]   - returns intarray as a union of two arrays
  int[] & int[]   - returns intersection of arrays

Oleg Bartunov
2002-08-10 20:38:29 +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 34f03b1630 Patch for current CVS. It add test of lca() to ltree test suite.
Teodor Sigaev
2002-08-06 05:35:29 +00:00
Bruce Momjian 4132106055 Tom Lane:
>       please find attached patch to current CVS ( contrib/ltree)
>       Version for 7.2 is distributed as separate package -

I believe that patch also intended to remove contrib/ltree/patch.72
2002-08-04 05:12:43 +00:00
Bruce Momjian 978c8c6d2f please find attached patch to current CVS ( contrib/ltree )
Changes:

July 31, 2002
   Now works on 64-bit platforms.
   Added function lca - lowest common ancestor
   Version for 7.2 is distributed as separate package -
   http://www.sai.msu.su/~megera/postgres/gist/ltree/ltree-7.2.tar.gz

Oleg Bartunov
2002-08-04 05:02:50 +00:00
Bruce Momjian ce3d087010 This patch adds support for inet[] arrays to the /contrib/array module.
Neil Conway
2002-08-04 04:25:02 +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 45e584a445 Replace ad-hoc insertions into pg_opclass and friends with CREATE
OPERATOR CLASS commands.
2002-07-30 18:48:34 +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
Tom Lane ea2d97414c Use Max/Min macros, not MAX/MIN, to eliminate portability issues. 2002-07-30 17:32:10 +00:00
Bruce Momjian 1dedbf2da5 Add ltree data type to contrib, from Teodor Sigaev and Oleg Bartunov. 2002-07-30 16:40:34 +00:00
Tom Lane 9f1fc1080e Since we're depending on %option noyywrap in the main scanner now,
we may as well use it in all our flex files.  Make all the flex files
have a consistent set of options.
2002-07-30 16:33:08 +00:00
Bruce Momjian 74780590d8 Add tablefunc to contrib makefile. 2002-07-30 16:32:20 +00:00
Bruce Momjian 41f862ba87 As mentioned above, here is my contrib/tablefunc patch. It includes
three functions which exercise the tablefunc API.

show_all_settings()
   - returns the same information as SHOW ALL, but as a query result

normal_rand(int numvals, float8 mean, float8 stddev, int seed)
   - returns a set of normally distributed float8 values
   - This routine implements Algorithm P (Polar method for normal
     deviates) from Knuth's _The_Art_of_Computer_Programming_, Volume 2,
     3rd ed., pages 122-126. Knuth cites his source as "The polar
     method", G. E. P. Box, M. E. Muller, and G. Marsaglia,
     _Annals_Math,_Stat._ 29 (1958), 610-611.

crosstabN(text sql)
   - returns a set of row_name plus N category value columns
   - crosstab2(), crosstab3(), and crosstab4() are defined for you,
     but you can create additional crosstab functions per directions
     in the README.

Joe Conway
2002-07-30 16:31:11 +00:00