Commit Graph

11470 Commits

Author SHA1 Message Date
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 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 975674a952 Add -L../ecpglib -lecpg for Cygwin compile. 2003-06-24 14:45:46 +00:00
Bruce Momjian 5249172e1f typedef sa_family_t for cygwin. 2003-06-24 01:49:22 +00:00
Bruce Momjian 646e7f8415 Do not include:
#include <pwd.h>
	#include <netdb.h>

in MS CC/Borland builds.
2003-06-24 00:44:29 +00:00
Bruce Momjian 99308891ef Remove references to sa_family_t, except when SOCKADDR_STORAGE requires
it.

Also handle __ss_family as a synonym for ss_family.

Kurt Roeckx
2003-06-23 23:52:00 +00:00
Bruce Momjian 3bfabc36b6 Add mention that the grep's have to be adjusted in pgtest. 2003-06-23 19:33:25 +00:00
Tom Lane ab5c775116 Change pqInternalNotice to accept a format string and args instead of
just a preformatted message; per suggestion by Sean Chittenden.
2003-06-23 19:20:25 +00:00
Bruce Momjian 408625321c Remove crypt.h from fe-connect.c --- not needed, and caused problems on
Solaris with Open SSL version 0.9.7b
2003-06-23 17:03:19 +00:00
Tom Lane bff0422b6c Revise hash join and hash aggregation code to use the same datatype-
specific hash functions used by hash indexes, rather than the old
not-datatype-aware ComputeHashFunc routine.  This makes it safe to do
hash joining on several datatypes that previously couldn't use hashing.
The sets of datatypes that are hash indexable and hash joinable are now
exactly the same, whereas before each had some that weren't in the other.
2003-06-22 22:04:55 +00:00
Michael Meskes 36fe7577f8 Added missing terminating '\0' char for data put into char *. 2003-06-22 11:00:48 +00:00
Bruce Momjian c1ae39a0cd Add pgtest script. 2003-06-22 04:22:57 +00:00
Tom Lane dd81eee222 Use libpq's new logic to get the server version, instead of doing it ourselves. 2003-06-22 00:56:58 +00:00
Tom Lane e92dc1e199 Bring the libpq example programs into the 21st century. 2003-06-22 00:29:29 +00:00
Tom Lane 21e0b7b8f2 Get rid of extraneous newline in PQendcopy error output (was causing
regression test diffs...).
2003-06-21 23:25:38 +00:00
Tom Lane efc3a25bb0 Update libpq to make new features of FE/BE protocol available to
client applications.  Some editorial work on libpq.sgml, too.
2003-06-21 21:51:35 +00:00
Tom Lane 4342e6ea18 Fix for extended-query protocol: in event of error, backend was issuing
a ReadyForQuery (Z message) immediately and then another one after the
Sync message arrives.  Suppress the first one to make it work per spec.
2003-06-20 21:58:02 +00:00
Michael Meskes 94b59faeb7 Synced with backend. 2003-06-20 15:16:06 +00:00
Michael Meskes 2cbaaee6c3 Just another Informix compatibility change. They uses "free" for cursors as wellafter closing them. 2003-06-20 13:36:34 +00:00
Michael Meskes cf5ec3d12b Sorry, missed a file. 2003-06-20 12:01:46 +00:00
Michael Meskes abd310a3b1 Allow constants in using clauses. 2003-06-20 12:00:59 +00:00
Tom Lane 5fc9f3d574 We neglected to set conn->raddr.salen, leading to breakage of CANCEL
and probably other stuff.
2003-06-20 04:09:12 +00:00
Tom Lane 1bd22f55cf Disallow dollar sign in operator names, instead allow it as a non-first
character in identifiers.  The first change eliminates the current need
to put spaces around parameter references, as in "x<=$2".  The second
change improves compatibility with Oracle and some other RDBMSes.  This
was discussed and agreed to back in January, but did not get done.
2003-06-19 23:22:40 +00:00
Michael Meskes 8902aaaa6c Fixed fetch into char * and added missing prototype for an Informix function. 2003-06-19 09:52:11 +00:00
Peter Eisentraut f374a9dae9 Change clusterdb and vacuumdb into C programs. 2003-06-18 12:19:11 +00:00
Tom Lane eab5d643b2 Make FLOAT(p) measure the precision p in bits, not decimal digits, to
match the SQL standard.  Document FLOAT and FLOAT(p) notations in
datatype.sgml.  Per recent pghackers discussion.
2003-06-17 23:12:36 +00:00
Peter Eisentraut 596652d6eb More information schema views. 2003-06-17 18:00:48 +00:00
Peter Eisentraut 3d6fd2557c Add missing file to clean target. 2003-06-17 17:58:54 +00:00
Michael Meskes 8a2aa79fee Fixed several more parsing bugs. 2003-06-17 07:28:22 +00:00
Tom Lane f12f8990e4 Fix error line numbers reported for errors in plpgsql_parse_word and
siblings.
2003-06-17 04:35:03 +00:00
Tom Lane 3467b1a1f9 Fix bugs in interval-to-time conversion: HAVE_INT64_TIMESTAMP case did not
work at all, and neither case behaved sanely for negative intervals.
2003-06-16 18:56:45 +00:00
Michael Meskes 76924b5d94 Fixed two small bugs. 2003-06-16 16:58:11 +00:00
Tom Lane a499725469 Allow GROUP BY, ORDER BY, DISTINCT targets to be unknown literals,
silently resolving them to type TEXT.  This is comparable to what we
do when faced with UNKNOWN in CASE, UNION, and other contexts.  It gets
rid of this and related annoyances:
	select distinct f1, '' from int4_tbl;
	ERROR:  Unable to identify an ordering operator '<' for type unknown
