Commit Graph

10061 Commits

Author SHA1 Message Date
Tom Lane 273ae97052 Add a sanity check to make sure that all system catalogs that have OIDs
also have a unique index on OID.
2002-08-10 15:54:04 +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 9c5dacc5e9 Column ordering in \d output should agree with sort ordering;
per Joe Conway's patch of 20-July.
2002-08-09 18:06:57 +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
Hiroshi Inoue 65dc2e0d8c Change LOCK statements to start new transaction
in auto-commit off mode.
2002-08-09 10:04:21 +00:00
Tom Lane 3b78826bb5 Make the standard system views schema-aware.
I did not force an initdb via catversion ... but the rules
regression test will fail until you do an initdb.
2002-08-08 19:39:05 +00:00
Tom Lane 5e825139e4 Arrange to collect statistics on a few more system catalog columns. 2002-08-08 19:37:11 +00:00
Tom Lane 9459db8ea9 Cause view/rule display to work as expected after rename of an underlying
table or column, or of an output column of the view itself.
2002-08-08 17:00:19 +00:00
Tatsuo Ishii 697b472099 Address build problems on cygwin and (hopefully) AIX. 2002-08-08 07:47:43 +00:00
Tatsuo Ishii 3c63578a7e Load and keep conversion function info when SET CLIENT_ENCODING TO is
executed to prevent database access while performing encoding
conversion.
2002-08-08 06:35:26 +00:00
Tatsuo Ishii b53c851655 Remove #ifdef MULTIBYTE 2002-08-08 06:32:26 +00:00
Tom Lane b084cc3504 Cause schema-qualified FROM items and schema-qualified variable references
to behave according to SQL92 (or according to my current understanding
of same, anyway).  Per pghackers discussion way back in March 2002:
thread 'Do FROM items of different schemas conflict?'
2002-08-08 01:44:31 +00:00
Tom Lane e42f8e32e9 Clean up plpgsql identifier handling: process quoted identifiers
correctly, truncate to NAMEDATALEN where needed, allow whitespace
around dots in qualified identifiers.  Get rid of T_RECFIELD and
T_TGARGV token categories, which weren't accomplishing anything
except to create room for sins of omission in the grammar, ie,
places that should have allowed them and didn't.  Fix a few other
bugs en passant.
2002-08-08 01:36:05 +00:00
Tom Lane 13e8be42bd parseTypeString wasn't quite paranoid enough. 2002-08-08 01:22:35 +00:00
Tom Lane c1003339d6 Fix permission checking for temp-table namespace. 2002-08-07 21:45:02 +00:00
Tom Lane dfef56a92f Improve 'failed to initialize' messages. 2002-08-07 17:26:24 +00:00
Peter Eisentraut e52a98091f Updated translation from Dennis Bjorklund <db@zigo.dhs.org> 2002-08-06 21:13:44 +00:00
Tom Lane ba053de197 Still more paranoia in PageAddItem: disallow specification of an item
offset past the last-used-item-plus-one, since that would result in
leaving uninitialized holes in the item pointer array.  AFAICT the only
place that was depending on this was btree index build, which was being
cavalier about when to fill in the P_HIKEY pointer; easily fixed.
Also a small performance improvement: shuffle itemid's by means of
memmove, not a one-at-a-time loop.
2002-08-06 19:41:23 +00:00
Tom Lane 4038e8610c Remove no-longer-used PageManagerMode enum. 2002-08-06 19:37:10 +00:00
Tom Lane b74f61aabe Move pg_convert3 declaration to suppress compile warning. Really
pg_convert3 does not belong in a backend/catalog file at all, IMHO;
it should be in utils/adt.
2002-08-06 14:11:06 +00:00
Tatsuo Ishii 6206a880cf Add SQL99 CONVERT() function. 2002-08-06 05:40:47 +00:00
Bruce Momjian 683b0d3add Of course, the simple change has ripple effects! Here's a patch for the
rangefunc regression test for the new behavior.

Joe Conway
2002-08-06 05:34:46 +00:00
Bruce Momjian 4f63e11646 >> Hm. I'd sort of expect the "z" to become both the table and column
>> alias in this case.  What do you think?
>
> I guess that would make sense. I'll make a separate patch just for
that
> change if that's OK.
>

Simple change -- patch attached.

test=# select * from myfoo1() as z;
  z
----
   1
   2
   3
(3 rows)

Joe Conway
2002-08-06 05:34:10 +00:00
Bruce Momjian dd6513a5b6 The attached patch disallows the use of coldeflists for functions that
don't return type RECORD. It also catches a core dump condition when a
function returning RECORD had an alias list instead of a coldeflist.

Now both conditions throw an ERROR.

Joe Conway
2002-08-06 05:33:29 +00:00
Bruce Momjian a6c7681997 This patch changes the behavior of PostgreSQL so that if any queries are
executed in an implicitely aborted transaction (e.g. after an occur
occurs), we return an error (and not just a warning). For example:

nconway=# begin;
BEGIN
nconway=# insert; -- syntax error
ERROR:  parser: parse error at or near ";"
nconway=# select * from a;
ERROR:  current transaction is aborted, queries ignored until end of
transaction block

The old behavior was:

nconway=# begin;
BEGIN
nconway=# insert;
ERROR:  parser: parse error at or near ";"
nconway=# select * from a;
WARNING:  current transaction is aborted, queries ignored until end
of transaction block
*ABORT STATE*

Which can be confusing: if the client isn't paying careful attention,
they will conclude that the query has executed (because no error is
returned).

