Commit Graph

3142 Commits

Author SHA1 Message Date
df559de9c1 interval.c needs limits.h 2008-11-26 16:47:08 +00:00
7c5a561f31 Applied patch by Ron Mayer <rm_pg@cheapcomplexdevices.com> to merge the new
interval style into ecpg.
2008-11-26 16:31:02 +00:00
cbb3e1cda7 Tweak new PQExpBufferBroken macro to suppress warnings from pickier
versions of gcc.
2008-11-26 16:23:11 +00:00
ba34215269 Removed strchrnul 2008-11-26 15:35:30 +00:00
c4a13c7e3c When creating a varchar struct name braces must be discarded. 2008-11-26 13:18:22 +00:00
a53536d031 Add %expect 0 to all parser input files to prevent conflicts slipping by. 2008-11-26 08:45:12 +00:00
739259d62e Adjust the behavior of the PQExpBuffer code to make it have well-defined
results (ie, an empty "broken" buffer) if memory overrun occurs anywhere
along the way to filling the buffer.  The previous coding would just silently
discard portions of the intended buffer contents, as exhibited in trouble
report from Sam Mason.  Also, tweak psql's main loop to correctly detect
and report such overruns.  There's probably much more that should be done
in this line, but this is a start.
2008-11-26 00:26:23 +00:00
1304f297a4 Remove PGINTERVALSTYLE from the set of special environment variables for
libpq.  As noted by Peter, adding this variable created a risk of unexpected
connection failures when talking to older server versions, and since it
doesn't do anything you can't do with PGOPTIONS, it doesn't seem really
necessary.  Removing it does occasion a few extra lines in pg_regress.c,
but saving a getenv() call per libpq connection attempt is perhaps worth
that anyway.
2008-11-25 19:30:42 +00:00
47ed197c37 Disable FNM_CASEFOLD. Need a proper solution later, but just comment
it out for now so the buildfarm recovers.
2008-11-24 19:19:46 +00:00
cb10467d30 Add support for matching wildcard server certificates to the new SSL code.
This uses the function fnmatch() which is not available on all platforms
(notably Windows), so import the implementation from NetBSD into src/port.
2008-11-24 09:15:16 +00:00
30f272a79b Add missing dependencies to preproc.y build rule 2008-11-15 22:20:55 +00:00
f30a1d0474 Add missing semicolon, per grip from Alex Hunsaker. 2008-11-15 22:18:05 +00:00
fbaa172d65 ecpg's preproc.y is now generated as needed, so remove from CVS. 2008-11-14 17:43:14 +00:00
1a0bbc296c Improve comment about when to clean generated files. 2008-11-14 17:18:20 +00:00
b78f9b496d Enable script to generate preproc.y in build process. 2008-11-14 17:11:40 +00:00
a76e98f021 Fixed test for output_filename == stdout. 2008-11-14 16:25:34 +00:00
e339ed5f50 Added files containing changes between gram.y and preproc.y. 2008-11-14 10:03:33 +00:00
4607c5ca56 Adding script that generates preproc.y from gram.y to CVS. 2008-11-14 10:01:04 +00:00
53f93cbb20 Updated parser file to the one generated by the latest version of parse.[awk|pl] from the latest version of gram.y
Some small corrections to test suite.
2008-11-13 11:54:39 +00:00
c89404edf3 Fix libpq certificate validation for SSL connections.
Add config parameter "sslverify" to control the verification. Default
is to do full verification.

Clean up some old SSL code that never really worked.
2008-11-13 09:45:25 +00:00
c7f5c7c128 Replaced manually synced preproc.y by the one created by the new script.
Adapted regression test files accordingly.
2008-11-11 11:41:24 +00:00
df7641e25a Add a new GUC variable called "IntervalStyle" that decouples interval output
from DateStyle, and create a new interval style that produces output matching
the SQL standard (at least for interval values that fall within the standard's
restrictions).  IntervalStyle is also used to resolve the conflict between the
standard and traditional Postgres rules for interpreting negative interval
input.

Ron Mayer
2008-11-09 00:28:35 +00:00
5e75a5dca9 Fix incorrect comment in SSL code 2008-11-03 14:18:57 +00:00
492059daba Move from strcmp to strncmp to be more tolerant for changes to the parser. 2008-11-01 19:53:35 +00:00
ef9ed9b6aa Use string component in index structure. 2008-11-01 12:42:14 +00:00
e6c7f7c1ad Do not eat memory even in case of an out-of-memory error. 2008-11-01 08:55:21 +00:00
06735e3256 Unicode escapes in strings and identifiers 2008-10-29 08:04:54 +00:00
8ecd535169 Add WITH [NO] DATA clause to CREATE TABLE AS, per SQL.
Also, since WITH is now a reserved word, simplify the token merging code to
only deal with WITH_TIME.

by Tom Lane and myself
2008-10-28 14:09:45 +00:00
53a5026b5c Remove support for (insecure) crypt authentication.
This breaks compatibility with pre-7.2 versions.
2008-10-28 12:10:44 +00:00
f3a0688ace Add support for multiple error messages from libpq, by simply appending them
after each other (since we already add a newline on each, this makes them
multiline).

