Commit Graph

15509 Commits

Author SHA1 Message Date
Tom Lane 621691d816 In ISO datestyle, never emit just HH:MM, always emit HH:MM:SS or
HH:MM:SS.SSS... when there is a nonzero part-of-a-day field in an
interval value.  The seconds part used to be suppressed if zero,
but there's no equivalent behavior for timestamp, and since we're
modeling this format on timestamp it's probably wrong.  Per complaint
and patch from Larry Rosenman.
2003-06-25 21:14:15 +00:00
Bruce Momjian d2ba12b4ef sync 2003-06-25 21:08:06 +00:00
Bruce Momjian 944ad408c5 sync 2003-06-25 21:07:28 +00:00
Bruce Momjian a26839ab9a sync 2003-06-25 21:06:29 +00:00
Tom Lane 5cf18b1ae3 Don't generate 'zero' typeids in the output from gen_cross_product.
This is no longer necessary or appropriate since we don't use zero typeid
as a wildcard anymore, and it fixes a nasty performance problem with
functions with many parameters.  Per recent example from Reuven Lerner.
2003-06-25 20:07:39 +00:00
Tom Lane 91e6f51afb 'third' -> 'fourth' where needed, per Joe Conway. 2003-06-25 18:13:50 +00:00
Michael Meskes 6f30d5665c The remaining files ... 2003-06-25 17:55:50 +00:00
Michael Meskes 8d8b9401b8 remove including of postgres_fe.h 2003-06-25 16:12:27 +00:00
Bruce Momjian 60050936ff sync. 2003-06-25 15:01:14 +00:00
Michael Meskes 54fae9c20a Some systems need another header file included. 2003-06-25 11:51:18 +00:00
Michael Meskes fd3ca524eb Implemented Informix special way to treat NULLs, removed warnings, synced. 2003-06-25 10:44:21 +00:00
Bruce Momjian ff4c69e021 Fix up JOIN .. USING with domains
The attached fixes select_common_type() to support the below case:

create table t1( c1 int);
create domain dom_c1 int;
create table t2(c1 dom_c1);
select * from t1 join t2 using( c1 );

I didn't see a need for maintaining the domain as the preferred type. A
simple getBaseType() call on all elements of the list seems to be
enough.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 04:32:03 +00:00
Bruce Momjian faa8c75799 Done:
> * -Allow CIDR format to be used in pg_hba.conf
2003-06-25 04:23:59 +00:00
Bruce Momjian f7827bdcf1 Done:
> * -Allow UPDATE to use SET col = DEFAULT
2003-06-25 04:19:35 +00:00
Bruce Momjian 53c4f1233f UPDATE ... SET <col> = DEFAULT
Rod Taylor
2003-06-25 04:19:24 +00:00
Bruce Momjian a09ccc70dd If they're not, the below causes problems, as the foreign key is added
after the CHECK.  Cluster depends on the index name, so I thought it
wise to ensure all names are available, rather than leaving off the
CONSTRAINT "$n" portion for internally named constraints.

CREATE TABLE jkey (col integer primary key);
CREATE TABLE j (col integer REFERENCES jkey);
ALTER TABLE j ADD CHECK(col > 5);

This is a problem in 7.3 series as well as -Tip.

Rod Taylor <rbt@rbt.ca>
2003-06-25 04:08:19 +00:00
Bruce Momjian ca64391d6c Updated the pg_get_constraintdef() to use conbin. Update pg_dump to use
pg_get_constraintdef() for >= 70400.

Rod Taylor <rbt@rbt.ca>
2003-06-25 03:56:31 +00:00
Bruce Momjian be94f198c3 Add missing </row>'s. 2003-06-25 03:50:52 +00:00
Bruce Momjian c70e606a4c Includes:
- LIKE <subtable> [ INCLUDING DEFAULTS | EXCLUDING DEFAULTS ]
- Quick cleanup of analyze.c function prototypes.
- New non-reserved keywords (INCLUDING, EXCLUDING, DEFAULTS), SQL 200X