Neil Conway
2002-08-06 05:24:04 +00:00
Tom Lane 5df307c778 Restructure local-buffer handling per recent pghackers discussion.
The local buffer manager is no longer used for newly-created relations
(unless they are TEMP); a new non-TEMP relation goes through the shared
bufmgr and thus will participate normally in checkpoints.  But TEMP relations
use the local buffer manager throughout their lifespan.  Also, operations
in TEMP relations are not logged in WAL, thus improving performance.
Since it's no longer necessary to fsync relations as they move out of the
local buffers into shared buffers, quite a lot of smgr.c/md.c/fd.c code
is no longer needed and has been removed: there's no concept of a dirty
relation anymore in md.c/fd.c, and we never fsync anything but WAL.
Still TODO: improve local buffer management algorithms so that it would
be reasonable to increase NLocBuffer.
2002-08-06 02:36:35 +00:00
Tom Lane 15fe086fba Restructure system-catalog index updating logic. Instead of having
hardwired lists of index names for each catalog, use the relcache's
mechanism for caching lists of OIDs of indexes of any table.  This
reduces the common case of updating system catalog indexes to a single
line, makes it much easier to add a new system index (in fact, you
can now do so on-the-fly if you want to), and as a nice side benefit
improves performance a little.  Per recent pghackers discussion.
2002-08-05 03:29:17 +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
Thomas G. Lockhart ac1a3dcf24 Fix compilation problem with assert checking enabled for recent xlog
location feature.
2002-08-05 01:24:16 +00:00
Tom Lane 0fe931a3e0 Code review for anonymous-functions patch --- clean up some confusion
in checkretval about which paths are for base or complex return type.
2002-08-05 00:21:27 +00:00
Tom Lane 44582cd879 Temporary solution for XLogDir breakage. 2002-08-04 23:56:01 +00:00
Tom Lane 1be014313a Fix merge failures for anonymous-type patch. From Joe Conway. 2002-08-04 23:49:59 +00:00
Tom Lane e053d2071d Fix broken pg_backend_pid reference, per Joe Conway. 2002-08-04 23:46:38 +00:00
Bruce Momjian 32465bfc75 Another backend_pid rename. 2002-08-04 20:01:33 +00:00
Bruce Momjian 58c227693d Fix compile failures for FRS composite tyhpe patch until Joe can fix it. 2002-08-04 20:00:15 +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
Tom Lane 35d39ba081 Fix obsolete comment. 2002-08-04 18:12:15 +00:00
Thomas G. Lockhart ffef720670 Minor clarification or fix of typos. 2002-08-04 06:54:10 +00:00
Thomas G. Lockhart c755f6027f Implement WAL log location control using "-X" or PGXLOG. 2002-08-04 06:53:10 +00:00
Thomas G. Lockhart eb121ba2cf Implement IS OF and IS NOT OF type predicate.
Can now do queries of the form: SELECT value IS OF (integer, float8);
Define macros for handling typmod manipulation for date/time types.
 Should be more robust than all of that brute-force inline code.
Rename macros for masking and typmod manipulation to put TIMESTAMP_
 or INTERVAL_ in front of the macro name, to reduce the possibility
 of name space collisions.
Allow bit string constants without fully-specified length declaration.
Try implementing CREATE TABLE/OF as a mapping to inheritance.
 May be appropriate, or may be replace later with something more exactly
 like one might expect from databases without the feature.
2002-08-04 06:51:23 +00:00
Thomas G. Lockhart 7c1e67bd52 Implement IS OF type predicate. Can now do queries of the form:
select value IS OF (integer, float8);
2002-08-04 06:46:12 +00:00
Thomas G. Lockhart b71310d8e0 Add guard code to protect from buffer overruns on long date/time input
strings. Should go back in and look at doing this a bit more elegantly
 and (hopefully) cheaper. Probably not too bad anyway, but it seems a
 shame to scan the strings twice: once for length for this buffer overrun
 protection, and once to parse the line.
Remove use of pow() in date/time handling; was already gone from everything
 *but* the time data types.
Define macros for handling typmod manipulation for date/time types.
 Should be more robust than all of that brute-force inline code.
Rename macros for masking and typmod manipulation to put TIMESTAMP_
 or INTERVAL_ in front of the macro name, to reduce the possibility
 of name space collisions.
2002-08-04 06:44:47 +00:00
Thomas G. Lockhart e025bb7a72 Define macros for handling typmod manipulation for date/time types.
Should be more robust than all of that brute-force inline code.
Rename macros for masking and typmod manipulation to put TIMESTAMP_
 or INTERVAL_ in front of the macro name, to reduce the possibility
 of name space collisions.
2002-08-04 06:42:18 +00:00
Thomas G. Lockhart 043f9eb90a Implement hex literal conversion to bit string literal.
May not be the long-term solution (some continuing discussion with
 Peter E.) but better than the current mapping of a conversion to integer
 which I'd put in years ago before we had any bit string types at all.
This is already supported in the bit string implementation elsewhere.
2002-08-04 06:36:18 +00:00
Thomas G. Lockhart ce5dc562e6 Allow bit string constants without fully-specified length declaration.
Implement conversion between 8-byte integers and bit strings.
 Similar to what is done for 4-byte integers.
2002-08-04 06:33:59 +00:00
Thomas G. Lockhart af704cdfb4 Implement WAL log location control using "-X" or PGXLOG. 2002-08-04 06:26:38 +00:00
Bruce Momjian 10f1f709ab [ Previous patch reversed.]
Please use this patch instead of my previously submitted one.

It is just remerged against HEAD for new alter_table.out stuff.

Another reason this patch is useful for _interactive_ users: imagine a
view based on a many way join.  Imagine creating a complicated insert
rule that inserts into all the joined tables and when you insert you get
a check failure, but you need to know which actual table the constraint
was on that failed!