Previously a new error would just overwrite the old one, so for example any
error caused when trying to connect with SSL enabled would be overwritten
by the error message form the non-SSL connection when using sslmode=prefer.
2008-10-27 09:42:31 +00:00
0fec77ae88 SQL:2008 syntax CURRENT_CATALOG, CURRENT_SCHEMA, SET CATALOG, SET SCHEMA. 2008-10-27 09:37:47 +00:00
b1eeeb20d9 Update standalong libpq makefiles for msvc and bcc to work with the new
libpq events code.

Hiroshi Saito
2008-10-27 09:10:04 +00:00
bb8c822dbf Remove notes from the frontend SSL source that are incorrect or
end-user documentation that lives in the actual documentation.
2008-10-24 12:29:11 +00:00
501e58ba4e Fix memory leak when using gsslib parameter in libpq connections 2008-10-23 16:17:19 +00:00
831abae506 Clean regression.out 2008-10-21 10:51:24 +00:00
1471e3843d Allow SQL:2008 syntax ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE
alongside our traditional syntax.
2008-10-21 08:38:16 +00:00
f346a232ed Fixed parsing of parameters. Added regression test for this. 2008-10-14 09:31:05 +00:00
9d3275e59d Fixed "create role" parsing to accept optional "with" argument. 2008-10-10 12:17:18 +00:00
059349be0c Synced parser. 2008-10-07 12:43:55 +00:00
44d5be0e53 Implement SQL-standard WITH clauses, including WITH RECURSIVE.
There are some unimplemented aspects: recursive queries must use UNION ALL
(should allow UNION too), and we don't have SEARCH or CYCLE clauses.
These might or might not get done for 8.4, but even without them it's a
pretty useful feature.

There are also a couple of small loose ends and definitional quibbles,
which I'll send a memo about to pgsql-hackers shortly.  But let's land
the patch now so we can get on with other development.

Yoshiyuki Asaba, with lots of help from Tatsuo Ishii and Tom Lane
2008-10-04 21:56:55 +00:00
233f135144 Link libpq with libgssapi if configure finds it, as
required by at least NetBSD.

Markus Schaaf
2008-10-01 15:35:32 +00:00
61d9674988 Make LC_COLLATE and LC_CTYPE database-level settings. Collation and
ctype are now more like encoding, stored in new datcollate and datctype
columns in pg_database.

This is a stripped-down version of Radek Strnad's patch, with further
changes by me.
2008-09-23 09:20:39 +00:00
c52aab5525 Get rid of pgpass_from_client tracking inside libpq --- given the conclusion
that presence of the password in the conninfo string must be checked *before*
risking a connection attempt, there is no point in checking it afterwards.
This makes the specification of PQconnectionUsedPassword() a bit simpler
and perhaps more generally useful, too.
2008-09-22 14:21:44 +00:00
cae7ad906a Fix dblink_connect() so that it verifies that a password is supplied in the
conninfo string *before* trying to connect to the remote server, not after.
As pointed out by Marko Kreen, in certain not-very-plausible situations
this could result in sending a password from the postgres user's .pgpass file,
or other places that non-superusers shouldn't have access to, to an
untrustworthy remote server.  The cleanest fix seems to be to expose libpq's
conninfo-string-parsing code so that dblink can check for a password option
without duplicating the parsing logic.

Joe Conway, with a little cleanup by Tom Lane
2008-09-22 13:55:14 +00:00
3290e6180f Add a PQfireResultCreateEvents function to allow applications to mimic the
sequence of operations that libpq goes through while creating a PGresult.
Also, remove ill-considered "const" decoration on parameters passed to
event procedures.
2008-09-19 20:06:13 +00:00
e2b7d0c65c Improve the recently-added libpq events code to provide more consistent
guarantees about whether event procedures will receive DESTROY events.
They no longer need to defend themselves against getting a DESTROY
without a successful prior CREATE.

Andrew Chernow
2008-09-19 16:40:40 +00:00
90d910866e Add additional rules so that make init-po for ecpg gets up to date flex and
bison output.  Without these, make can sometimes be tempted to invoke its
built-in rules using lex and yacc, which can fail if those commands are not
available.

This was a main cause for the NLS web site breakage.
2008-09-19 13:08:08 +00:00
32f159cc55 Add an "events" system to libpq, whereby applications can get callbacks that
enable them to manage private data associated with PGconns and PGresults.

Andrew Chernow and Merlin Moncure
2008-09-17 04:31:08 +00:00
bacf7b2086 Avoid using sprintf() for a simple octal conversion in PQescapeByteaInternal.
Improves performance, per suggestion from Rudolf Leitgeb (bug #4414).
The backend did this right already, but not libpq.
2008-09-10 17:01:07 +00:00
76c39cf3be Sigh, I missed checking the ecpg tests ... 2008-09-01 21:42:18 +00:00