Opted not to extend for check constraints at this time.

As per the definition that it's user defined columns, OIDs are NOT
inherited.

Doc and Source patches attached.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 03:40:19 +00:00
Bruce Momjian dbca370278 Back out commit. 2003-06-25 03:02:37 +00:00
Bruce Momjian ad41cd6c4a Adjust expected output for new functions. 2003-06-25 03:01:35 +00:00
Bruce Momjian a804f9c795 Add:
> * Allow creation of a libpq-only tarball
>
2003-06-25 02:43:54 +00:00
Bruce Momjian ebbd2edf82 Seems the runtime.sgml and perform.sgml patches combined are
incompatible.

I believe the attached xref meets the intent of the perform.sgml change.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 02:07:33 +00:00
Bruce Momjian d57d000627 Update catversion for ipv6 addition. 2003-06-25 01:26:16 +00:00
Bruce Momjian eaef65f68e Documentation about using CIDR addresses in pg_hba.conf.
Andrew Dunstan
2003-06-25 01:20:50 +00:00
Bruce Momjian d9ddbdaa95 > This change (I'm sure this will wrap poorly -- sorry):
> http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/libpq/pqcomm.h.diff?r1=1.85&r2=1.86
>
> modified SockAddr, but no corresponding change was made here
> (fe-auth.c:612):
>
>   case AUTH_REQ_KRB5:
> #ifdef KRB5
>   if (pg_krb5_sendauth(PQerrormsg, conn->sock, &conn->laddr.in,
>                        &conn->raddr.in,
>                        hostname) != STATUS_OK)
>
> It's not obvious to me what the change ought to be though.

This patch should hopefully fix both kerberos 4 and 5.

Kurt Roeckx
2003-06-25 01:19:47 +00:00
Bruce Momjian afb17d912b > I've worked with the Pl/Python code in the past and will see about removing
> rexec and making it an untrusted language.  Last time I looked, it didn't
> look particularly difficult.  I've set aside some time next week, so stay
> tuned.

Attached is a patch that removes all of the RExec code from plpython from
the current PostgreSQL CVS.  In addition, plpython needs to be changed to an
untrusted language in createlang.  Please let me know if there are any
problems.

Kevin Jacobs
2003-06-25 01:18:58 +00:00
Bruce Momjian b24a0293cc Attached is a patch that provides *VERY* limited support for multiple
slave
servers.  I haven't tested it very well, so use at your own risk (and I
recommend against using it in production).

Basically, I have a central database server that has 4 summary tables
inside
it replicated to a remote slave (these database tables are for my mail
server
authentication, so these are replicated to another server tuned for many
connections, and so I don't have postgres connections opened straight to
my
back-end database server).

Unfortunately, I also wanted to implement a replication database server
for
hot-backups.  I realized, too late, that the replication process is
pretty
greedy and will try to replicate all tables marked as a
"MasterAddTable".

To make a long story, I made a patch to RServ.pm and Replicate that
allows you
to specify, on the command line, a list of tables that you want to
replicate...it'll ignore all others.

I haven't finished, since this has to be integrated with CleanLog for
instance, but this should (and does) suffice for the moment.

I have yet to test it with two slaves, but at least my mail server
replication
database now works (it was failing every time it tried to replicate, for
a
variety of reasons).

Anyone have any suggestions on how to improve on this?  (or, if someone
more
familiar with this code wants to take the ball and run with it, you're
welcome to).

--
Michael A Nachbaur <mike@nachbaur.com>
2003-06-25 01:17:44 +00:00
Bruce Momjian e1be2ee831 Here's a small patch to pg_hba.conf.sample that explains the use of CIDR
addresses.

Andrew Dunstan
2003-06-25 01:15:24 +00:00
Bruce Momjian 861ea4ba53 Create <link> entries for the foreign keys in the system catalog
chapter.