Christopher Kings-Lynne
2002-08-04 05:11:37 +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 7312c19ab5 Change messages like this:
ERROR:  ExecInsert: rejected due to CHECK constraint insert_con

To be like this:

ERROR:  ExecInsert: rejected due to CHECK constraint "insert_con" on
"insert_tbl"

Updated regression tests to match.

I got sick of seeing 'rejected due to CHECK constraint "$1" in my log and
not being able to find the bug in our website code...

Christopher Kings-Lynne
2002-08-04 05:04:40 +00:00
Bruce Momjian ce5bb92346 This trivial patch fixes a small memory leak in pg_dump.
Neil Conway
2002-08-04 05:03:29 +00:00
Bruce Momjian 6495f4e52f This patch fixes a "multi-line string literal" warning encountered
when compiling psql with GCC 3.1.

Neil Conway
2002-08-04 05:01:57 +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 fecc04f95a This patch fixes in intermittent failure in the regression tests:
there was a race condition between the "alter_table" and "rules"
regression tests. Depending on scheduling, sometimes an ALTER
TABLE command would operate on a relation created by the "rules"
tests, leading to unexpected results.

Neil Conway
2002-08-04 04:28:10 +00:00
Bruce Momjian 0b15c25225 Back out pl/pgsql quotation fix. Has problems. 2002-08-04 04:17:33 +00:00
Bruce Momjian 7a84053844 I send a simple patch for PL/pgSQL parser which allow now to use
whitespaces in identifers of any kind(table names,attribute
names,variables ...) in Pl/pgSQL procedural language.Explicit definition
of bug can be found in Re: [HACKERS] Bug of PL/pgSQL parser

TODO item completed:

        o -Fix PL/PgSQL to handle quoted mixed-case identifiers

eutm
2002-08-04 03:59:09 +00:00
Tom Lane 22c64f1834 When compiling with --enable-cassert, check for reference count leaks
in the relcache.  It's rather silly that we have reference count leak
checks in bufmgr and in catcache, but not in relcache which will normally
have many fewer entries.  Chris K-L would have caught at least one bug
in his recent DROP patch if he'd had this.
2002-08-02 22:36:05 +00:00
Tom Lane 154f26ff59 RemoveAttrDefaultById() neglected to obtain exclusive lock on the
relation being modified.  In most paths of control we'd already have
such a lock, but if we were dropping the default due to a cascaded
delete of some function it depended on, maybe not.
2002-08-02 21:54:34 +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
Bruce Momjian 5e6528adf7 * -Remove LockMethodTable.prio field, not used (Bruce) 2002-08-01 05:18:34 +00:00
Hiroshi Inoue 7dfc7e9e8c 1) Improve the handling of the queries like (select ..) union (select ..)
whose first non-space character is '('.
2) Handle Insert .. () VALUES ().
2002-08-01 03:07:50 +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 1107531c91 Rename pid function to backend_pid(). 2002-07-31 01:49:13 +00:00
Bruce Momjian f67cb71961 Add function to access backend pid, pg_stat_get_backend_mypid. 2002-07-31 00:40:40 +00:00
Tom Lane 4ad658cac9 Teach pg_dump to dump user-defined operator classes. For the moment,
this only works against 7.3 or later databases; the pushups required
to do it without regprocedure/regtype/etc seem more trouble than they're
worth, considering that existing users aren't expecting pg_dump support
for this.
2002-07-30 21:56:04 +00:00
Tom Lane 76099408f6 If we're cleaning out _deadcode, might as well zap this one too. 2002-07-30 18:54:59 +00:00
Bruce Momjian ad63a551b2 Remove last recipe file. 2002-07-30 18:44:01 +00:00
Tom Lane 937aef3545 Ensure that src/tutorial gets cleaned by top-level make clean. 2002-07-30 17:47:58 +00:00
Bruce Momjian 6e9893047e The attached patch removes the last remnants of support for
'tioga recipes', whatever those are -- Peter E. killed most
of it a couple days ago, but this patch removes the rest. Most
of it was #ifdef'ed out anyway.

Neil Conway
2002-07-30 16:55:45 +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 210e64fe08 Added support for schemas and quotes in tab-complete.c, as well as
a few other things:

* Made all references to the pg_* tables absolute, by specifying
  the pg_catalog schema.

* Added SCHEMA as a create/delete completion option.

* Added SCHEMA completion as: SELECT nspname FROM
pg_catalog.pg_namespace
  WHERE substr(nspname,1,%d)='%s'

* Added completion of "INSERT INTO <table> (" with attribute names.

* Added completion of "INSERT INTO <table> (attribs)" with
  VALUES or SELECT

* Added limited locking completion: only for one table:
  "LOCK" and "LOCK TABLE" now both get a completion list of tables
  Complete with "IN" for LOCK [TABLE] <table>
  Complete LOCK [TABLE] <table> IN with a lock mode

* Added a very simple WHERE finisher that uses the previous word
  as a table lookup for attributes.

* Added quote support when parsing "previous words". In other words,
  hitting tab after INSERT INTO "foo bar baby"
  now does the right thing and recognizes "foo bar baby" as one word.

Letting tab-complete quote things that should be quoted seems to be
temporarily ifdef'ed out due to readline compatibility problems.
Can anyone elaborate on this?

Greg Sabino Mullane
2002-07-30 16:35:05 +00:00
Bruce Momjian 578e71fee5 This should fix a bug where a row that was updated or
deleted that had another row inserted/updated to its old
value during the same statement or other statements before the
integrity check for noaction would incorrectly error.  This
could happen in deferred constraints or due to triggers or
functions. It's effectively a reworking of the previous patch that
did a not exists to instead do a separate check.