This was discussed many moons ago, but no one got round to fixing it.
2003-06-16 02:03:38 +00:00
Tom Lane cb02610e50 Adjust nestloop-with-inner-indexscan plan generation so that we catch
some cases of redundant clauses that were formerly not caught.  We have
to special-case this because the clauses involved never get attached to
the same join restrictlist and so the existing logic does not notice
that they are redundant.
2003-06-15 22:51:45 +00:00
Tom Lane 3fb6f1347f Replace cryptic 'Unknown kind of return type' messages with something
hopefully a little more useful.
2003-06-15 17:59:10 +00:00
Tom Lane 996fdb9af1 Cause GROUP BY clause to adopt ordering operators from ORDER BY when
both clauses specify the same targets, rather than always using the
default ordering operator.  This allows 'GROUP BY foo ORDER BY foo DESC'
to be done with only one sort step.
2003-06-15 16:42:08 +00:00
Tom Lane da78e3e2eb index() -> strchr(). 2003-06-15 16:21:39 +00:00
Michael Meskes a0f29e3afd Typo in version number. 2003-06-15 12:06:50 +00:00
Michael Meskes 86a8331935 Some minor changes for new version numbering. 2003-06-15 11:10:09 +00:00
Bruce Momjian a64927f995 Ecpg cleanups for prototypes. 2003-06-15 04:56:45 +00:00
Bruce Momjian 228c02c3e5 Run autoconf/autoheader for ecpg change. 2003-06-15 04:09:18 +00:00
Bruce Momjian 4f70680177 Make ecpg thread safe.
Lee Kindness
2003-06-15 04:07:58 +00:00
Bruce Momjian ffa3bfbc30 Move thread os defines into template files. 2003-06-14 19:21:42 +00:00
Bruce Momjian 467839df26 Handle threading in two more gethostbyname calls. 2003-06-14 18:20:33 +00:00
Bruce Momjian a16a031411 Make libpq thread-safe with configure --with-threads option.
Lee Kindness
2003-06-14 17:49:54 +00:00
Bruce Momjian 62b532b736 Add thread.c for libpq threading, and hook it into libpq/configure. 2003-06-14 14:35:42 +00:00
Bruce Momjian 02d847fe9f Add --with-threads configure option to control threaded libpq. 2003-06-13 23:10:08 +00:00
Michael Meskes 26188e8c17 - Enable FETCH without INTO.
- Compatibility functions for INFORMIX handling of DECLARE statement.
2003-06-13 10:50:58 +00:00
Tom Lane a2d08b99c2 Okay, recognize freebsd 2.* and 3.* too. 2003-06-13 02:21:03 +00:00
Tom Lane bee114c38b Expect FreeBSD 5.* to have standard float arithmetic. 2003-06-13 01:50:50 +00:00
Bruce Momjian 41a10a13b1 Add thread-enable compile variables into libpq. 2003-06-12 17:31:50 +00:00
Tom Lane cc2fc4a71b Fix SQL function executor for case where last command of a function is
not a SELECT.  We didn't use to allow that, but we do now.
2003-06-12 17:29:26 +00:00
Michael Meskes b4117d8b1b Install all header files. 2003-06-12 12:52:24 +00:00
Bruce Momjian b14295cfe4 Attached is the complete diff against current CVS.
Compiles on BCC 5.5 and VC++ 6.0 (with warnings).

Karl Waclawek
2003-06-12 08:15:29 +00:00
Bruce Momjian dc4ee8a833 Back out patch that got bundled into another patch. 2003-06-12 08:11:07 +00:00
Bruce Momjian a647e30ba3 New patch with corrected README attached.
Also quickly added mention that it may be a qualified schema name.

Rod Taylor
2003-06-12 08:02:57 +00:00
Bruce Momjian ef2ba42717 Attached is a patch that enhances the output of psql's HTML mode.
The output now validates as HTML 4.01 Strict, XHTML 1.0 strict,
and XHTML 1.1 (assuming you wrap it in a valid html/body document).

It also wraps the output of PGRES_COMMAND_OK if the HTML tag is on,
for full compliance: this is why html_escaped_print has to be
externalized.

Greg Sabino Mullane greg@turnstep.com
2003-06-12 07:52:51 +00:00
Bruce Momjian e9cda08b2b Brief note about sequence cache not being cleared in other backends.
Actually clear the cache in the backend making the alteration.  This
follows in the footsteps of setval().

Rod Taylor
2003-06-12 07:49:43 +00:00
Bruce Momjian b4cea00a1f IPv6 cleanups.
Kurt Roeckx
Andrew Dunstan
2003-06-12 07:36:51 +00:00
Bruce Momjian e5549a272d Back out this patch because it is patched inside a later patch.
---------------------------------------------------------------------------

here is a patch that allows CIDR netmasks in pg_hba.conf. It allows two
address/mask forms:

. address/maskbits, or
. address netmask (as now)

If the patch is accepted I will submit a documentation patch to cover
it.