I got tired of hitting the 'up' link, then finding the table in the
table of contents, and following it back down.

Rod Taylor
2003-06-25 01:14:37 +00:00
Bruce Momjian 503a88a632 client-auth.sgml references a renamed ID in runtime.sgml
Josh Berkus
2003-06-25 01:14:05 +00:00
Bruce Momjian 2a5e0bb612 Attached is the fully corrected version of the re-ording patch for
Runtime.sgml and dependant files.

Josh Berkus
2003-06-25 01:13:24 +00:00
Bruce Momjian 51d16423ae - Corrections for tables, columns with uppercase characters
- Don't attempt to convert partial or expressional unique indexes
- Don't attempt to convert unique indexes based on a non-default
opclasses

- Untested prevention of conversion of non-btree indexes unique
indexes.  Untested as postgresql doesn't allow hash, gist, or rtree
based indexes to be unique.

rbt=# create unique index t on a using hash (col);
ERROR:  DefineIndex: access method "hash" does not support UNIQUE
indexes
rbt=# create unique index t on a using gist (col);
ERROR:  DefineIndex: access method "gist" does not support UNIQUE
indexes
rbt=# select version();
                                version
------------------------------------------------------------------------
 PostgreSQL 7.4devel on i386-unknown-freebsd4.8, compiled by GCC 2.95.4

Rod Taylor
2003-06-25 01:11:09 +00:00
Bruce Momjian 8f337e86cd Please apply attached patch to contrib/dblink. It adds named persistent
connections to dblink.

Shridhar Daithanka
2003-06-25 01:10:15 +00:00
Bruce Momjian 92798de02e This is a bug in python interface module,
postgresql-7.3.3/src/interfaces/python/pg.py.

_quote() function fails due to integer overflow if input d is larger
than max integer.

In the case where the column type is "BIGINT", the input d may very well
be larger than max integer while its type, t, is labeled 'int'.
The conversion on line 19, return "%d" % int(d), will fail due to
"OverflowError: long int too large to convert to int".



Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

[1] create a table with a column type 'BIGINT'.
[2] use pg.DB.insert() to insert a value that is larger than max integer

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Just changing the conversion at line 19 of pg.py to long(d) instead of
int(d) should fix it. The following is a patch:

Chih-Hao Huang
2003-06-25 01:09:24 +00:00
Bruce Momjian dd23a882fa >> If a transaction marks a tuple for update and later commits without
>> actually having updated the tuple, [...] can we simply
>> set the HEAP_XMAX_INVALID hint bit of the tuple?
>
>AFAICS this is a reasonable thing to do.

Thanks for the confirmation.  Here's a patch which also contains some
more noncritical changes to tqual.c:
 .  make code more readable by introducing local variables for xvac
 .  no longer two separate branches for aborted and crashed.
    The actions were the same in all cases.

Manfred Koizar
2003-06-25 01:08:13 +00:00
Bruce Momjian fce529e102 Most of the synopsis areas for DROP commands use "name" as the
identifier, while some areas do not.

The attached converts be below to "name":
conversion_name
index_name


The below have an existing, initdb supplied, entity named "name".  As
such, it could be confusing for the reader to see that identifier used
in the example.

domainname
typename

Rod Taylor
2003-06-24 23:29:25 +00:00
Bruce Momjian 7eac8e3809 Revert ORDBMS change, per Peter. 2003-06-24 23:27:24 +00:00
Bruce Momjian db57396c1f Alter query.sgml to mention PostgreSQL as an ORDBMS. This falls in line
with advocacy and 'portal' websites.

Link to createdb / dropdb from the tutorial page about create / dropdb.
A pair of notes were asking about more info...

Rod Taylor
2003-06-24 23:26:46 +00:00
Bruce Momjian 7f7919256a In an attempt to simplify my life I'm submitting this patch that
restructures the deferred trigger queue.  The fundamental change is to
put all the static variables to hold the deferred triggers in a single
structure.