Stephan Szabo
2002-07-30 16:33:21 +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 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 ceb438ed8c This patch fixes one serious bug (runaway INSERT) and a few rare (and
hard to reproduce) error conditions.

Manfred Koizar
2002-07-30 16:08:33 +00:00
Dave Cramer 79d35b41aa added tests for crossReferences 2002-07-30 13:22:38 +00:00
Dave Cramer 55695148df changed test user back to test 2002-07-30 13:22:02 +00:00
Dave Cramer c82fed3d87 Added DataSource code and tests submitted by Aaron Mulder 2002-07-30 11:41:10 +00:00
Dave Cramer 6410c22265 changes for new Datasource 2002-07-30 11:38:13 +00:00
Bruce Momjian 6bdbe4ca2c Move alarm timers to proper location. 2002-07-30 05:35:53 +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 b6440a7ece Make statement_timeout apply to entire query string, not per statement. 2002-07-30 05:13:06 +00:00
Bruce Momjian a89fc4e6de --enable-syslog no longer required to use syslog. 2002-07-30 04:24:54 +00:00
Hiroshi Inoue 67d0cb2d77 Fix a bug about automatic client_encoding setting. 2002-07-30 00:48:02 +00:00
Tom Lane b5eebc1fd4 Centralize code for interpreting schema references, which had gotten
copied more places than I first thought it would.  This fixes a bug:
a couple of these places were neglecting to enforce USAGE access on
explicitly-referenced schemas.
2002-07-29 23:46:35 +00:00
Tom Lane 7b970bc1bc Use aclcheck_error() in place of ad-hoc permissions complaints. 2002-07-29 23:44:44 +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
Tom Lane a28375140c Fix minor coding error: don't ReleaseSysCache until after last use of
cache entry.
2002-07-29 20:45:44 +00:00
Tatsuo Ishii c6b2838685 Fix typo. Remove #ifdef MULTIBYTE 2002-07-29 08:04:55 +00:00
Peter Eisentraut b0c3c48eb3 Assemble portability modules into libpgport library.
Some makefile simplifications.
2002-07-27 20:10:05 +00:00
Hiroshi Inoue c3fdf8925e Fix a bug about the handling of CX parameter of the connection string
reported by Sergey Smirnov.
2002-07-26 08:45:54 +00:00
Barry Lind 40c44166dc Fouth (and final) phase of restructuring to add jdbc3 support.
Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc2/Jdbc2Connection.java
 	jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java
 Added Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java
 	jdbc/org/postgresql/jdbc1/Jdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/Jdbc1ResultSetMetaData.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
 	jdbc/org/postgresql/jdbc2/Jdbc2DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java
 Removed Files:
 	jdbc/org/postgresql/jdbc1/DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/ResultSetMetaData.java
 	jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc2/ResultSetMetaData.java
2002-07-26 05:29:35 +00:00
Barry Lind 68c6eff945 Third phase of restructuring to add jdbc3 support.
Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc1/DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/Jdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/jdbc2/Array.java
 	jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc2/Jdbc2Connection.java
 	jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java
 Added Files:
 	jdbc/org/postgresql/jdbc1/Jdbc1CallableStatement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java
 Removed Files:
 	jdbc/org/postgresql/jdbc1/CallableStatement.java
 	jdbc/org/postgresql/jdbc2/CallableStatement.java
 	jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
2002-07-25 22:45:28 +00:00
Peter Eisentraut 73eb2dfe77 Remove extra comma. 2002-07-25 20:52:59 +00:00
Tatsuo Ishii 0345f58496 Implement DROP CONVERSION
Add regression test
2002-07-25 10:07:13 +00:00
Barry Lind 8d600a7d1f Second phase of restructuring to add jdbc3 support. 2002-07-24 22:08:45 +00:00
Peter Eisentraut 43515ba3f8 Remove _deadcode. 2002-07-24 19:16:43 +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 a78777558c Add mention of copyright year update. 2002-07-24 17:58:24 +00:00
Tatsuo Ishii 19a20e04bd Add Japanese README explaining how to add new conversion.
English README will come soon...
2002-07-24 07:05:41 +00:00
Barry Lind 1e3187366c Initial restructuring to add jdbc3 support. There was a significant amount
of duplicated code between the jdbc1 and jdbc2.  This checkin restructures
the code so that the duplication is removed so that the jdbc3 support
can be added without adding yet another copy of everything.  Also many
classes were renamed to avoid confusion with multiple different objects
having the same name.  The timestamp tests were also updated to add support
for testing timestamp without time zone in addition to timestamp with time zone

 Modified Files:
 	jdbc/Makefile jdbc/build.xml jdbc/example/ImageViewer.java
 	jdbc/example/basic.java jdbc/example/blobtest.java
 	jdbc/example/threadsafe.java
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/Field.java
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/fastpath/Fastpath.java
 	jdbc/org/postgresql/jdbc1/CallableStatement.java
 	jdbc/org/postgresql/jdbc1/DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/PreparedStatement.java
 	jdbc/org/postgresql/jdbc2/Array.java
 	jdbc/org/postgresql/jdbc2/CallableStatement.java
 	jdbc/org/postgresql/jdbc2/DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc2/PreparedStatement.java
 	jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
 	jdbc/org/postgresql/largeobject/LargeObjectManager.java
 	jdbc/org/postgresql/largeobject/PGblob.java
 	jdbc/org/postgresql/largeobject/PGclob.java
 	jdbc/org/postgresql/test/jdbc2/BlobTest.java
 	jdbc/org/postgresql/test/jdbc2/ConnectionTest.java
 	jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
 	jdbc/org/postgresql/test/jdbc2/TimestampTest.java
 	jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java
 	jdbc/org/postgresql/util/Serialize.java
 Added Files:
 	jdbc/org/postgresql/PGConnection.java
 	jdbc/org/postgresql/PGStatement.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc1/Jdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/Jdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2Connection.java
 	jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/Jdbc2Statement.java
 Removed Files:
 	jdbc/org/postgresql/Connection.java
 	jdbc/org/postgresql/ResultSet.java
 	jdbc/org/postgresql/Statement.java
 	jdbc/org/postgresql/jdbc1/Connection.java
 	jdbc/org/postgresql/jdbc1/ResultSet.java
 	jdbc/org/postgresql/jdbc1/Statement.java
 	jdbc/org/postgresql/jdbc2/Connection.java
 	jdbc/org/postgresql/jdbc2/ResultSet.java
 	jdbc/org/postgresql/jdbc2/Statement.java