This is submitted by agreement with Kurt Roeckx, who has worked on a
patch that covers this and other IPv6 issues.
2003-06-12 07:00:57 +00:00
Bruce Momjian 1cef8ea790 I succeeded by fixing up setup.py:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
--- setup.py~   Tue Mar 19 08:21:14 2002
+++ setup.py    Wed May 14 15:10:30 2003
@@ -30,8 +30,8 @@
        optional_libs=[ 'libpqdll', 'wsock32', 'advapi32' ]
        data_files = [ 'libpq.dll' ]
 else:
-       include_dirs=['/usr/include/pgsql']
-       library_dirs=['usr/lib/pgsql']
+       include_dirs=['../../include','../libpq','/usr/include/pgsql']
+       library_dirs=['../libpq','/usr/lib/pgsql']
        optional_libs=['pq']
        data_files = []
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

George Young
2003-06-12 02:15:09 +00:00
Bruce Momjian b78961b0da Here is a patch that allows CIDR netmasks in pg_hba.conf. It allows two
address/mask forms:

. address/maskbits, or
. address netmask (as now)

If the patch is accepted I will submit a documentation patch to cover
it.

This is submitted by agreement with Kurt Roeckx, who has worked on a
patch that covers this and other IPv6 issues.

Andrew Dunstan
2003-06-12 02:12:58 +00:00
Bruce Momjian acd1536d9f Up to now, SerializableSnapshot and QuerySnapshot are malloc'ed and
free'd for every transaction or statement, respectively.  This patch
puts these data structures into static memory, thus saving a few CPU
cycles and two malloc calls per transaction or (in isolation level
READ COMMITTED) per query.

Manfred Koizar
2003-06-12 01:42:21 +00:00
Bruce Momjian 752a4dac50 psql: tab completion for \encoding
Ian Barwick
2003-06-12 01:38:08 +00:00
Bruce Momjian 4e1f986098 I found the libpq function PGunescapeBytea a little slow. It was taking a
minute and a half to decode a 500Kb on a fairly fast machine. I think the
culprit is sscanf.

I attach a patch that replaces the function with one used to perform the same
task in pyPgSQL (a Python interface to PostgreSQL). This code was written by
Billy Allie, author of pyPgSQL. I've changed a few variable names to match
those in the original code and removed a bit of Pythonness.

Billy has kindly looked at the code and points out that it is slightly
stricter than the original implementation and if it encounters an invalid
bytea such as '\12C' it drops the unescape '\' and outputs '12C'.

The code is licensed by the author under a BSD license.

I've performed limited testing of the function by putting JPEGs into
PostgreSQL, extracting them using them using the new function and diffing
against the original files.

The new function is significantly faster on my machine with the JPEGs being
decoded in less than a second. I attach a modified libpq example program that
I used for my testing.

Ben Lamb.
2003-06-12 01:17:19 +00:00
Bruce Momjian 0abe7431c6 This patch extracts page buffer pooling and the simple
least-recently-used strategy from clog.c into slru.c.  It doesn't
change any visible behaviour and passes all regression tests plus a
TruncateCLOG test done manually.

Apart from refactoring I made a little change to SlruRecentlyUsed,
formerly ClogRecentlyUsed:  It now skips incrementing lru_counts, if
slotno is already the LRU slot, thus saving a few CPU cycles.  To make
this work, lru_counts are initialised to 1 in SimpleLruInit.

SimpleLru will be used by pg_subtrans (part of the nested transactions
project), so the main purpose of this patch is to avoid future code
duplication.

Manfred Koizar
2003-06-11 22:37:46 +00:00
Bruce Momjian 240dc5cddc Add add_missing_from GUC variable.
Nigel J. Andrews
2003-06-11 22:13:22 +00:00
Bruce Momjian a24c5a7b12 Make "log_min_duration_statement" SUSET --- will be adjusted with new
USERLIMIT patch.
2003-06-11 18:49:00 +00:00
Tom Lane d2e028b1b0 Fix brain damage in deciding which python input converter to use. 2003-06-11 18:33:39 +00:00
Bruce Momjian b952d61c54 Add log_min_duration_statement.
Christopher Kings-Lynne
2003-06-11 18:01:14 +00:00
Tom Lane 8bfe93c5c8 pg_dump and pg_restore were stripping quotes and downcasing some but
not all SQL identifiers taken from command line arguments.  We decided
years ago that that was a bad idea: identifiers taken from the command
line should be treated as literally correct.  Remove the inconsistent
code that has crept in recently.  Also fix pg_dump so that the combination
of --schema and --table does what you'd expect, namely dump exactly one
table from exactly one schema.  Per gripe from Deepak Bhole of Red Hat.
2003-06-11 16:29:42 +00:00
Bruce Momjian 17386ac453 Well, the discussion about SSL a bit back perked my interest and I did
some reading on the subject.

1) PostgreSQL uses ephemeral keying, for its connections (good thing)

2) PostgreSQL doesn't set the cipher list that it allows (bad thing,
   fixed)

3) PostgreSQL's renegotiation code wasn't text book correct (could be
   bad, fixed)

4) The rate of renegotiating was insanely low (as Tom pointed out, set
   to a more reasonable level)

I haven't checked around much to see if there are any other SSL bits
that need some review, but I'm doing some OpenSSL work right now
and'll send patches for improvements along the way (if I find them).
At the very least, the changes in this patch will make security folks
happier for sure.  The constant renegotiation of sessions was likely a
boon to systems that had bad entropy gathering means (read: Slowaris
/dev/rand|/dev/urand != ANDIrand).  The new limit for renegotiations
is 512MB which should be much more reasonable.