Alvaro Herrera
2003-06-24 23:25:44 +00:00
Bruce Momjian aa62f7f74a Add x86_64 support for spinlocks.
Jeffrey W. Baker
2003-06-24 23:20:08 +00:00
Bruce Momjian 7cb4278e82 Small patch to link to the proper place in the "runtime" file,
and to add the "schemaname" column to the description of the
pg_stats view.

Greg Sabino Mullane
2003-06-24 23:19:11 +00:00
Bruce Momjian 46bf651480 Array mega-patch.
Joe Conway
2003-06-24 23:14:49 +00:00
Bruce Momjian 50e53236af Done:
> * -Add IPv6 capability to INET/CIDR types
2003-06-24 23:05:20 +00:00
Bruce Momjian 7b1f6ffaab Jim C. Nasby wrote:
> Second argument to metaphone is suposed to set the limit on the
> number of characters to return, but it breaks on some phrases:
>
> usps=# select metaphone(a,3),metaphone(a,4),metaphone(a,20) from
> (select 'Hello world'::varchar AS a) a;
> HLW       | HLWR      | HLWRLT
>
> usps=# select metaphone(a,3),metaphone(a,4),metaphone(a,20) from
> (select 'A A COMEAUX MEMORIAL'::varchar AS a) a;
  > AKM       | AKMKS     | AKMKSMMRL
>
> In every case I've found that does this, the 4th and 5th letters are
> always 'KS'.

Nice catch.

There was a bug in the original metaphone algorithm from CPAN. Patch
attached (while I was at it I updated my email address, changed the
copyright to PGDG, and removed an unnecessary palloc). Here's how it
looks now:

regression=# select metaphone(a,4) from (select 'A A COMEAUX
MEMORIAL'::varchar AS a) a;
   metaphone
-----------
   AKMK
(1 row)

regression=# select metaphone(a,5) from (select 'A A COMEAUX
MEMORIAL'::varchar AS a) a;
   metaphone
-----------
   AKMKS
(1 row)

Joe Conway
2003-06-24 22:59:46 +00:00
Bruce Momjian 4b1fe23153 Prevent compiler warning from sprintf in recent ipv6 patch. 2003-06-24 22:42:42 +00:00
Bruce Momjian 945543d919 Add ipv6 address parsing support to 'inet' and 'cidr' data types.
Regression tests for IPv6 operations added.

        Documentation updated to document IPv6 bits.

        Stop treating IPv4 as an "unsigned int" and IPv6 as an array of
        characters.  Instead, always use the array of characters so we
        can have one function fits all.  This makes bitncmp(), addressOK(),
        and several other functions "just work" on both address families.

        add family() function which returns integer 4 or 6 for IPv4 or
        IPv6.  (See examples below)  Note that to add this new function
        you will need to dump/initdb/reload or find the correct magic
        to add the function to the postgresql function catalogs.

        IPv4 addresses always sort before IPv6.

        On disk we use AF_INET for IPv4, and AF_INET+1 for IPv6 addresses.
        This prevents the need for a dump and reload, but lets IPv6 parsing
        work on machines without AF_INET6.

        To select all IPv4 addresses from a table:

                select * from foo where family(addr) = 4 ...

        Order by and other bits should all work.

Michael Graff
2003-06-24 22:21:24 +00:00
Bruce Momjian 4dab978c52 Update:
< * Have SELECT '13 minutes'::interval display zero seconds
> * Have SELECT '13 minutes'::interval display zero seconds in ISO datestyle
2003-06-24 18:45:38 +00:00
Bruce Momjian 975674a952 Add -L../ecpglib -lecpg for Cygwin compile. 2003-06-24 14:45:46 +00:00
Bruce Momjian b235fe3c25 Add:
> * Have SELECT '13 minutes'::interval display zero seconds
2003-06-24 03:42:44 +00:00