Commit Graph

11355 Commits

Author SHA1 Message Date
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
Tom Lane 075a0078df I think we're done with protocol instability, so mark server and libpq
as speaking the one true 3.0 protocol.
2003-05-08 18:33:39 +00:00
Tom Lane c0a8c3ac13 Update 3.0 protocol support to match recent agreements about how to
handle multiple 'formats' for data I/O.  Restructure CommandDest and
DestReceiver stuff one more time (it's finally starting to look a bit
clean though).  Code now matches latest 3.0 protocol document as far
as message formats go --- but there is no support for binary I/O yet.
2003-05-08 18:16:37 +00:00
Bruce Momjian 5e7a5c9511 Pass shared memory address on command line to exec'ed backend.
Allow backends to attached to specified shared memory address.
2003-05-08 14:49:04 +00:00
Bruce Momjian 07d35e4277 Change alternate database location patch to test for symlink() rather
than WIN32.
2003-05-07 03:47:08 +00:00
Barry Lind 137b123fc7 Fixed bug with Warnings. Warnings are not added to the Statement instead of
the connection when appropriate.
This checkin also adds the type map for jdbc3, however currently it is
identical to the jdbc2 mapping.

 Modified Files:
 	jdbc/org/postgresql/core/BaseStatement.java
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/jdbc3/AbstractJdbc3Connection.java
2003-05-07 03:03:30 +00:00
Bruce Momjian d9fd7d12f6 Pass shared memory id and socket descriptor number on command line for
fork/exec.
2003-05-06 23:34:56 +00:00
Tom Lane 755d191700 Add display of eventual result RowDescription (if any) to the output
of Describe on a prepared statement.  This was in the original 3.0
protocol proposal, but I took it out for reasons that seemed good at
the time.  Put it back per yesterday's pghackers discussion.
2003-05-06 21:51:42 +00:00
Tom Lane 8f6a6b7e9a Ensure that an Execute operation can't send tuples in cases where
Describe would claim that no tuples will be returned.  Only affects
SELECTs added to non-SELECT base queries by rewrite rules.  If you
want to see the output of such a select, you gotta use 'simple Query'
protocol.
2003-05-06 21:01:04 +00:00
Tom Lane 79913910d4 Restructure command destination handling so that we pass around
DestReceiver pointers instead of just CommandDest values.  The DestReceiver
is made at the point where the destination is selected, rather than
deep inside the executor.  This cleans up the original kluge implementation
of tstoreReceiver.c, and makes it easy to support retrieving results
from utility statements inside portals.  Thus, you can now do fun things
like Bind and Execute a FETCH or EXPLAIN command, and it'll all work
as expected (e.g., you can Describe the portal, or use Execute's count
parameter to suspend the output partway through).  Implementation involves
stuffing the utility command's output into a Tuplestore, which would be
kind of annoying for huge output sets, but should be quite acceptable
for typical uses of utility commands.
2003-05-06 20:26:28 +00:00
Michael Meskes 299fbb4b37 Added rfmtlong compatibility function. 2003-05-06 09:48:25 +00:00
Bruce Momjian 3ad406bbc9 Rename internal variables DBName|dbName to dbname, for consistency. 2003-05-06 05:15:45 +00:00
Bruce Momjian 77a0219ab1 Comment out some of the conditional tests until we have exec().
Reorder non-default variable loading until PGDATA is defined.
2003-05-06 04:16:35 +00:00
Tom Lane 2cf57c8f8d Implement feature of new FE/BE protocol whereby RowDescription identifies
the column by table OID and column number, if it's a simple column
reference.  Along the way, get rid of reskey/reskeyop fields in Resdoms.
Turns out that representation was not convenient for either the planner
or the executor; we can make the planner deliver exactly what the
executor wants with no more effort.
initdb forced due to change in stored rule representation.
2003-05-06 00:20:33 +00:00
Tom Lane 94a3c60324 Ditch ExecGetTupType() in favor of the much simpler ExecGetResultType(),
which does the same thing.  Perhaps at one time there was a reason to
allow plan nodes to store their result types in different places, but
AFAICT that's been unnecessary for a good while.
2003-05-05 17:57:47 +00:00
Tom Lane 20aea2ec7b Alter plpgsql's lexer so that yylineno and yymore are not used. This
avoids 'input buffer overflow' failure on long literals, improves
performance, gives the right answer for line position in functions
containing multiline literals, suppresses annoying compiler warnings,
and generally is so much better I wonder why we didn't do it before.
2003-05-05 16:46:28 +00:00