Sean Chittenden
2003-06-11 15:05:50 +00:00
Bruce Momjian 535756649f During looking stuff up for a discussion on -general, I realized that
I'd placed the check for newly created matching pk rows for on update no
action earlier than it needed to be so that it'd check even when the key
values hadn't changed.  This patch moves it to after checking for NULLs
in the old row and comparing the values since the select's probably more
expensive.

Stephan Szabo
2003-06-11 15:02:25 +00:00
Bruce Momjian 9167a566d6 Add missing DLLIMPORT for cpu_index_tuple_cost to
src/include/optimizer/cost.h.

This is required to compile the PostGIS extension module with Cygwin
http://postgis.refractions.net

Norman Vine
2003-06-11 15:01:15 +00:00
Peter Eisentraut 8a2922dcb2 Represent grant options in the information schema. 2003-06-11 09:23:55 +00:00
Bruce Momjian 65fb311a97 Add Rendezvous support to postmaster, from Chris Campbell 2003-06-11 06:56:07 +00:00
Michael Meskes 1ca0b6d047 Make sure a variable is no longer referenced when it is removed.
Fixed counting bug in parsing "->" operator.
Removed that silly debugging function I accidently committed last night.
2003-06-11 06:39:13 +00:00
Bruce Momjian 8de72414ea Document the -h client flag can use a socket directory as well as a host
name.
2003-06-11 05:13:12 +00:00
Bruce Momjian b83f711dec Remove lock* GUC variables from postgresql.conf.
Document why certain GUC variables aren't in postgresql.conf.
2003-06-11 05:04:51 +00:00
Michael Meskes 65058fcf2b Fixed some bugs. 2003-06-10 17:46:43 +00:00
Tom Lane cdfb3d9981 freeaddrinfo2() does need two parameters after all, per comment by
Kurt Roeckx.  Add some documentation to try to prevent others from
repeating my mistake.
2003-06-09 17:59:19 +00:00
Tom Lane 6bdb7aa4db libpq can now talk to either 3.0 or 2.0 protocol servers. It first tries
protocol 3, then falls back to 2 if postmaster rejects the startup packet
with an old-format error message.  A side benefit of the rewrite is that
SSL-encrypted connections can now be made without blocking.  (I think,
anyway, but do not have a good way to test.)
2003-06-08 17:43:00 +00:00
Bruce Momjian b4b3e340e3 Add -DFRONTEND for non-MinGW Win32 ports. 2003-06-06 22:17:42 +00:00
Tom Lane 2bc84b6852 Add defense in assign_session_authorization() against trying to do
catalog lookups when not in a transaction.  This prevents bizarre
failures if someone tries to set a value for session_authorization in
postgresql.conf.  Per report from Fernando Nasser.
2003-06-06 16:25:35 +00:00
Tom Lane e649796f12 Implement outer-level aggregates to conform to the SQL spec, with
extensions to support our historical behavior.  An aggregate belongs
to the closest query level of any of the variables in its argument,
or the current query level if there are no variables (e.g., COUNT(*)).
The implementation involves adding an agglevelsup field to Aggref,
and treating outer aggregates like outer variables at planning time.
2003-06-06 15:04:03 +00:00
Peter Eisentraut 7ea8e491c8 Information schema views about functions 2003-06-05 16:08:47 +00:00
Peter Eisentraut 1fed74f257 Support for Intel compiler on Linux 2003-06-05 16:07:25 +00:00
Tom Lane 5369190220 Make the world at least marginally safe for usernames with embedded spaces.
Per recent gripe.
2003-06-02 19:00:29 +00:00
Bruce Momjian cb36e74ee6 In src/include/mb/pg_wchar.h we have:
#define PG_ENCODING_BE_LAST PG_ISO_8859_8
#define PG_ENCODING_FE_LAST PG_WIN1256

but the last client encoding in the enum list is actually PG_GB18030 and
it seems that