2002-07-23 03:59:55 +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
Michael Meskes 4be24fe88f Fixed some minor typos. 2002-07-21 11:09:41 +00:00
Michael Meskes 2297f3982b Re-Committed old file. 2002-07-21 08:20:07 +00:00
Tom Lane b70b78656b Tweak CreateTrigger() so that the OID used in the name of an
RI_ConstraintTrigger is the same OID assigned to the pg_trigger row.
This reduces consumption of OIDs and may ease debugging.
2002-07-20 19:55:38 +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
Michael Meskes a58930bbd5 Synced parser yet again.
Michael
2002-07-20 08:24:18 +00:00
Bruce Momjian d4803f5513 Fix regression tests for new SHOW output. 2002-07-20 06:32:53 +00:00
Bruce Momjian 63cfc6a8e8 Fix problems caused by code drift of API for without-oids. 2002-07-20 06:17:43 +00:00
Bruce Momjian b34cbe006f The attached patch fixes 2 trivial warnings generated by bison 1.35,
as a result of Peter's recent CREATE CAST changes.

Neil Conway
2002-07-20 05:58:34 +00:00
Bruce Momjian 1ac7db4468 I can't remember who said they were working on schema related psql
changes, but I kept finding myself wishing I could see what schema a
table or view exists in when I use \dt, \dv, etc. So, here is a patch
which does just that.

It sorts on "Schema" first, and "Name" second.

It also changes the test for system objects to key off the namespace
name starting with 'pg_' instead of the object name.

Sample output:

test=# create schema testschema;
CREATE SCHEMA
test=# create view testschema.ts_view as select 1;
CREATE VIEW
test=# \dv
                  List of relations
         Name        |   Schema   | Type |  Owner
--------------------+------------+------+----------
  __testpassbyval    | public     | view | postgres
  fooview            | public     | view | postgres
  master_pg_proc     | public     | view | postgres
  rmt_pg_proc        | public     | view | postgres
  vw_dblink_get_pkey | public     | view | postgres
  vw_dblink_replace  | public     | view | postgres
  ts_view            | testschema | view | postgres
(7 rows)

Joe Conway
2002-07-20 05:57:31 +00:00
Bruce Momjian 1ce03603cc > 2. This patch includes the same Table Function API fixes that I
>    submitted on July 9:
>
>    http://archives.postgresql.org/pgsql-patches/2002-07/msg00056.php
>
>    Please disregard that one *if* this one is applied. If this one is
>    rejected please go ahead with the July 9th patch.

The July 9th Table Function API patch mentioned above is now in CVS, so
here is an updated version of the guc patch which should apply cleanly
against CVS tip.

Joe Conway
2002-07-20 05:49:28 +00:00
Bruce Momjian b6d2faaf24 Hello, i noticed that win32 native stopped working/compiling after the SSL merge
.
So i took the opportunity to fix some stuff:

1. Made the thing compile (typos & needed definitions) with the new pqsecure_* s
tuff, and added fe-secure.c to the win32.mak makefile.
2. Fixed some MULTIBYTE compile errors (when building without MB support).
3. Made it do that you can build with debug info: "nmake -f win32.mak DEBUG=1".
4. Misc small compiler speedup changes.

The resulting .dll has been tested in production, and everything seems ok.
I CC:ed -hackers because i'm not sure about two things:

1. In libpq-int.h I typedef ssize_t as an int because Visual C (v6.0)
doesn't de fine ssize_t. Is that ok, or is there any standard about what
type should be use d for ssize_t?

2. To keep the .dll api consistent regarding MULTIBYTE I just return -1
in fe-connect.c:PQsetClientEncoding() instead of taking away the whole
function. I wonder if i should do any compares with the
conn->client_encoding and return 0 if not hing would have changed (if so
how do i check that?).

Regards

Magnus Naeslund
2002-07-20 05:43:31 +00:00
Bruce Momjian 1430271e99 Add new configure files for missing-oid patch. 2002-07-20 05:39:46 +00:00
Bruce Momjian dcbacde2e3 Patch problems caused by code drift since OID patch creation. 2002-07-20 05:37:45 +00:00
Bruce Momjian e36f9cd440 Manually apply part of oid patch that didn't apply cleanly. 2002-07-20 05:29:01 +00:00
Bruce Momjian b0f5086e41 oid is needed, it is added at the end of the struct (after the null
bitmap, if present).

Per Tom Lane's suggestion the information whether a tuple has an oid
or not is carried in the tuple descriptor.  For debugging reasons
tdhasoid is of type char, not bool.  There are predefined values for
WITHOID, WITHOUTOID and UNDEFOID.

This patch has been generated against a cvs snapshot from last week
and I don't expect it to apply cleanly to current sources.  While I
post it here for public review, I'm working on a new version against a
current snapshot.  (There's been heavy activity recently; hope to
catch up some day ...)

This is a long patch;  if it is too hard to swallow, I can provide it
in smaller pieces:

Part 1:  Accessor macros
Part 2:  tdhasoid in TupDesc
Part 3:  Regression test
Part 4:  Parameter withoid to heap_addheader
Part 5:  Eliminate t_oid from HeapTupleHeader

Part 2 is the most hairy part because of changes in the executor and
even in the parser;  the other parts are straightforward.

Up to part 4 the patched postmaster stays binary compatible to
databases created with an unpatched version.  Part 5 is small (100
lines) and finally breaks compatibility.

Manfred Koizar
2002-07-20 05:16:59 +00:00
Bruce Momjian 38dd3ae7d0 The attached patch fixes a build problem with GEQO when using the
PX recombination operator, changes some elog() messages from LOG
to DEBUG1, puts some debugging functions inside the appropriate
#ifdef (not enabled by default), and makes a few other minor
cleanups.

BTW, the elog() change is motivated by at least one user who
has sent a concerned email to -general asking exactly what the
"ERX recombination operator" is, and what it is doing to their
DBMS.

Neil Conway
2002-07-20 04:59:10 +00:00
Bruce Momjian aec814b548 Add new vacuum regression test files. 2002-07-20 04:58:14 +00:00
Bruce Momjian e77054e029 This patch fixes a regression caused by my recent changes to heap
tuple header.  The fix is based on the thought that HEAP_MOVED_IN is
not needed any more as soon as HEAP_XMIN_COMMITTED has been set.  So
in tqual.c and vacuum.c the HEAP_MOVED bits are cleared when
HEAP_XMIN_COMMITTED is set.

Vacuum robustness is enhanced by rearranging ifs, so that we have a
chance to elog(ERROR, ...) before an assertion fails.

A new regression test is included.

Manfred Koizar
2002-07-20 04:57:13 +00:00
Tom Lane 009d593c48 Small performance improvement --- use indexscan not heapscan to find
pg_statistic rows to delete while dropping a relation.
2002-07-19 22:21:17 +00:00
Bruce Momjian 33b3c95200 Complete TODO item:
* -Add BSD-licensed qsort() for Solaris
2002-07-19 17:35:11 +00:00
Bruce Momjian ec793794b2 Another "$@" cleanup with new syntax, ${1+"$@"}. 2002-07-19 15:31:43 +00:00
Bruce Momjian 1128c54a09 Fix "$@" to ${1:+"$@"} for older shells. 2002-07-19 13:50:06 +00:00
Tatsuo Ishii 86270024ff Oops. Too much ifdef out. 2002-07-19 11:09:25 +00:00
Tatsuo Ishii 248cbb5796 Temporary ifdef out migrating functions to avoid compiler warnings. 2002-07-19 00:22:24 +00:00
Bruce Momjian b75fcf9326 Complete TODO item:
* -HOLDER/HOLDERTAB rename to PROCLOCK/PROCLOCKTAG
2002-07-19 00:17:40 +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 981d045e88 Complete TODO item:
* Merge LockMethodCtl and LockMethodTable into one shared structure (Bruce)
2002-07-18 23:06:20 +00:00
Peter Eisentraut 85d2a629c6 Create directory before installing files. 2002-07-18 22:58:08 +00:00
Bruce Momjian 776fc8cc5c New depend code doesn't need sequence drop. 2002-07-18 22:31:44 +00:00
Tom Lane 2aa6a5de87 Sic transit src/utils. 2002-07-18 22:15:10 +00:00
Bruce Momjian 7d78bac108 Back out BETWEEN node patch, was causing initdb failure. 2002-07-18 17:14:20 +00:00
Bruce Momjian a938f32a5a New depend code auto-drops sequence, fix copy2.out. 2002-07-18 17:11:49 +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
Tatsuo Ishii 55fa0e6d2a Fix typo (PG_UNICODE -> PG_UTF8) 2002-07-18 05:07:30 +00:00
Bruce Momjian a9f6c5b5c7 Unique and primary key constraints are both dumped using ALTER TABLE
statements.  Unique indexes with CREATE INDEX.

Basically, pg_constraint left outer'd to pg_index.

Rod Taylor
2002-07-18 04:50:51 +00:00
Bruce Momjian e6f02c8231 REVOKE ALL ON FUNCTION nonexistant() FROM PUBLIC;
Used to report that GRANT could not find function nonexistant.

Rod Taylor
2002-07-18 04:50:10 +00:00
Bruce Momjian 8f211f8a84 Fix for PgTransaction class to make these visible to C apps:
ExecStatusType BeginTransaction();
   ExecStatusType EndTransaction();

Piotr Klaban
2002-07-18 04:49:30 +00:00
Bruce Momjian 8c26bc5364 The attached patch fixes a tiny memory leak in psql, when using
the 'expanded' output mode (\x).

Neil Conway
2002-07-18 04:46:24 +00:00
Bruce Momjian 2c48b3db95 here are the copy2.sql and copy2.out files for the new regression
tests

Brent Verner
2002-07-18 04:45:51 +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 fc5372e099 You made a tiny little type in a comment in parsenodes.h (abotu instead
of about).

Christopher Kings-Lynne
2002-07-18 04:42:29 +00:00
Bruce Momjian 3e22406ec6 Finished the Between patch Christopher started.
Implements between (symmetric / asymmetric) as a node.

Executes the left or right expression once, makes a Const out of the
resulting Datum and executes the >=, <= portions out of the Const sets.

Of course, the parser does a fair amount of preparatory work for this to
happen.

Rod Taylor
2002-07-18 04:41:46 +00:00
Bruce Momjian 7ea5f1d7f1 Here is a patch for the Table Function API. It fixes a bug found by Neil
Conway (BuildTupleFromCStrings sets NULL for pass-by-value types when
intended value is 0). It also implements some other improvements
suggested by Neil.