#define PG_ENCODING_IS_CLIEN_ONLY(_enc) \
                (((_enc) > PG_ENCODING_BE_LAST && (_enc) <= PG_ENCODING_FE_LAST)

can never be true.

I think the define should read
#define PG_ENCODING_FE_LAST PG_GB18030

On the other hand, perhaps no-one cares, because
PG_ENCODING_IS_CLIEN_ONLY is never used.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
2003-06-02 18:59:25 +00:00
Michael Meskes 45eebaf822 Fixed segfault in forward definition parsing. 2003-06-02 15:38:02 +00:00
Tom Lane d7e76d42f2 markTargetListOrigin neglected to handle outer-scope Vars properly;
per report from Joe Conway.
2003-05-31 19:03:34 +00:00
Tom Lane 9e1e72b698 Cause pg_dumpall to support the -a, -s, -x options of pg_dump. 2003-05-30 23:55:10 +00:00
Tom Lane df1df6bb90 Cause pg_dumpall to include GRANT/REVOKE for database-level permissions
in its output.  Make it work with server versions back to 7.0, too.
2003-05-30 22:55:16 +00:00
Tom Lane d24d75ff19 Small performance improvement for hash joins and hash aggregation:
when the plan is ReScanned, we don't have to rebuild the hash table
if there is no parameter change for its child node.  This idea has
been used for a long time in Sort and Material nodes, but was not in
the hash code till now.
2003-05-30 20:23:10 +00:00
Michael Meskes 776d530924 Create a real prototype function for describe. 2003-05-30 13:22:02 +00:00
Michael Meskes a0fed291dc Sync and some minor cleanup/fixing work plus an EXEC SQL DESCRIBE prototype. 2003-05-30 08:39:01 +00:00
Tom Lane 5666462f2e Ensure that in all flex lexers that are part of the backend, a
yy_fatal_error() call results in elog(ERROR) not exit().  This was
already fixed in the main lexer and plpgsql, but extend same technique
to all the other dot-l files.  Also, on review of the possible calls
to yy_fatal_error(), it seems safe to use elog(ERROR) not elog(FATAL).
2003-05-29 22:30:02 +00:00
Barry Lind 4fb5b92769 one more change to correctly support the removeall of autocommit 2003-05-29 21:44:47 +00:00
Tom Lane 9fbd52808e Adopt latest bison's spelling of 'syntax error' rather than 'parse error'
for grammar-detected problems.  Revert Makefile hack that kept it looking
like the pre-bison-1.875 output.
2003-05-29 20:40:36 +00:00
Tom Lane 268313a95b Don't explicitly close() the session socket during backend exit; instead
leave it for the kernel to do after the process dies.  This allows clients
to wait for the backend to exit if they wish (after sending X message,
wait till EOF is detected on the socket).
2003-05-29 19:15:34 +00:00
Tom Lane 9f47c4cc5c AFAICT, none of our shared libraries are anywhere near big enough to
need -fPIC on HPPA.  Reduce to -fpic.
2003-05-29 18:08:42 +00:00
Michael Meskes 196d0dd10b Changed variable parsing so struct[n].attr works. 2003-05-29 13:59:26 +00:00
Michael Meskes bbe9902223 Parse forward definiton of structs. 2003-05-29 12:00:22 +00:00
Barry Lind 9e2a980f62 Applied patch from Fernando Nasser to fix up small type error 2003-05-29 04:52:44 +00:00
Barry Lind ece84bf819 Applied patch from Fernando Nasser to improve buffer sizes to avoid unnecessary resizing. 2003-05-29 04:48:33 +00:00
Barry Lind fb630cc49f clean up warnings produced by Eclipse 2003-05-29 04:39:51 +00:00
Barry Lind 35511088d3 Adding .cvsignore files for Eclipse IDE 2003-05-29 04:04:08 +00:00
Barry Lind 1b6e600bfe Up the build number to reflect the changes for V3 protocol support 2003-05-29 03:22:48 +00:00
Barry Lind a9983ab414 Initial attempt to integrate in V3 protocol support. This is still a work in
progress, although all RTs pass using the V3 protocol on a 7.4 database and also pass using the V2 protocol on a 7.3 database.
SSL support is known not to work.

 Modified Files:
 	jdbc/org/postgresql/PGConnection.java
 	jdbc/org/postgresql/errors.properties
 	jdbc/org/postgresql/core/BaseConnection.java
 	jdbc/org/postgresql/core/Encoding.java
 	jdbc/org/postgresql/core/Field.java
 	jdbc/org/postgresql/core/PGStream.java
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/core/StartupPacket.java
 	jdbc/org/postgresql/fastpath/Fastpath.java
 	jdbc/org/postgresql/fastpath/FastpathArg.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/test/jdbc2/BlobTest.java
 	jdbc/org/postgresql/test/jdbc2/CallableStmtTest.java
 	jdbc/org/postgresql/test/jdbc2/MiscTest.java
 	jdbc/org/postgresql/test/jdbc3/Jdbc3TestSuite.java
2003-05-29 03:21:32 +00:00
Tom Lane d998fac953 Add a regression test to catch future silliness in the index-building
area...
2003-05-29 01:09:13 +00:00
Tom Lane f3707d0705 Fix stupid oversight :-( 2003-05-29 00:54:42 +00:00
Tom Lane 7c7139cf29 Knock down a couple more lappend() hotspots for large WHERE clauses. 2003-05-28 23:06:16 +00:00
Tom Lane 8a6ac83dab Fix some planner performance problems with large WHERE clauses, by
introducing new 'FastList' list-construction subroutines to use in
hot spots.  This avoids the O(N^2) behavior of repeated lappend's
by keeping a tail pointer, while not changing behavior by reversing
list order as the lcons() method would do.
2003-05-28 22:32:50 +00:00
Tom Lane 0f3c68aa43 Fix breakage of LINUX_PROFILE code due to recent Windows changes. 2003-05-28 19:36:28 +00:00
Tom Lane 4df52b28f0 Fix things so that an error occuring during standalone-backend processing
in initdb will result in exit(1), allowing the initdb script to realize
that there's something wrong.
2003-05-28 18:19:09 +00:00
Tom Lane aae078198d In bootstrap and standalone-backend modes, do not sort LOG elevel out
of order; the 'server log' output is actually client output in these
scenarios and we ought to treat elevels the same way as in the client
case.  This allows initdb to not send backend stderr to /dev/null anymore,
which makes it much more likely that people will notice problems during
initdb.
2003-05-28 17:25:02 +00:00
Tom Lane fc8d970cbc Replace functional-index facility with expressional indexes. Any column
of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
2003-05-28 16:04:02 +00:00
Peter Eisentraut a6f01d1aa6 Internationalize interactive yes/no responses. 2003-05-27 19:36:55 +00:00
Bruce Momjian aea0270c23 Make log_ GUC settings controllable only by super-users, so non-super
users can't turn it off.
2003-05-27 17:55:50 +00:00
Bruce Momjian 98b6f37e47 Make debug_ GUC varables output DEBUG1 rather than LOG, and mention in
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location.
Doc changes included.
2003-05-27 17:49:47 +00:00
Bruce Momjian 24daeb8e73 Add configure thread tests. 2003-05-27 16:36:50 +00:00
Michael Meskes e185583a37 Allow input from stdin and output to stdout. 2003-05-27 14:36:00 +00:00
Michael Meskes 677844560f Fixed incorrect output for some structs. 2003-05-27 11:31:52 +00:00
Tom Lane 5493ecc3a5 Adjust error-handling logic in libpq. For the first time, libpq copes
sanely with running out of memory for a query result.
2003-05-26 20:05:20 +00:00
Tom Lane 8c43300ccc Make sure printtup() always sends the number of columns previously
advertised in RowDescription message.  Depending on the physical tuple's
column count is not really correct, since according to heap_getattr()
conventions the tuple may be short some columns, which will automatically
get read as nulls.  Problem has been latent since forever, but was only
exposed by recent change to skip a projection step in SELECT * FROM...
2003-05-26 17:51:38 +00:00
Bruce Momjian bb9f84aad7 Remove comment that cbrt() isn't being used. 2003-05-26 00:55:25 +00:00
Tom Lane f45df8c014 Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailing
blanks, in hopes of reducing the surprise factor for newbies.  Remove
redundant operators for VARCHAR (it depends wholly on TEXT operations now).
Clean up resolution of ambiguous operators/functions to avoid surprising
choices for domains: domains are treated as equivalent to their base types
and binary-coercibility is no longer considered a preference item when
choosing among multiple operators/functions.  IsBinaryCoercible now correctly
reflects the notion that you need *only* relabel the type to get from type
A to type B: that is, a domain is binary-coercible to its base type, but
not vice versa.  Various marginal cleanup, including merging the essentially
duplicate resolution code in parse_func.c and parse_oper.c.  Improve opr_sanity
regression test to understand about binary compatibility (using pg_cast),
and fix a couple of small errors in the catalogs revealed thereby.
Restructure "special operator" handling to fetch operators via index opclasses
rather than hardwiring assumptions about names (cleans up the pattern_ops
stuff a little).
2003-05-26 00:11:29 +00:00
Peter Eisentraut 297c1658ed Information schema improvements 2003-05-25 09:36:09 +00:00
Bruce Momjian 310049a19b Clean up our static cbrt() implementation in float.c. 2003-05-25 05:30:57 +00:00
Tom Lane 11d5c82002 Improve implementation of btrim/ltrim/rtrim: provide a special case for
single-byte encodings, and a direct C implementation of the single-argument
forms (where spaces are always what gets trimmed).  This is in preparation
for using rtrim1() as the bpchar-to-text cast operator, but is a useful
performance improvement even if we decide not to do that.
2003-05-23 22:33:23 +00:00
Michael Meskes 813d9960d2 Forgot these. 2003-05-23 15:22:38 +00:00
Michael Meskes d258fb91cf ecpg now accepts array elements as arguments. 2003-05-23 15:19:36 +00:00
Tom Lane 450d7e276e Seems pl_funcs didn't have support for plpgsql PERFORM statement. 2003-05-23 04:08:34 +00:00
Bruce Momjian 77645b99f4 Add define for missing EAI_ADDRFAMILY in BSD/OS 4.3. 2003-05-22 19:14:25 +00:00
Peter Eisentraut 6fabec242d Fix compilation on Cygwin. 2003-05-22 17:20:44 +00:00
Tom Lane cef0652a3d Add defense against possibility that tzname[] doesn't exist. 2003-05-22 17:13:08 +00:00
Michael Meskes dbd55d3a5b Fixed segfault when detecting undefined cursor. 2003-05-22 17:09:00 +00:00
Tom Lane c120f4ba0a Adjust configure so that extern tzname[] will be checked for
independently of whether the struct tm tm_zone member exists.
Also run autoheader, which seems not to have been done lately;
it added about three more things to pg_config.h.in than I was expecting...
2003-05-22 16:39:30 +00:00
Tom Lane 39e98d9563 Repair sometimes-incorrect computation of StartUpID after a crash, per
example from Rao Kumar.  This is a very corner corner-case, requiring
a minimum of three closely-spaced database crashes and an unlucky
positioning of the second recovery's checkpoint record before you'd notice
any problem.  But the consequences are dire enough that it's a must-fix.
2003-05-22 14:39:28 +00:00
Michael Meskes d03a067ba0 ecpg now recognizes named structs/unions. So you don't have to list the whole definition everytime you declare a variable anymore. 2003-05-22 07:58:45 +00:00
Tom Lane 0b5b3e9e65 Fix coredump in pg_get_triggerdef, ensure function name is schema-
qualified when necessary, simplify argument-printing code.
2003-05-20 20:35:10 +00:00
Michael Meskes dc554458ad Reversed my incorrect fix. 2003-05-20 11:05:27 +00:00
Tom Lane 9ecba0c2f8 Use -fPIC on Sparc, per Tom Callaway. 2003-05-19 17:51:01 +00:00
Bruce Momjian 36adb2e095 Rename Win32 include directory from win32_include to win32. 2003-05-19 17:31:59 +00:00
Michael Meskes 08d7e1c20e Fixed exec sql ifdef command. 2003-05-19 07:19:57 +00:00
Peter Eisentraut f89c972ac8 Add documentation for information schema, and some corrections on some
views.
2003-05-18 20:55:57 +00:00
Tom Lane 6d7ff848e5 Add code to test for unknown timezone names (following some ideas from
Ross Reedstrom, a couple months back) and to detect timezones that are
using leap-second timekeeping.  The unknown-zone-name test is pretty
heuristic and ugly, but it seems better than the old behavior of just
switching to GMT given a bad name.  Also make DecodePosixTimezone() a
tad more robust.
2003-05-18 01:06:26 +00:00
Tom Lane 6d8c774f55 Fix breakage induced by recent patch (careless use of fmtId()). 2003-05-17 15:53:12 +00:00
Tom Lane f9b232f019 Small changes to use the absolute path to system catalogs.
Greg Sabino Mullane
2003-05-16 13:37:00 +00:00
Michael Meskes 3d41da50f7 Made variable type double work again. 2003-05-16 11:30:09 +00:00
Michael Meskes 7e684fad02 Fixed incorrect include and another typo. Sorry, the include did not create a warning/error/problem on my machine, so I didn't notice it. 2003-05-16 09:42:56 +00:00
Bruce Momjian c42581eba3 Allow interfaces to compile under MingGW/Win32 by adding _P to symbols
in ecpg.
2003-05-16 04:59:24 +00:00
Tom Lane 32be7207aa Revert kerberos code breakage. 2003-05-16 04:58:03 +00:00
Bruce Momjian 9ea764a0dc Remove use of geteuid under Win32. 2003-05-16 02:40:19 +00:00
Bruce Momjian ec5e0ef791 Reorganize Win32 includes to only include <port.h> after system includes
under Win32.  Also fix other compile issues.
2003-05-16 01:57:52 +00:00
Tom Lane 5e04f3857c Revert change of inclusion order for pg_config_os.h; this broke plperl
on Linux and would have who knows what unpleasant effects on other platforms.
If you need another include file for Windows, then add it; don't go
messing with the semantics of every other port's include files.
2003-05-15 23:39:27 +00:00
Tom Lane 9e43184b9d Add missing #include. 2003-05-15 19:34:46 +00:00
Bruce Momjian 09aad5a3a6 Add copydir() function because xcopy doesn't work in XP without a
window.
2003-05-15 17:59:17 +00:00
Bruce Momjian bee0ac67ee Add missing win32 file --- seems best way to find these is to just
commmit then do a cvs update again.
2003-05-15 16:40:29 +00:00
Bruce Momjian 12c9423832 Allow Win32 to compile under MinGW. Major changes are:
Win32 port is now called 'win32' rather than 'win'
        add -lwsock32 on Win32
        make gethostname() be only used when kerberos4 is enabled
        use /port/getopt.c
        new /port/opendir.c routines
        disable GUC unix_socket_group on Win32
        convert some keywords.c symbols to KEYWORD_P to prevent conflict
        create new FCNTL_NONBLOCK macro to turn off socket blocking
        create new /include/port.h file that has /port prototypes, move
          out of c.h
        new /include/port/win32_include dir to hold missing include files
        work around ERROR being defined in Win32 includes
2003-05-15 16:35:30 +00:00
Peter Eisentraut 2c0556068f Indexing support for pattern matching operations via separate operator
class when lc_collate is not C.
2003-05-15 15:50:21 +00:00
Tom Lane 2a2f6cfa39 Fix oversight: ignore-till-SYNC state should not ignore EOF ... 2003-05-14 18:40:37 +00:00
Tom Lane 22c4caef12 Add text(cidr) cast, per recent discussion. I'm not bothering to
force an initdb for this.
2003-05-14 18:08:15 +00:00
Michael Meskes 4e1ed3da9b - Added more compatibility functions.
- Accept CPP defines for type definitions.
	- Do not parse system include files automatically for Informix mode
2003-05-14 14:37:36 +00:00
Tom Lane f85f43dfb5 Backend support for autocommit removed, per recent discussions. The
only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON.  Still TODO: provide some client-side autocommit
logic in libpq.
2003-05-14 03:26:03 +00:00
Tom Lane d9b679c13a In RowDescription messages, report columns of domain datatypes as having
the type OID and typmod of the underlying base type.  Per discussions
a few weeks ago with Andreas Pflug and others.  Note that this behavioral
change affects both old- and new-protocol clients.
2003-05-13 18:39:50 +00:00
Tom Lane 0249c24235 More binary I/O routines. 2003-05-13 18:03:08 +00:00
Michael Meskes 72f311b86a Fixed order of include file search path. 2003-05-13 11:29:14 +00:00
Tom Lane 1c9ac7dfd0 Change pg_amop's index on (amopclaid,amopopr) to index (amopopr,amopclaid).
This makes no difference for existing uses, but allows SelectSortFunction()
and pred_test_simple_clause() to use indexscans instead of seqscans to
locate entries for a particular operator in pg_amop.  Better yet, they can
use the SearchSysCacheList() API to cache the search results.
2003-05-13 04:38:58 +00:00
Tom Lane 30f609484d Add binary I/O routines for a bunch more datatypes. Still a few to go,
but that was enough tedium for one day.  Along the way, move the few
support routines for types xid and cid into a more logical place.
2003-05-12 23:08:52 +00:00
Tom Lane b02832719c Avoid unnecessary copying of parameter values in BIND. This allows
efficient insertion of large bytea values through the BIND interface.
2003-05-12 16:48:17 +00:00
Tom Lane d97c9b3662 Apply fixes for problems with dropped columns whose types have also been
dropped.  The simplest fix for INSERT/UPDATE cases turns out to be for
preptlist.c to insert NULLs of a known-good type (I used INT4) rather
than making them match the deleted column's type.  Since the representation
of NULL is actually datatype-independent, this should work fine.
I also re-reverted the patch to disable the use_physical_tlist optimization
in the presence of dropped columns.  It still doesn't look worth the
trouble to be smarter, if there are no other bugs to fix.
Added a regression test to catch future problems in this area.
2003-05-12 00:17:03 +00:00
Tom Lane a7c50cd92b Finish removing HPUXMATHLIB. 2003-05-11 20:50:53 +00:00
Tom Lane 6f261461c1 Revert previous change --- turns out the underlying problem affects
more cases than I thought, so ExecTypeFromTL() will have to be fixed
anyway.
2003-05-11 20:25:50 +00:00
Tom Lane 8f2e53bc10 Disable the recently-added use_physical_tlist optimization in cases
where the table contains dropped columns.  If the columns are dropped,
then their types may be gone as well, which causes ExecTypeFromTL() to
fail if the dropped columns appear in a plan node's tlist.  This could
be worked around but I don't think the optimization is valuable enough
to be worth the trouble.
2003-05-11 15:03:52 +00:00
Tom Lane a4e775a263 Make use of new error context stack mechanism to allow random errors
detected during buffer dump to be labeled with the buffer location.
For example, if a page LSN is clobbered, we now produce something like
ERROR:  XLogFlush: request 2C000000/8468EC8 is not satisfied --- flushed only
to 0/8468EF0
CONTEXT:  writing block 0 of relation 428946/566240
whereas before there was no convenient way to find out which page had
been trashed.
2003-05-10 19:04:30 +00:00
Tom Lane ecc8c3652e In child-crashed log messages, identify a checkpoint process as such
instead of calling it a 'server process'.
2003-05-10 18:15:42 +00:00
Tom Lane 8d86a96068 Adjust CreateCheckpoint so that buffer dumping activities and cleanup of
dead xlog segments are not considered part of a critical section.  It is
not necessary to force a database-wide panic if we get a failure in these
operations.  Per recent trouble reports.
2003-05-10 18:01:31 +00:00
Bruce Momjian 199f24e19d More crypt() cleanup. 2003-05-10 04:06:55 +00:00
Bruce Momjian 37627eb571 Remove HPUX 9 rint() test.
Cleanup new crypt() source code.
2003-05-10 04:03:37 +00:00
Bruce Momjian cb8b1299a3 Add Makefile rules for new crypt/rint() /port functions. Add include
for rint prototype.
2003-05-10 02:05:50 +00:00
Tom Lane ba1e066e46 Implement array_send/array_recv (binary I/O for arrays). This exposed
the folly of not passing element type to typsend/typreceive, so fix that.
2003-05-09 23:01:45 +00:00
Tom Lane b1ee615a7f COPY BINARY uses the new binary I/O routines. Update a few more datatypes
so that COPY BINARY regression test passes.
2003-05-09 21:19:50 +00:00
Tom Lane 38d9919d1a Now that fastpath protocol allows null arguments to be passed,
fastpath.c had better check for strict functions.
2003-05-09 18:18:54 +00:00
Tom Lane 0ac6298bb8 Implement new-protocol binary I/O support in DataRow, Bind, and FunctionCall
messages.  Binary I/O is now up and working, but only for a small set
of datatypes (integers, text, bytea).
2003-05-09 18:08:48 +00:00
Bruce Momjian d85a0a6bef More cleanups now that we have crypt(). 2003-05-09 16:59:43 +00:00
Bruce Momjian 66e0a8cb39 Add crypt() to /port for Win32. 2003-05-09 16:52:11 +00:00
Bruce Momjian 89eae96b2f Remove rint() prototype from QNX. 2003-05-09 16:35:57 +00:00
Bruce Momjian 3afb84cd0f Remove another old rint() replacement. 2003-05-09 16:31:24 +00:00
Bruce Momjian 0afe5417d7 Add rint() to /port, remove from qnx/. 2003-05-09 16:26:29 +00:00
Bruce Momjian 995773be1c Pass canAcceptConnections to exec'ed backend, for Jan. 2003-05-09 15:57:24 +00:00
Tom Lane 5ecd4e3f30 Binary send/receive routines for a few basic datatypes --- enough for
testing purposes.
2003-05-09 15:44:42 +00:00
Bruce Momjian 4207d6bf30 Add opendir/readdir/closedir() for Win32.
Keep SRA copyright on file because it contains BSD license clause.
2003-05-09 01:16:29 +00:00
Tom Lane 45d04099df Reinstate pg_type's typsend and typreceive columns. They don't do much
yet, but they're there.  Also some editorial work on CREATE TYPE reference
page.
2003-05-08 22:19:58 +00:00
Bruce Momjian f2c7a27635 Write non-defaults file before signalling the children to reread it. 2003-05-08 20:43:07 +00:00
Bruce Momjian 789a5b340c Move attached to shared memory out into a separate function for clarity. 2003-05-08 19:17:07 +00:00