Joe Conway
2002-07-18 04:40:30 +00:00
Bruce Momjian 7c5c1a2adb Add comment to file about port files. 2002-07-18 04:30:36 +00:00
Tatsuo Ishii 3d7a9ac769 Fix breakage for pltcl modules. pg_get_enconv_by_encoding() has been
changed since CREATE CONVERSION supported.
2002-07-18 04:16:07 +00:00
Bruce Momjian 404e9a12a5 Move libc replacement files from src/backend/port to src/port. 2002-07-18 04:13:59 +00:00
Bruce Momjian 7f43165dd2 Make src/backend/port/*.c file location dependent only on configure.in. 2002-07-18 03:59:49 +00:00
Tatsuo Ishii eb335a034b I have committed many support files for CREATE CONVERSION. Default
conversion procs and conversions are added in initdb. Currently
supported conversions are:

UTF-8(UNICODE) <--> SQL_ASCII, ISO-8859-1 to 16, EUC_JP, EUC_KR,
		    EUC_CN, EUC_TW, SJIS, BIG5, GBK, GB18030, UHC,
		    JOHAB, TCVN

EUC_JP <--> SJIS
EUC_TW <--> BIG5
MULE_INTERNAL <--> EUC_JP, SJIS, EUC_TW, BIG5

Note that initial contents of pg_conversion system catalog are created
in the initdb process. So doing initdb required is ideal, it's
possible to add them to your databases by hand, however. To accomplish
this:

psql -f your_postgresql_install_path/share/conversion_create.sql your_database

So I did not bump up the version in cataversion.h.

TODO:
Add more conversion procs
Add [CASCADE|RESTRICT] to DROP CONVERSION
Add tuples to pg_depend
Add regression tests
Write docs
Add SQL99 CONVERT command?
--
Tatsuo Ishii
2002-07-18 02:02:30 +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
Barry Lind cdebcad6af fixed bug in support for timestamp without time zone reported by Yuva Chandolu (ychandolu@ebates.com) 2002-07-16 21:05:17 +00:00
Bruce Momjian 846ea08d34 Oops, sometimes strtol isn't called in pg_atoi, so we do need that badp
check.
2002-07-16 18:34:16 +00:00
Bruce Momjian 7aee5ed3b7 Fix tid to in/out as unsigned. 2002-07-16 17:55:25 +00:00
Tom Lane 14f1588356 Add initdb code to set up initial contents of pg_depend, pinning all
objects created during initdb (except for the system views, which I
think do not need to be pinned).
2002-07-16 17:48:46 +00:00
Tatsuo Ishii 3c7798f068 Add conversion procs for CREATE CONVERSION 2002-07-16 09:25:06 +00:00
Tatsuo Ishii 743b747264 Fix typo 2002-07-16 06:58:44 +00:00
Tatsuo Ishii d49108fd73 Add FindDefaultConversionProc 2002-07-16 06:58:14 +00:00
Tom Lane 30ec31604d Add code to extract dependencies from an expression tree, and use it
to build dependencies for rules, constraint expressions, and default
expressions.  Repair some problems in the original design of
recursiveDeletion() exposed by more complex dependency sets.  Fix
regression tests that were deleting things in illegal sequences.
2002-07-16 05:53:34 +00:00
Bruce Momjian 1e07ab78cc Add DLLINIT mention in port/Makefile. 2002-07-16 05:49:38 +00:00
Bruce Momjian 3cbb9eb265 Move few remaining src/utils files to backend/port so everything is in
one place.  Everything may be moved to src/utils eventually.

Add DLLINIT variable to simplify makfiles.
2002-07-16 05:46:36 +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 b00e50fbb8 Remove indenting of Makefile comments, per Peter.\ 2002-07-15 23:32:28 +00:00
Bruce Momjian 4ea0275f18 Remove utils/getopt.c file, not needed, it only allowed "--flag"
warnings, and we now look for getopt_long in libgetopt.a.
2002-07-15 22:48:54 +00:00
Bruce Momjian b9104e3a97 Remove certain Makefile dependencies by using full pathnames in
configure.in.
2002-07-15 21:34:05 +00:00
Tom Lane 7bd631bfa4 Use the dependency mechanism to manage column defaults. We need this
so that dependencies in default expressions (on operators, functions,
etc) can be expressed properly.
2002-07-15 16:33:32 +00:00
Bruce Momjian 3c580b8d97 Fix make_ctags for exhuberant tags. 2002-07-15 14:45:51 +00:00
Hiroshi Inoue 5fad748eb8 Fix a bug about the handling of '.' in parse.c. 2002-07-15 02:56:39 +00:00
Bruce Momjian e552e9e512 Improve relcache.c error reporting for the next guy who has to debug
this thing.
2002-07-15 01:57:51 +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 d5fa19c6ee Add COMMENT ON CONSTRAINT facility (from Rod Taylor's pg_constraint patch).
Fix comment.c to not depend on parser token values, per discussion awhile
back.
2002-07-14 23:38:13 +00:00
Tom Lane df3f5dfd19 In DeleteAttributeTuples, use a single indexscan instead of the multiple
scans that will most likely be caused by SearchSysCache probes.  Also,
share some code between index deletion and table deletion.
2002-07-14 21:08:08 +00:00
Tom Lane 942a2e94fa Fix testing of partial-index predicates to work correctly in cases where
varno of index's relation is not 1.  This embarrassing oversight pointed
out by Dmitry Tkach 12-Jul-02.
2002-07-13 19:20:34 +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
Tom Lane 7c6df91dda Second phase of committing Rod Taylor's pg_depend/pg_constraint patch.
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY
constraints all have real live entries in pg_constraint.  pg_depend
exists, and RESTRICT/CASCADE options work on most kinds of DROP;
however, pg_depend is not yet very well populated with dependencies.
(Most of the ones that are present at this point just replace formerly
hardwired associations, such as the implicit drop of a relation's pg_type
entry when the relation is dropped.)  Need to add more logic to create
dependency entries, improve pg_dump to dump constraints in place of
indexes and triggers, and add some regression tests.
2002-07-12 18:43:19 +00:00
Dave Cramer 791a40f943 Changed getCrossReference to return information about each composite key seperately
It used to return them as a,b in one row, and now returns
a in one row, and b in one row
2002-07-12 13:07:48 +00:00
Hiroshi Inoue b82b2db7c1 An improvement of User Interface(Setup dialog) by Dave Page. 2002-07-12 02:02:26 +00:00
Hiroshi Inoue 59e5d516aa 1) Fix a memory leak in use declare/fetch mode.
2) Change default build mode to multibyte(Windows).
2002-07-12 01:41:25 +00:00
Bruce Momjian 29dfd5fa26 Change error messages ExecAppend->ExecInsert and ExecReplace->ExecUpdate
as discussed on hackers.
2002-07-11 21:36:20 +00:00
Tatsuo Ishii fcc962566a Add new CREATE CONVERSION/DROP CONVERSION command.
This is the first cut toward CREATE CONVERSION/DROP CONVERSION implementaion.
The commands can now add/remove tuples to the new pg_conversion system
catalog, but that's all. Still need work to make them actually working.
Documentations, regression tests also need work.
2002-07-11 07:39:28 +00:00
Bruce Momjian 3a0136c7d2 Fix getopt flags. Man thing thing was messed up. 2002-07-11 02:00:14 +00:00
Bruce Momjian 9c6c0ceb97 Fix another --help typo in pg_restore. 2002-07-11 01:57:12 +00:00
Hiroshi Inoue 263db2e586 Make NAMEDATALEN changeable at compile time. 2002-07-11 01:52:46 +00:00
Barry Lind d676e29d41 fix bug in getTime() with fractional seconds reported by Laurette Cisneros (laurette@nextbus.com) 2002-07-10 00:51:36 +00:00
Bruce Momjian 92a77cb870 Oops, proper initialization for domainTypMod was none at all, not 0. 2002-07-09 13:52:14 +00:00
Bruce Momjian 81e7e71941 Fix compiler warning:
int32           domainTypMod = NULL;

should be:

	int32           domainTypMod = 0;
2002-07-09 05:21:35 +00:00
Bruce Momjian 2dc53d863c Fix case syntax for freebsd template. 2002-07-08 01:54:30 +00:00
Bruce Momjian 20e83274bb Fix typo in xl_heaptid comment
Manfred Koizar
2002-07-08 01:52:23 +00:00
Bruce Momjian 4f4753832e Move CXX platform-specific stuff into template files. 2002-07-07 20:28:25 +00:00
Bruce Momjian 712f69ece8 Convert expr to case, for Peter E. 2002-07-07 14:24:13 +00:00
Bruce Momjian 1666970275 I've fixed up the way domain constraints (not null and type length)
are managed as per request.

Moved from merging with table attributes to applying themselves during
coerce_type() and coerce_type_typmod.

Regression tests altered to test the cast() scenarios.

Rod Taylor
2002-07-06 20:16:36 +00:00
Bruce Momjian 5af6e0a4ac Add comments about sharing. 2002-07-06 20:14:58 +00:00
Bruce Momjian 7015111a19 Move simple_prompt() into its own file to be shared with psql and pg_dump. 2002-07-06 20:12:30 +00:00
Barry Lind f170e61d9b fixed bug reported by Michael, Dietrich (mdt@emdete.de) where a large object handle was being used after the end of the transaction and thus resulting in an error. 2002-07-05 18:50:27 +00:00
Hiroshi Inoue 8831c35a19 Fix a bug reported by Zhou Han. 2002-07-05 01:31:41 +00:00
Bruce Momjian c8c2b7fff9 Fix compile error in assert coded added by new DISTINCT ON patch. 2002-07-04 16:44:08 +00:00
Bruce Momjian d59478c4f3 More clearly document in pg_dump when we are dealing with an object name
as it appears in the schema dump, and index tags.
2002-07-04 15:35:07 +00:00
Thomas G. Lockhart 68d9fbeb55 Implement the IS DISTINCT FROM operator per SQL99.
Reused the Expr node to hold DISTINCT which strongly resembles
 the existing OP info. Define DISTINCT_EXPR which strongly resembles
 the existing OPER_EXPR opType, but with handling for NULLs required
 by SQL99.
We have explicit support for single-element DISTINCT comparisons
 all the way through to the executor. But, multi-element DISTINCTs
 are handled by expanding into a comparison tree in gram.y as is done for
 other row comparisons. Per discussions, it might be desirable to move
 this into one or more purpose-built nodes to be handled in the backend.
Define the optional ROW keyword and token per SQL99.
 This allows single-element row constructs, which were formerly disallowed
 due to shift/reduce conflicts with parenthesized a_expr clauses.
Define the SQL99 TREAT() function. Currently, use as a synonym for CAST().
2002-07-04 15:24:11 +00:00
Bruce Momjian 3722dee6d9 Document function args are required for pg_restore -P.
Fix pg_dump to not quote the function name in the storage tag.
Fix pg_dump so GRANT/REVOKE(ACL) tag entries are not quoted, for
	consistency.
Fix pg_restore to properly handle quotes and some spaces in -P.
2002-07-04 03:04:55 +00:00