Commit Graph

9239 Commits

Author SHA1 Message Date
Tom Lane
9371325042 Remove a bunch more no-longer-used stuff in libpq-be.h. 2001-11-12 05:43:25 +00:00
Tom Lane
7be18072db Suppress duplicate error messages in pq_flush. Write error messages to
postmaster log with elog(DEBUG) so that they will be timestamped etc.
Once upon a time I think elog() was unsafe here, but it shouldn't be anymore.
2001-11-12 04:54:08 +00:00
Tom Lane
1131ba3135 send() attempt for IDENT communication should retry on EINTR. 2001-11-12 04:29:23 +00:00
Tom Lane
a7f6210de2 The PacketReceive/PacketSend routines aren't used anymore. 2001-11-12 04:19:15 +00:00
Bruce Momjian
215772ae96 Update MD5 documentation. 2001-11-12 03:57:16 +00:00
Bruce Momjian
67a56f2286 Sync up both files. 2001-11-12 02:05:17 +00:00
Bruce Momjian
9937040a02 Add comments and remove CVS tag from md5.c so they remain identical. 2001-11-12 02:00:18 +00:00
Bruce Momjian
36bbb2494e Add comments and remove CVS tag from md5.c so they remain identical. 2001-11-12 01:59:43 +00:00
Bruce Momjian
0611d3980a Update md5 to match. 2001-11-12 01:56:12 +00:00
Bruce Momjian
e6e4c45a2a Add comments of duplicate definitions in interfaces/odbc/md5.h. 2001-11-12 01:52:46 +00:00
Bruce Momjian
75bb1e6f5d Add code to check that md5.c files are in sync. 2001-11-12 01:42:03 +00:00
Bruce Momjian
a83bd89d00 Indent new rename.c for Tom Lane. 2001-11-12 01:34:50 +00:00
Hiroshi Inoue
b52950cc3d Add md5 authentication support thanks to Bruce Momjian. 2001-11-12 00:54:28 +00:00
Tom Lane
f14fdad858 Make ALTER TABLE RENAME update foreign-key trigger arguments correctly.
Brent Verner, with review and kibitzing from Tom Lane.
2001-11-12 00:46:36 +00:00
Tom Lane
8bfc437301 Clean up a bunch of ScanKeyEntryInitialize calls that weren't bothering
to apply the proper Datum conversion macros to search key values.
2001-11-12 00:00:55 +00:00
Tom Lane
801a1accca Test program needs to declare MaxBackends, per Bernd Tegge. 2001-11-11 22:12:00 +00:00
Tom Lane
69a59150c2 Defend against brain-dead QNX implementation of qsort().
Per report from Bernd Tegge, 10-Nov-01.
2001-11-11 22:00:25 +00:00
Tom Lane
c5c97318f9 In find_mergeclauses_for_pathkeys, it's okay to return multiple merge
clauses per path key.  Indeed, we *must* do so or we will be unable to
form a valid plan for FULL JOIN with overlapping join conditions, eg
select * from a full join b on
a.v1 = b.v1 and a.v2 = b.v2 and a.v1 = b.v2.
2001-11-11 20:33:53 +00:00
Bruce Momjian
4552ddd535 Fix for compiling libpq++ on Solaris with Sun SPRO6U2.
Denis A Ustimenko
2001-11-11 19:20:53 +00:00
Tom Lane
ad511a3ff3 sort_inner_and_outer needs a check to ensure that it's consumed all the
mergeclauses in RIGHT/FULL join cases, just like the other routines have.
I'm not quite sure why I thought it didn't need one --- but Nick
Fankhauser's recent bug report proves that it does.
2001-11-11 19:18:54 +00:00
Hiroshi Inoue
8bf1e098dd Use abbreviated connection string more widely.
This seems to fix the trouble with PowerBuilder
reported by Magbus Weber.
2001-11-11 07:24:36 +00:00
Tom Lane
15c21bf8e1 Defend against possibility that SSL error reporting mechanism returns
a NULL pointer.  Per report from Stephen Pillinger 8-Nov-01.
2001-11-11 02:09:05 +00:00
Tom Lane
f6ee99a062 Clean up usage-statistics display code (ShowUsage and friends). StatFp
is gone, usage messages now go through elog(DEBUG).
2001-11-10 23:51:14 +00:00
Tom Lane
0c1669c806 Restructure child-exit logging messages for easier translation,
per suggestion from Peter.
2001-11-10 23:06:12 +00:00
Tom Lane
ec438886e1 Allow TIMESTAMP, VARCHAR, et al to be used as unquoted column names,
though alas not as unquoted function names.  De-reserve a bunch of
keywords that could have been in ColId rather than ColLabel all along.
Per recent proposal in pgsql-patches.
2001-11-10 22:31:49 +00:00
Dave Cramer
be4e5059a2 Jason Davies patch to getImported/getExported keys 2001-11-09 02:57:50 +00:00
Bruce Momjian
77e4fd889c Fix indenting for 'extern "C"' cases. 2001-11-08 20:37:52 +00:00
Bruce Momjian
876c7009fb Make extern C handling more flexible. 2001-11-08 17:03:23 +00:00
Tom Lane
7e16f3c0d8 PostgreSQL works again on Mac OS X 10.1. Hold your nose before
investigating the kluge that makes it so...
2001-11-08 04:24:03 +00:00
Tom Lane
64af43a15f Add casts to suppress compiler warnings observed on Darwin platform
(surprised no one has reported these yet...)
2001-11-08 04:05:13 +00:00
Bruce Momjian
c6e25ed1af Fix replacement of extern C string. 2001-11-07 22:10:02 +00:00
Bruce Momjian
1233d4fd6c Fix typo. 2001-11-07 21:29:04 +00:00
Bruce Momjian
e644fc25c7 Prevent indenting of 'extern "C"' blocks. 2001-11-07 21:24:28 +00:00
Bruce Momjian
e7c788f3a0 Some post pgident run updates,
one fuzzy translation fix, some
other messages tweaking. Theoretically,
should be up-to-date by now.

Please apply to /src/interfaces/libpq/ru.po

--
Serguei A. Mokhov
2001-11-07 03:09:15 +00:00
Tom Lane
27e7ac190e Update for latest version of horology test. 2001-11-06 18:03:48 +00:00
Tom Lane
d22e9456a7 Clean up formatting of child process exit-status reports so that they
are correct, consistent, and complete ... motivated by gripe from
Oliver Elphick, but I see someone had already made an incomplete stab
at this.
2001-11-06 18:02:48 +00:00
Thomas G. Lockhart
d2ff7e509c Fix last (?) problem with sensitivity to daylight savings time status
when running the regression test. Reported by Tom Lane.
2001-11-06 16:31:13 +00:00
Thomas G. Lockhart
3ea311d4b3 Add British Double Standard Time (BDST) per mailing list report. 2001-11-06 16:29:51 +00:00
Thomas G. Lockhart
e160fcd696 Use PostgreSQL's standard declaration for a 32-bit integer to define
the cash data type.
2001-11-06 16:27:31 +00:00
Tom Lane
d980ddb544 Add Darwin to list of known systems for ps_status. 2001-11-06 01:15:29 +00:00
Tom Lane
ca7578d454 The extra semaphore that proc.c now allocates for checkpoint processes
should be accounted for in the PROC_SEM_MAP_ENTRIES() macro.  Otherwise
the ports that rely on this macro to size data structures are broken.
Mea culpa.
2001-11-06 00:38:26 +00:00
Tom Lane
0053cebea5 Fix coredump in plpgsql when trying to return a rowtype result.
Need to return a TupleTableSlot, not just a bare tuple.
2001-11-05 19:41:56 +00:00
Bruce Momjian
ea08e6cd55 New pgindent run with fixes suggested by Tom. Patch manually reviewed,
initdb/regression tests pass.
2001-11-05 17:46:40 +00:00
Hiroshi Inoue
34153b2052 Preparation for the parameter array handling. 2001-11-05 10:35:14 +00:00
Hiroshi Inoue
c0b27c4feb 1) Fix a few bugs about SQLGetData()
reported by Mika Mantyla.
2) Timestamp precision.
3) Separate ODBC3.0 files.
2001-11-05 09:46:17 +00:00
Bruce Momjian
0f450dae8b More cleanup for stuff after closing brace in first column. 2001-11-05 06:37:51 +00:00
Bruce Momjian
d447dbf392 Handle tabs after closing brace in first column with less indenting. 2001-11-05 05:47:50 +00:00
Bruce Momjian
158129be72 Improve readability of script. 2001-11-05 05:18:43 +00:00
Tom Lane
5251e7b3d0 CREATE TABLE foo (x,y,z) AS SELECT ... can't apply target column names
to the target list in gram.y; it must wait till after expansion of the
target list in analyze.c.  Per bug report 4-Nov:
lx=# CREATE TABLE abc (a char, b char, c char);
CREATE
lx=# CREATE TABLE xyz (x, y, z) AS SELECT * FROM abc;
ERROR:  CREATE TABLE/AS SELECT has mismatched column count
2001-11-05 05:00:14 +00:00
Tom Lane
d556920a98 Remove ill-considered Assert. 2001-11-05 01:34:37 +00:00
Bruce Momjian
3bb110ebb3 Pull in variables defined in structs; had too many tabs. 2001-11-04 21:27:41 +00:00
Tom Lane
430cd88a18 Fix now-obsolete comment. 2001-11-04 20:12:57 +00:00
D'Arcy J.M. Cain
568cb6ab5c Version was 3.3 but last released version was 3.1. Setting to match rest
of the documentation in preparation for upcoming release.
2001-11-04 20:11:01 +00:00
Tom Lane
fb5f1b2c13 Merge three existing ways of signaling postmaster from child processes,
so that only one signal number is used not three.  Flags in shared
memory tell the reason(s) for the current signal.  This method is
extensible to handle more signal reasons without chewing up even more
signal numbers, but the immediate reason is to keep pg_pwd reloads
separate from SIGHUP processing in the postmaster.
Also clean up some problems in the postmaster with delayed response to
checkpoint status changes --- basically, it wouldn't schedule a checkpoint
if it wasn't getting connection requests on a regular basis.
2001-11-04 19:55:31 +00:00
D'Arcy J.M. Cain
5f067722bf Note that PyGreSQL has been checked against Python 2.1 now. 2001-11-04 19:47:16 +00:00
D'Arcy J.M. Cain
6395d86a9a The "%d", while syntactically correct, was confusing. Added a space to
make it clearer that d was the argument to the format operator.
2001-11-04 19:42:13 +00:00
Philip Warner
1ef62bb6fc - Fix compiler warning in pg_restore
- Fix handling of {data/schema}-only restores when using a full
  backup file; prior version was restoring schema in data-only
  restores. Added enum to make code easier to understand.
2001-11-04 04:05:36 +00:00
Bruce Momjian
7cc8af5563 Got "ADD" to appear only in ALTER TABLE and not CREATE TABLE
UNIQUE-PRIMARY KEY notice message.  This is what Christopher wanted from
his patch.
2001-11-04 03:08:11 +00:00
Bruce Momjian
434077c4e6 Remove "ADD" from TABLE / ADD UNIQUE-PRIMARY error message because the
same code is called for both creation and alter.  Not worth worrying
about.
2001-11-04 02:41:09 +00:00
Bruce Momjian
8ee7c19e3c Require closing paren on line above brace to identify function
difinition, just for formatting workaround, per Tom's discovery.
2001-11-03 22:34:13 +00:00
Bruce Momjian
f008976bcd More updates for GNU indent. 2001-11-03 12:34:15 +00:00
Hiroshi Inoue
58df3f785e 1) Improve literal handling in parse_statement().
2) Remove some no longer valid comments.
3) Fix an option dialog setting bug.
4) Fix ODBCVER handling errors.
2001-11-03 06:53:50 +00:00
Bruce Momjian
ffba91cd1e Make pgindent use GNU Indent version 2.X better. 2001-11-03 01:49:22 +00:00
Dave Cramer
355cc69dfc proper select for Jason Davies patch to getImportedKeys 2001-11-02 23:51:18 +00:00
Dave Cramer
0b1289e67d proper select for Jason Davies patch to getImportedKeys
fixes for compiling Jason's getImportedKeys, getExportedKeys
2001-11-02 23:50:08 +00:00
Bruce Momjian
04550d3c90 Add check for 'extern "C"' for pgindent. 2001-11-02 23:43:24 +00:00
Tom Lane
c42d3b3c24 Windows portability macros SOCK_ERRNO and SOCK_STRERROR should be in
libpq-int.h, not cluttering application namespace in libpq-fe.h.
2001-11-02 20:51:27 +00:00
Tom Lane
9685afb0b2 Add default expressions to INSERTs during planning, not during parse
analysis.  This keeps stored rules from prematurely absorbing default
information, which is necessary for ALTER TABLE SET DEFAULT to work
unsurprisingly with rules.  See pgsql-bugs discussion 24-Oct-01.
2001-11-02 20:23:02 +00:00
Peter Eisentraut
a9b6691ae7 updates 2001-11-02 19:16:47 +00:00
Tom Lane
8a069abd18 Fix pg_pwd caching mechanism, which was broken by changes to fork
postmaster children before client auth step.  Postmaster now rereads
pg_pwd on receipt of SIGHUP, the same way that pg_hba.conf is handled.
No cycles need be expended to validate password cache validity during
connection startup.
2001-11-02 18:39:57 +00:00
Tom Lane
6babf6eab7 Suppress compiler warning (only seen in MULTIBYTE case). 2001-11-02 17:00:18 +00:00
Tom Lane
7d05310828 Fix problem reported by Alex Korn: if a relation has been dropped and
recreated since the start of our transaction, our first reference to it
errored out because we'd try to reuse our old relcache entry for it.
Do this by accepting SI inval messages just before relcache search in
heap_openr, so that dead relcache entries will be flushed before we
search.  Also, break heap_open/openr into two pairs of routines,
relation_open(r) and heap_open(r).  The relation_open routines make
no tests on relkind and so can be used to open anything that has a
pg_class entry.  The heap_open routines are wrappers that add a relkind
test to preserve their established behavior.  Use the relation_open
routines in several places that had various kluge solutions for opening
rels that might be either heap or index rels.

Also, remove the old 'heap stats' code that's been superseded by Jan's
stats collector, and clean up some inconsistencies in error reporting
between the different types of ALTER TABLE.
2001-11-02 16:30:29 +00:00
Michael Meskes
5d4b94085e Sync parser yet again. 2001-11-02 15:04:03 +00:00
Tom Lane
3c9b549a75 Minor code cleanups. 2001-11-01 18:10:48 +00:00
Tom Lane
7663e6bb70 Reject tabs and linefeeds in usernames and passwords that are being
stored in pg_pwd, to guard against failures of the sort observed by
Tom Yackel.  Note: in the case of encrypted passwords this is no
restriction, since the string we are interested in is the MD5 hash.
2001-11-01 18:09:58 +00:00
Tom Lane
bdea97ea95 Add missing #include. 2001-11-01 06:17:01 +00:00
Tom Lane
4877c59217 Suppress trivial compiler warning. 2001-11-01 05:45:28 +00:00
Barry Lind
8304a395f9 minor improvements on Dave's last checkin 2001-11-01 01:10:13 +00:00
Hiroshi Inoue
01da8e918d Suppress a compiler warning. 2001-10-31 23:54:02 +00:00
Dave Cramer
1da3771b4e changes to support 3rd party ERD tools and staroffice 2001-10-31 20:27:37 +00:00
Dave Cramer
af000b7f2e allow null passwords 2001-10-31 20:26:01 +00:00
Dave Cramer
29916087d0 added dummy login 2001-10-31 20:24:32 +00:00
Thomas G. Lockhart
c859ff92d0 Fix queries to insulate from daylight savings time. 2001-10-31 14:44:23 +00:00
Bruce Momjian
57584d70fa More *.po cleanups for new spacing. 2001-10-31 05:16:31 +00:00
Bruce Momjian
e7fc0604cd Modify *.po files and regression expected output for new clearer error
message spacing.
2001-10-31 05:14:33 +00:00
Bruce Momjian
37bba02bdb Here is an updated version of /src/backend/po/ru.po
which incorporates recent changes by Bruce to
readability of some messages and few more translations.

--
Serguei A. Mokhov
2001-10-31 04:58:36 +00:00
Bruce Momjian
85817580f4 Traditional Chinese error messages for JDBC.
Zhenbang Wei
2001-10-31 04:55:02 +00:00
Bruce Momjian
4911c85e86 Add ALTER TABLE ADD UNIQUE regression tests from Christopher Kings-Lynne.
Add space between slash for ALTER TABLE / ADD ....

Regression and *.po updates to follow.
2001-10-31 04:49:44 +00:00
Bruce Momjian
74c2f8e729 Apply updated PO language patch.
Zhenbang Wei
2001-10-31 04:31:17 +00:00
Bruce Momjian
41b161f0eb PO language update.
forth@pagic.net
2001-10-31 04:20:26 +00:00
Tom Lane
9a88b8a600 Update solaris-1947 variant files for new datetime regression tests.
Results checked by Olivier Prenant.
2001-10-30 22:48:57 +00:00
Tom Lane
96ca8ffebc Fix problems with subselects used in GROUP BY expressions, per gripe
from Philip Warner.  Side effect of change is that GROUP BY expressions
will not be re-evaluated at multiple plan levels anymore, whereas this
sometimes happened with old code.
2001-10-30 19:58:58 +00:00
Barry Lind
512a3aef36 fixed change in behavior introduced in bytea / getBytes changes. This patch reverts back unintentional change in behavior to return raw value even when not bytea column 2001-10-30 06:31:59 +00:00
Bruce Momjian
c41b6b1b9c Fix small problem Tom Lane found with pgindent run. 2001-10-30 05:38:56 +00:00
Barry Lind
d650a6f580 updated patch from Mark Lillywhite per Tom Lane's comments: subtract VARHDRSZ first then and with 0xffff 2001-10-30 05:09:51 +00:00
Barry Lind
d80d4baa09 applied patch from Mark Lillywhite, patch was already applied to jdbc2, this applies same fix to jdbc1 code 2001-10-30 05:05:25 +00:00
Bruce Momjian
8469a33818 Add gp->gr_mem != NULL check for Solaris, per Seth Hettich 2001-10-29 18:06:54 +00:00
Bruce Momjian
40b1403ae8 Check for NULL return from getgrgid(), per Seth Hettich 2001-10-29 17:55:41 +00:00
Tatsuo Ishii
f2a2ad59bc Fix bug with illegal call to calloc. 2001-10-29 06:45:32 +00:00
Hiroshi Inoue
aaf95b6c86 Change position of a check button in multibyte mode. 2001-10-29 02:51:46 +00:00
Bruce Momjian
6783b2372e Another pgindent run. Fixes enum indenting, and improves #endif
spacing.  Also adds space for one-line comments.
2001-10-28 06:26:15 +00:00
Bruce Momjian
c29797deeb Add code to trip trailing newlines in a file. 2001-10-27 13:54:45 +00:00
Bruce Momjian
5ef74fe593 Correct fix for indenting. 2001-10-27 03:31:36 +00:00
Tom Lane
8dcf998dd1 Remove no-longer-needed dependencies on DLSUFFIX. 2001-10-26 20:45:33 +00:00
Bruce Momjian
b93939a6a7 Adjust NR tests. More accurate. 2001-10-26 17:54:45 +00:00
Bruce Momjian
8c1f4e574b Add code to not indent enum, per Tom Lane. 2001-10-26 16:21:13 +00:00
Bruce Momjian
99a9f2f6f4 Add ODBC typedefs. 2001-10-26 15:42:54 +00:00
Tom Lane
40ce3a93f1 Remove 294 reduce/reduce conflicts. 2001-10-25 20:56:53 +00:00
Tom Lane
22d9e91219 Fix a couple of places where lack of parenthesization of a cast
causes pgindent to make weird formatting decisions.  Easiest fix
seems to be to put in the extra parens...
2001-10-25 20:37:30 +00:00
Bruce Momjian
80b9a00439 Add blank line before #endif to #endif's at the end of the file. 2001-10-25 19:57:03 +00:00
Bruce Momjian
3231341eed Add slash for comment spacing, for Tom. 2001-10-25 19:22:05 +00:00
Bruce Momjian
81d9a9674e Add comment spaces for trailing ) and comment. 2001-10-25 18:44:42 +00:00
Bruce Momjian
cae059ba5e Add spacing for single-line comments with trailing semicolon _and_
comma, per Tom.
2001-10-25 18:25:23 +00:00
Tom Lane
a0cd991987 Add int2-to-int8 and int8-to-int2 conversion routines. Needed to avoid
breaking existing pg_dump scripts, which try to assign the result of
count(*) to an int2 variable.  catversion bumped.
2001-10-25 14:10:07 +00:00
Tom Lane
92e8282229 Add missing output routine for FkConstraint nodes. 2001-10-25 14:08:11 +00:00
Bruce Momjian
05584c9660 Code cleanup. 2001-10-25 06:27:56 +00:00
Bruce Momjian
d2e27b0674 pgjindent jdbc files. First time jdbc files were formatted. 2001-10-25 06:00:05 +00:00
Bruce Momjian
b81844b173 pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
2001-10-25 05:50:21 +00:00
Bruce Momjian
59da2105d8 Update to prevent CATALOG() from wrapping. 2001-10-25 05:07:56 +00:00
Bruce Momjian
bbc7491de1 Add current typedef symbols to pgindent. 2001-10-25 03:56:35 +00:00
Bruce Momjian
fde8edaf53 Add do { ... } while (0) to more bad macros. 2001-10-25 01:29:37 +00:00
Bruce Momjian
309a04f5b8 Add missing "do { ... } while(0)" in ODBC macros and add find_baddefs
script.
2001-10-25 00:50:50 +00:00
Peter Eisentraut
8b4d5c7575 Include locale.h before undefining gettext() to avoid compilation errors
on Solaris.

per report from Lee Kindness, 2001-10-23
2001-10-24 21:49:14 +00:00
Bruce Momjian
6f6d16ab25 All three *.po patches applied.
forth@pagic.net
2001-10-24 17:52:28 +00:00
Bruce Momjian
cabe9896bc Here is a patch for DatabaseMetaData to show precision properly. It is
from Mark Lillywhite.  I am adding to the patch queue.
2001-10-24 17:44:28 +00:00
Hiroshi Inoue
0450331526 Allow concurrent index creation for the same table. 2001-10-24 09:28:31 +00:00
Barry Lind
97ab49beb0 fix for a bug in DatabaseMetaData.getIndexInfo(). This fixes a bug reported by tom_falconer@lineone.net. On Sept 7th, he sent a test case to the list demonstrating the bug. His test case now works successfully with this patch 2001-10-24 04:31:50 +00:00
Tom Lane
b662e321c5 Forbid the switch combination --clean --create, which is pointless
(why bother dropping individual objects in a just-created database?)
as well as dangerous (as the code stands, the drops will be issued in
the wrong database, namely the one you were originally connected to).
2001-10-23 21:26:44 +00:00
Tom Lane
2628d9b3a4 Document range restriction on bit values used in INTERVAL typmod. 2001-10-23 20:17:27 +00:00
Tom Lane
d0667af926 Add support for INTERVAL's new typmod values to format_type. 2001-10-23 20:12:54 +00:00
Tom Lane
01b73d3f27 Fix foreign keys on system columns. 2001-10-23 17:39:03 +00:00
Tom Lane
57dd2ce78a Make SPI's column-accessing functions work for system columns as well as
user columns.  Needed for foreign keys on OID, but useful in general.
2001-10-23 17:38:25 +00:00
Bruce Momjian
8dded696e6 Now I had them reversed. Wow that syntax is error-prone. 2001-10-23 02:50:41 +00:00
Bruce Momjian
caafc1c5cc Syntax fix. Can't use #ifdef in gram.y. 2001-10-23 02:47:14 +00:00
Bruce Momjian
e1ce520c09 Back out LIMIT #,# removal and mark it as to-be-removed in 7.3. 2001-10-23 02:45:37 +00:00
Tom Lane
087771ae40 Add error checking to PageRepairFragmentation to ensure that it can
never overwrite adjacent pages with copied data, even if page header
and/or item pointers are already corrupt.  Change inspired by trouble
report from Alvaro Herrera.
2001-10-23 02:20:15 +00:00
Tom Lane
dab708ea08 Cause transformIndexConstraints() to do the right thing with requests
for indexes on system columns.  Per complaint from Peter.
2001-10-22 22:49:02 +00:00
Tom Lane
c59839ac6d Consolidate tables of known system attributes into one table. 2001-10-22 22:47:57 +00:00
Tom Lane
b00c6c841f Update for latest fixes. 2001-10-22 19:52:41 +00:00
Tom Lane
94daee3cb7 Further cleanup of ps_status setup code. On platforms where the
environment strings need to be moved around, do so when called from
initial startup (main.c), not in init_ps_status.  This eliminates the
former risk of invalidating saved environment-string pointers, since
no code has yet had a chance to grab any such pointers when main.c
is running.
2001-10-22 19:41:38 +00:00
Tom Lane
a19f2605ed Add defenses against invalid operator names passed in CREATE OPERATOR
arguments (where the parser doesn't check them already).  Minor code
cleanups too.
2001-10-22 19:34:13 +00:00
Tom Lane
970a2d1c91 Rebuild cached function definition after CREATE OR REPLACE FUNCTION.
Fix typlen-vs-typmod errors inherited from pltcl.
2001-10-22 19:32:27 +00:00
Tom Lane
b2e859a4fe Generate correct syntax for DROP OPERATOR with unary operators. 2001-10-22 19:31:09 +00:00
Michael Meskes
e97fe98c36 synced preproc.y with gram.y 2001-10-22 17:05:56 +00:00
Tom Lane
6ec5eaad3b Fix FindExec() for case where executable is found via a relative path
in .:/home/postgres/testversion/bin:/opt/perl5.6.1/bin:/home/postgres/bin:/usr/local/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/upgrade/bin:/opt/CC/bin:/opt/langtools/bin:/opt/graphics/phigs/bin:/opt/java/bin:/bin:/opt/imake/bin:/opt/hparray/bin:/opt/aCC/bin:/opt/lrom/bin:/usr/local/nmh/bin:. (I suppose the only common case for this is '.').
2001-10-21 03:43:54 +00:00
Tom Lane
b2e92a712e Fix getopt-vs-init_ps_display problem by copying original argv[] info,
per suggestion from Peter.  Simplify several APIs by transmitting the
original argv location directly from main.c to ps_status.c, instead of
passing it down through several levels of subroutines.
2001-10-21 03:25:36 +00:00
Tom Lane
2b7206a993 Revert change to autodetect '__getopt_initialized' variable ... turns
out glibc doesn't actually export this variable, so we need a different
solution.
2001-10-20 17:57:39 +00:00
Bruce Momjian
bb8f8e6279 Change LIMIT #,# error message to be more generic. 2001-10-20 16:51:02 +00:00
Bruce Momjian
f363b3177d Remove LIMIT #,# and suggest LIMIT # OFFSET #, per mailing list discussion. 2001-10-20 02:55:39 +00:00
Thomas G. Lockhart
424d9389d6 Fix transposed arguments for typmod for one INTERVAL production.
Mask both typmod subfields for INTERVAL to avoid setting the high bit,
 per dire warning from Tom Lane.
Clear tmask for DTK_ISO_TIME case to avoid time zone troubles.
 Symptom reported by Tom Lane.
Clean up checking for valid time zone info in output routine.
 This should now work for both SQL99 and Unix-style time zones.
Put in explicit check for INTERVAL() typmod rounding to avoid accumulating
 cruft in the lower bits. Not sure that this helps, but we'll need to do
 something. The symptom is visible with a query like
 select interval(2) '10000 days 01:02:03.040506';
Regression tests are patched to repair the Tom Lane symptom, and all pass.
2001-10-20 01:02:22 +00:00
Tom Lane
3a484d9e99 Fix plperl to discard cached function definition after CREATE OR
REPLACE FUNCTION.  Clean up typlen/typmod errors inherited from pltcl.
2001-10-19 22:43:49 +00:00
Tom Lane
379268aa62 Proper fix for glibc getopt() botch. Surprising we did not see this
before.
2001-10-19 20:47:09 +00:00
Tom Lane
58f6b951c2 Fix a lot of confusion between typlen and typmod. Didn't hurt too much
back when only varlena types paid any attention to typmod ...
2001-10-19 19:43:19 +00:00
Tom Lane
861a679fc1 Set optreset on platforms that have it before launching postmaster
subprocesses; perhaps this will fix portability problem just noted by
Lockhart.  Also, move test for bad permissions of DataDir to a more
logical place.
2001-10-19 18:19:41 +00:00
Tom Lane
6430e6e283 Ensure that all startup paths (postmaster, standalone postgres, or
bootstrap) check for a valid PG_VERSION file before looking at anything
else in the data directory.  This fixes confusing error report when
trying to start current sources in a pre-7.1 data directory.
Per trouble report from Rich Shepard 10/18/01.
2001-10-19 17:03:08 +00:00
Tom Lane
3d510653a4 Rename macro arg to avoid useless compiler warning when building plperl. 2001-10-19 15:38:57 +00:00
Bruce Momjian
ece1b67f54 > This stops the interface from leaking the row tuples (and thus the
> results of every fetch).

Stephen Robert Norris
2001-10-19 15:00:26 +00:00
Michael Meskes
a535cd1f8b removed "not fully implemented" warning for nullif 2001-10-19 14:31:44 +00:00
Hiroshi Inoue
8c3cb43bac Change SC_fetch() to not retrieve data in case the
SQL_RETRIEVE_DATA option is SQL_RD_OFF. This would
avoid a crash when scrolling Grid controls.
2001-10-19 05:39:14 +00:00
Tom Lane
abbc95e5c6 Fix pltcl to update cached function def after
CREATE OR REPLACE FUNCTION.
2001-10-19 02:43:46 +00:00
Tom Lane
eb133197b6 Move init_ps_display from postgres.c to postmaster.c, putting it
just after receipt of the startup packet.  Now, postmaster children
that are waiting for client authentication response will show as
'postgres: user database host authentication'.  Also, do an
init_ps_display for startup/shutdown/checkpoint subprocesses,
so that they are readily identifiable as well.  Fix an obscure race
condition that could lead to Assert failure in the postmaster ---
attempting to start a checkpoint process before any connections have
been received led to calling PostmasterRandom before setting random_seed.
2001-10-19 00:44:08 +00:00
Tom Lane
9047292725 Spell 'between' correctly, clean up spacing in error messages. 2001-10-18 23:16:09 +00:00
Tom Lane
43568d11ad Fix memory leakage when sending notice messages to client. 2001-10-18 23:07:29 +00:00
Tom Lane
aed378e8d1 Fix authentication so that it doesn't record an extra 'Password
authentication failed' and a 'send() failed: Broken pipe' message
on every connection from psql in password auth mode.  Problem is
that psql doesn't ask user for a password until it sees a password
challenge failure, and libpq just closes the connection unceremoniously
if it's challenged for a password when it hasn't got one to send.
Accordingly, EOF from the client after asking for a password is
normal behavior and should not result in postmaster log entries.
2001-10-18 22:44:37 +00:00
Tom Lane
13e467f74f Add STATUS_EOF value needed for auth.c. Remove a bunch of unused
STATUS_xxx macros to reduce clutter.
2001-10-18 22:40:52 +00:00
Tom Lane
4fec55af6c Fix several problems with simple_prompt() --- the nastiest being that
the entered password would get echoed on some platforms, eg HPUX.
We have enough copies of this code that I'm thinking it ought to be
moved into libpq, but that's a task for another day.
2001-10-18 21:57:11 +00:00
Bruce Momjian
278669e038 Document all the ecpg error codes. 2001-10-18 20:32:58 +00:00
Tom Lane
b522ce0bcf Update for new expected results. 2001-10-18 20:10:31 +00:00
Tom Lane
f9b6583747 Didn't compile on non-HAVE_TM_ZONE machines. 2001-10-18 19:54:59 +00:00
Tom Lane
369c9e3b6c Repair missing brace in HAVE_INT_TIMEZONE case. 2001-10-18 19:52:03 +00:00
Thomas G. Lockhart
9310075a13 Accept an INTERVAL argument for SET TIME ZONE per SQL99.
Modified the parser and the SET handlers to use full Node structures
 rather than simply a character string argument.
Implement INTERVAL() YEAR TO MONTH (etc) syntax per SQL99.
 Does not yet accept the goofy string format that goes along with, but
 this should be fairly straight forward to fix now as a bug or later
 as a feature.
Implement precision for the INTERVAL() type.
 Use the typmod mechanism for both of INTERVAL features.
Fix the INTERVAL syntax in the parser:
 opt_interval was in the wrong place.
INTERVAL is now a reserved word, otherwise we get reduce/reduce errors.
Implement an explicit date_part() function for TIMETZ.
 Should fix coersion problem with INTERVAL reported by Peter E.
Fix up some error messages for date/time types.
 Use all caps for type names within message.
Fix recently introduced side-effect bug disabling 'epoch' as a recognized
 field for date_part() etc. Reported by Peter E. (??)
Bump catalog version number.
Rename "microseconds" current transaction time field
 from ...Msec to ...Usec. Duh!
date/time regression tests updated for reference platform, but a few
 changes will be necessary for others.
2001-10-18 17:30:21 +00:00
Tom Lane
6254465d06 Extend code that deduces implied equality clauses to detect whether a
clause being added to a particular restriction-clause list is redundant
with those already in the list.  This avoids useless work at runtime,
and (perhaps more importantly) keeps the selectivity estimation routines
from generating too-small estimates of numbers of output rows.
Also some minor improvements in OPTIMIZER_DEBUG displays.
2001-10-18 16:11:42 +00:00
Michael Meskes
5045004958 Added Lee Kindness' patches. 2001-10-18 11:01:35 +00:00
Tom Lane
b207081056 Make sure to clean out old activity string when recycling a backend entry. 2001-10-16 22:35:27 +00:00
Tom Lane
70e6003c76 Use LEFT JOIN, not FULL JOIN, in statistical views. 2001-10-16 20:51:35 +00:00
Barry Lind
bf737b859f Updated the list of encodings supported to match what the backend now supports 2001-10-16 20:07:17 +00:00
Barry Lind
f50793c743 Added some additional comments in the code 2001-10-16 20:05:22 +00:00
Bruce Momjian
076026bba9 Python handle as string all int8 values from postgresql. This could be
view when using the aggregate function count() and function nextval
that returns an int8 value, but in python is represented like string:

>> db.query("select nextval('my_seq')").getresult()
[('2',)]

>> db.query("select count(*) from films").dictresult()
[{'count': '120'}]



Ricardo Caesar Lenzi
2001-10-16 13:42:57 +00:00
Tatsuo Ishii
cfe01796e6 Ok, here is the modified encoding table (column1 is the standard name,
2 is our "official" name, and 3 is alias). If there's no objection, I
will change them.

ASCII		SQL_ASCII
UTF-8		UNICODE		UTF_8
MULE-INTERNAL	MULE_INTERNAL
ISO-8859-1	LATIN1		ISO_8859_1
ISO-8859-2	LATIN2		ISO_8859_2
ISO-8859-3	LATIN3		ISO_8859_3
ISO-8859-4	LATIN4		ISO_8859_4
ISO-8859-5	ISO_8859_5
ISO-8859-6	ISO_8859_6
ISO-8859-7	ISO_8859_7
ISO-8859-8	ISO_8859_8
ISO-8859-9	LATIN5		ISO_8859_9
ISO-8859-10	LATIN6		ISO_8859_10
ISO-8859-13	LATIN7		ISO_8859_13
ISO-8859-14	LATIN8		ISO_8859_14
ISO-8859-15	LATIN9		ISO_8859_15
ISO-8859-16	LATIN10		ISO_8859_16
2001-10-16 10:09:17 +00:00
Tom Lane
e158670c1f Doesn't anyone test stuff before they commit it? 2001-10-15 20:15:09 +00:00
Bruce Momjian
394925b60d > Uh, isn't the correct fix
> ! $$ = cat_str(8, make_str("grant"), $2, make_str("on"), $4, $5,
 > make_str("to"), $7, $8);
 > ISTM your patch loses the opt_with_grant clause.  (Of course the
 > backend doesn't currently accept that clause anyway, but that's no
 > reason for ecpg to drop it.)

My patch doesn't loose the option, it's never been passed on anyway:

 opt_with_grant:  WITH GRANT OPTION
                                {
                                        mmerror(ET_ERROR, "WITH GRANT OPTION is not supported.  Only relation owners can
 set privileges");
                                 }
                | /*EMPTY*/
                ;

The existing code in ecpg/preproc/preproc.y to handle the WITH option
simply throws an error and aborts the processing... The patch below
prevents the segfault and also passes on the WITH option to the
backend, probably a better fix.

Lee Kindness
2001-10-15 18:16:31 +00:00
Bruce Momjian
66b77dbcd6 Prompt for password from /dev/tty and fall back to stdin/stderr. 2001-10-15 16:40:27 +00:00
Tatsuo Ishii
cdce507053 Forgot to add this file... 2001-10-15 04:52:59 +00:00
Bruce Momjian
1c6bd04713 PG_DUMP NLS (Russian)
Here is another one :)
Another chunk of translated messages.
Please apply to the same file.

Serguei Mokhov
2001-10-15 02:50:16 +00:00
Tatsuo Ishii
df4cba68cf Commit Patrice's patches except:
> - corrects a bit the UTF-8 code from Tatsuo to allow Unicode 3.1
>  characters (characters with values >= 0x10000, which are encoded on
>  four bytes).

Also, update mb/expected/unicode.out. This is necessary since the
patches affetc the result of queries using UTF-8.
---------------------------------------------------------------
Hi,

I should have sent the patch earlier, but got delayed by other stuff.
Anyway, here is the patch:

- most of the functionality is only activated when MULTIBYTE is
  defined,

- check valid UTF-8 characters, client-side only yet, and only on
  output, you still can send invalid UTF-8 to the server (so, it's
  only partly compliant to Unicode 3.1, but that's better than
  nothing).

- formats with the correct number of columns (that's why I made it in
  the first place after all), but only for UNICODE. However, the code
  allows to plug-in routines for other encodings, as Tatsuo did for
  the other multibyte functions.

- corrects a bit the UTF-8 code from Tatsuo to allow Unicode 3.1
  characters (characters with values >= 0x10000, which are encoded on
  four bytes).

- doesn't depend on the locale capabilities of the glibc (useful for
  remote telnet).

I would like somebody to check it closely, as it is my first patch to
pgsql.  Also, I created dummy .orig files, so that the two files I
created are included, I hope that's the right way.

Now, a lot of functionality is NOT included here, but I will keep that
for 7.3 :) That includes all string checking on the server side (which
will have to be a bit more optimised ;) ), and the input checking on
the client side for UTF-8, though that should not be difficult. It's
just to send the strings through mbvalidate() before sending them to
the server. Strong checking on UTF-8 strings is mandatory to be
compliant with Unicode 3.1+ .

Do I have time to look for a patch to include iso-8859-15 for 7.2 ?
The euro is coming 1. january 2002 (before 7.3 !) and over 280
millions people in Europe will need the euro sign and only iso-8859-15
and iso-8859-16 have it (and unfortunately, I don't think all Unices
will switch to Unicode in the meantime)....

err... yes, I know that this is not every single person in Europe that
uses PostgreSql, so it's not exactly 280m, but it's just a matter of
time ! ;)

I'll come back (on pgsql-hackers) later to ask a few questions
regarding the full unicode support (normalisation, collation,
regexes,...) on the server side :)

Here is the patch !

Patrice.

--
Patrice HÉDÉ ------------------------------- patrice à islande org -----
  --  Isn't it weird  how scientists  can imagine  all the matter of the
universe exploding out of a dot smaller than the head of a pin, but they
can't come up with a more evocative name for it than "The Big Bang" ?
  -- What would _you_ call the creation of the universe ?
  -- "The HORRENDOUS SPACE KABLOOIE !"               - Calvin and Hobbes
------------------------------------------ http://www.islande.org/ -----
2001-10-15 01:25:10 +00:00
Tatsuo Ishii
d07bacd54a Add UTF-8 char >= 0x10000 check 2001-10-15 01:19:15 +00:00
Tom Lane
e3b3eb20a4 Synchronize with main parser's keyword list (someone didn't check his
last commit very carefully...)
2001-10-15 00:06:04 +00:00
Michael Meskes
1ebc028cbc - Fixed GRANT statement.
- Synced preproc.y with gram.y.
2001-10-14 12:07:57 +00:00
Tom Lane
e482dcb0a4 Make selectivity routines cope gracefully with NaNs, infinities, and
NUMERIC values that are out of the range of 'double'.  Per trouble
report from Mike Quinn.
2001-10-13 23:32:34 +00:00
Peter Eisentraut
d1c6983899 Fix logic in insert() function. 2001-10-13 19:16:32 +00:00
Tom Lane
9ca41c0413 Fixing closed-path intersection logic causes this test to find more
streets than it used to...
2001-10-13 17:41:11 +00:00
Tom Lane
cf5dc330b9 path_inter, path_distance, path_length, dist_ppath now do the right
things with closed paths --- ie, include the closing line segment in
their calculations.  Per bug report from Curtis Barrett 9-Oct-01.
2001-10-13 17:40:24 +00:00
Tom Lane
58dc94abac Add missing prototype to suppress gcc warning. 2001-10-13 16:34:08 +00:00
Tom Lane
f42b88d1b4 Residual cleanup from making pltcl unknown support always enabled. 2001-10-13 15:24:23 +00:00
Bruce Momjian
8123d8f150 Here are few more translated messages into Russian
for the PG_DUMP component.

Please apply to </src/bin/pg_dump/ru.po>

Serguei A. Mokhov
2001-10-13 04:25:27 +00:00
Bruce Momjian
1d3a47af0c Attached patch for unconditional enabling of pltcl-unknown support.
Enabling this feature adds very light overhead of 1 select from pg_class on
first using of pl/tcl in backend if unknown suppport is really unused.
But pl/tcl with this support has very improved functionality.

Patch includes changes to documentation.
2001-10-13 04:23:50 +00:00
Bruce Momjian
dac9f40ba8 Mention createlang when language not installed, per problem report. 2001-10-13 01:35:25 +00:00
Hiroshi Inoue
0420342af1 Update the version of psqlodbc driver. 2001-10-12 09:41:49 +00:00
Tatsuo Ishii
f426465ba9 Add a new function "pg_client_encoding" which returns the current client
side encoding name. This is necessary for client API's such as JDBC
to perform correct encoding conversions. See my email "[HACKERS]
pg_client_encoding" 10 Sep 2001.
2001-10-12 02:08:34 +00:00
Hiroshi Inoue
9d13fcf0af Fix the bug reported by Chris Lee. 2001-10-12 01:08:51 +00:00
Tom Lane
f9e6e27c87 Break transformCreateStmt() into multiple routines and make
transformAlterStmt() use these routines, instead of having lots of
duplicate (not to mention should-have-been-duplicate) code.
Adding a column with a CHECK constraint actually works now,
and the tests to reject unsupported DEFAULT and NOT NULL clauses
actually fire now.  ALTER TABLE ADD PRIMARY KEY works, modulo
having to have created the column(s) NOT NULL already.
2001-10-12 00:07:15 +00:00
Tom Lane
97d0c8b219 Suppress gcc warnings. 2001-10-11 18:06:52 +00:00
Bruce Momjian
78f7ba13cb Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> As you can see, psql reconnect as any user if the password is same as
> foo. Of course this is due to the careless password setting, but I
> think it's better to prompt ANY TIME the user tries to switch to
> another user. Comments?

Yeah, I agree.  Looks like a simple change in dbconnect():

    /*
     * Use old password if no new one given (if you didn't have an old
     * one, fine)
     */
    if (!pwparam && oldconn)
        pwparam = PQpass(oldconn);

to

    /*
     * Use old password (if any) if no new one given and we are
     * reconnecting as same user
     */
    if (!pwparam && oldconn && PQuser(oldconn) && userparam &&
        strcmp(PQuser(oldconn), userparam) == 0)
        pwparam = PQpass(oldconn);

                        regards, tom lane
2001-10-11 16:54:18 +00:00
Tatsuo Ishii
51053d3216 Add support for ISO-8859-6 to 16 2001-10-11 14:20:35 +00:00
Peter Eisentraut
371f49bf9f Remove gratuitous discrepancy between extract() and date_part(),
regarding timezone_hour, timezone_minute vs. tz_hour, tz_minute.
Document the former.
2001-10-10 00:02:42 +00:00
Peter Eisentraut
ec5c62874d Allow optional () after current_user, session_user, user, current_time,
current_timestamp, current_date for ODBC compatibility.

Add more functions to odbc.sql catalog extension, use new CREATE OR
REPLACE FUNCTION.

Document iODBC/unixODBC build options.
2001-10-09 22:32:33 +00:00
Barry Lind
839b9bc011 This patch fixes a bug introduced in the jdbc bytea support patch.
That patch broke the ability to read data from binary cursors.
--Barry Lind
 Modified Files:
 	pgsql/src/interfaces/jdbc/org/postgresql/Connection.java
 	pgsql/src/interfaces/jdbc/org/postgresql/ResultSet.java
 	pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Connection.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
2001-10-09 20:47:35 +00:00
Tom Lane
2f1c24cb1c Change plpgsql compiler so that all elogs are trapped and a suitable
NOTICE added about error location (same method already used by plpgsql
executor).  Add checking of pg_proc row xmin/cmin to ensure that
plpgsql functions will be recompiled after they've been modified by
CREATE OR REPLACE FUNCTION.
2001-10-09 15:59:56 +00:00
Tom Lane
c781600618 Fix typo in error message. Noted by laser@zhengmai.com.cn. 2001-10-09 14:00:22 +00:00
Tom Lane
0b3bca6c6f Change plpgsql to depend on main parser's type-declaration grammar,
rather than having its own somewhat half-baked notion of what a type
declaration looks like.  This is necessary now to ensure that plpgsql
will think a 'timestamp' variable has the same semantics as 'timestamp'
does in the main SQL grammar; and it should avoid divergences in future.
2001-10-09 04:15:38 +00:00
Tom Lane
7ecc40c2df Another go-round with FigureColname, to produce less surprising results
for nested typecasts.  It now produces a column header of 'timestamptz'
for 'SELECT CURRENT_TIMESTAMP', rather than 'text' as it was doing for
awhile there.
2001-10-08 21:48:51 +00:00
Tom Lane
71f2993c45 Fix transformExpr() to not scribble on its input datastructure while
transforming CASE expressions.  This was definitely confusing
FigureColname, and might lead to bad things elsewhere as well.
2001-10-08 21:46:59 +00:00
Tom Lane
1c7bef32b4 Fix ruleutils to depend on format_type, rather than having a private
copy of code that knows about displaying types with typmod info.
Needed so that it does the right thing with timestamp datatypes now.
2001-10-08 19:55:07 +00:00
Tom Lane
b6a7948294 Make ALTER TABLE RENAME COLUMN update column names of indexes that
refer to the renamed column.  Brent Verner, with a little help from tgl.
2001-10-08 18:40:04 +00:00
Tom Lane
7249562fe3 Remove redundant code, update comments, cause CURRENT_TIME to
agree with CURRENT_TIME(n).
2001-10-08 18:16:59 +00:00
Michael Meskes
6d5be886bc Fix include file so library is binary compatible again. 2001-10-08 08:08:42 +00:00
Tom Lane
85801a4dbd Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfo
lookup info in the relcache for index access method support functions.
This makes a huge difference for dynamically loaded support functions,
and should save a few cycles even for built-in ones.  Also tweak dfmgr.c
so that load_external_function is called only once, not twice, when
doing fmgr_info for a dynamically loaded function.  All per performance
gripe from Teodor Sigaev, 5-Oct-01.
2001-10-06 23:21:45 +00:00
Bruce Momjian
a965750abf While playing around with trying to add foreign keys to the
\d table display in psql, I noticed that tableinfo.triggers
is not used once it is set.

Greg Sabino Mullane
2001-10-06 14:41:17 +00:00
Peter Eisentraut
c3291aed20 Fix shared library builds for MacOS X. 2001-10-05 21:15:38 +00:00
Peter Eisentraut
9110ef4de6 Move psql's zh_TW.po to the right place. 2001-10-05 21:14:35 +00:00
Bruce Momjian
ee973be9c2 files attached are Traditional Chinese translations translated
and modified from Simplified Chinese translations for backend,
pgsql, pg_dump and libpq. I've appended their names to zh_TW.po.

forth
2001-10-05 19:05:54 +00:00
Bruce Momjian
453ef3f81f Attached is the updated version of the patch, which matches
on words as opposed to lines, which means that all of the
following work in psql:

\d foo \d bar
\d foo; \d bar
\d foo \d bar;;
\d foo; <space>


This one also uses "true and false" and strips semicolons
for the following backslash commands: \C \c \d \e \i \o \s \z

Greg Sabino Mullane
2001-10-05 19:01:13 +00:00
Michael Meskes
b78efb6d82 Make sure each call to ECPGraise is logged. 2001-10-05 17:37:07 +00:00
Tom Lane
8a52b893b3 Further cleanup of dynahash.c API, in pursuit of portability and
readability.  Bizarre '(long *) TRUE' return convention is gone,
in favor of just raising an error internally in dynahash.c when
we detect hashtable corruption.  HashTableWalk is gone, in favor
of using hash_seq_search directly, since it had no hope of working
with non-LONGALIGNable datatypes.  Simplify some other code that was
made undesirably grotty by promixity to HashTableWalk.
2001-10-05 17:28:13 +00:00
Bruce Momjian
583096a7f9 > > I am quite sure that all AIX Versions accept the CLOBBER method,
> > thus I ask you to apply the following patch, to make it work.

Zeugswetter Andreas SB SD
2001-10-05 15:47:48 +00:00
Michael Meskes
c83137a025 Fixed typo in proproc.y 2001-10-05 06:39:23 +00:00
Thomas G. Lockhart
7547b0104a Define CEST as a synonym for Central European Savings Time
per Jan Varga <varga@utcru.sk>
Fix up spacing and formatting.
2001-10-05 06:38:59 +00:00
Thomas G. Lockhart
bd97e4e7be Implement explicit date/time precision per SQL99 spec.
Use CAST() mechanism to define CURRENT_TIME and CURRENT_TIMESTAMP.
2001-10-05 06:37:42 +00:00
Tom Lane
c24e5ddf5f Don't try to hack pg_description if not superuser. (Really want a
COMMENT ON LARGE OBJECT command instead, but no time for it now.)
Fix some code that would not work with OIDs > 2G.
2001-10-04 22:39:34 +00:00
Tom Lane
03b0a589d1 Consider interpreting a function call as a trivial (binary-compatible)
type coercion after failing to find an exact match in pg_proc, but before
considering interpretations that involve a function call with one or
more argument type coercions.  This avoids surprises wherein what looks
like a type coercion is interpreted as coercing to some third type and
then to the destination type, as in Dave Blasby's bug report of 3-Oct-01.
See subsequent discussion in pghackers.
2001-10-04 22:06:46 +00:00
Tom Lane
1ca0874faa Ooops, I was a little too enthusiastic about suppressing default
index opclasses; they might be default for some other datatype,
in which case we mustn't suppress 'em.
2001-10-04 22:00:10 +00:00
Tom Lane
3f8a50c013 Plug memory leaks introduced by dynamic-search-path changes.
From Teodor Sigaev.
2001-10-04 19:13:55 +00:00
Tom Lane
38633cf891 Make the world safe for atttypmod=0 ... this didn't use to mean anything,
but timestamp now wants it to mean something.
2001-10-04 17:52:24 +00:00
Tom Lane
dd154dde59 Make current_time deliver a fractional-second answer. 2001-10-04 17:10:11 +00:00
Bruce Momjian
67bf0fc111 elog command need to use unicode conversion too.
Vsevolod Lobko
2001-10-04 15:48:37 +00:00
Bruce Momjian
25ec484722 This patch adds reporting of tcl global variable errorInfo
which contains stack trace.
  One problem, after this patch errors will generate multiline ERROR
messages. Is it acceptable or do I need split it and generate multiple
singleline messages?

Vsevolod Lobko
2001-10-04 15:47:41 +00:00
Bruce Momjian
60553337d7 Attached is a patch which deals with
select 'id' as xxx from table

The issue is:

When the driver gets a data type which does not map into the SQL.Types
it attempts to load the object into a java object. Eventually throwing
an exception indicating that the type "unknown" was not found.

Since the backend defaults "unknown" types to text it was suggested that
the jdbc driver do the same.

This patch does just that.

I have tested it on the above select statement as well as a small
program that serializes, and deserializes a class

Dave Cramer
2001-10-04 15:46:49 +00:00
Bruce Momjian
96471bf106 Using strtol() on int8 values (input parameters or result sets) in
plpython would result in numeric overflows causing the backend to
terminate abruptly.

This patch fixes it.

Bradley McLean
2001-10-04 15:45:49 +00:00
Bruce Momjian
a6020b396b I've just finished the Chinese NLS support(zh_CN part) files
translation,
    the attachement is those four files.
   (.tar.gz file, with the directory, root is $PGSRC).
    Tested on some Linux platform.

Weiping He
2001-10-04 15:44:14 +00:00
Bruce Momjian
720ca220a9 Attached please find an initiation of the
NLS effort for the 'postgresql' component.
It includes 'ru.po', which should be added
to /src/backend/po/ and a typical patch for
nls.mk with the 'ru' entry added in
the AVAIL_LANGUAGES.

I'll submit a patch with more translations
for pg_dump once CVSweb becomes available.
CVSweb for me right now is the only way
to get to the source code until my system
is completely setup by the end of the week.

--
Serguei A. Mokhov
2001-10-04 15:38:28 +00:00
Tom Lane
1392cbd0ed AdjustTimeForTypmod has the same bug ... 2001-10-04 15:14:22 +00:00
Tom Lane
04d975f0ca Make regress tests safe for variable-resolution timestamps. 2001-10-04 14:51:06 +00:00
Tom Lane
64dff0beac Fix some problems in new variable-resolution-timestamp code. 2001-10-04 14:49:57 +00:00
Tatsuo Ishii
f03b7ba0de Add dependency for regexec.c 2001-10-04 04:16:16 +00:00
Tatsuo Ishii
62d62e79b7 Add dependency for like.c 2001-10-04 04:13:40 +00:00
Tatsuo Ishii
219bd1e4fb Optimization for single byte encodings. 2001-10-04 02:15:47 +00:00
Tom Lane
fcd2e372a7 Consistently use gcc's __attribute__((format)) to check sprintf-style
format strings wherever possible.  Remarkably, this exercise didn't
turn up any inconsistencies, but it seems a good idea for the future.
2001-10-03 21:58:28 +00:00
Tom Lane
2e5fda7b7e DROP AGGREGATE and COMMENT ON AGGREGATE now accept the expected syntax
'aggname (aggtype)'.  The old syntax 'aggname aggtype' is still accepted
for backwards compatibility.  Fix pg_dump, which was actually broken for
most cases of user-defined aggregates.  Clean up error messages associated
with these commands.
2001-10-03 20:54:22 +00:00
Tom Lane
16def00ffb Update error message wording for format_type change. 2001-10-03 19:24:36 +00:00
Tom Lane
9488aad618 Remove no-longer-used macros. 2001-10-03 19:18:42 +00:00
Tom Lane
5c35b5973b Teach format_type about time/timestamp precision, so that pg_dump and
psql's \d option work properly.
2001-10-03 18:32:42 +00:00
Tom Lane
2684f15e46 Add missing TIMESTAMPTZ case. 2001-10-03 18:25:59 +00:00
Tom Lane
2b7ccb17e1 Some further kibitzing on cachability of datetime functions.
In particular, mark all I/O functions that can produce or consume
a date as noncachable, in light of existence of DateStyle variable.
2001-10-03 17:22:05 +00:00
Tom Lane
cf44762642 Update for latest regression tests. 2001-10-03 15:51:48 +00:00
Tom Lane
77be5f9451 AdjustTimestampForTypmod does not work (at least not portably) on
-infinity and +infinity.  Put TIMESTAMP_NOT_FINITE guard into the routine,
instead of forgetting it at some call sites.  Fixes regression test
failures here.
2001-10-03 15:50:48 +00:00
Tom Lane
a390975cc1 Neatnik fetishism. 2001-10-03 15:42:12 +00:00
Thomas G. Lockhart
3e1beda2cd Implement precision support for timestamp and time, both with and without
time zones.
SQL99 spec requires a default of zero (round to seconds) which is set
 in gram.y as typmod is set in the parse tree. We *could* change to a
 default of either 6 (for internal compatibility with previous versions)
 or 2 (for external compatibility with previous versions).
Evaluate entries in pg_proc wrt the iscachable attribute for timestamp and
 other date/time types. Try to recognize cases where side effects like the
 current time zone setting may have an effect on results to decide whether
 something is cachable or not.
2001-10-03 05:29:27 +00:00
Thomas G. Lockhart
af9747c375 Fix up bad indenting in a few places. 2001-10-03 05:23:12 +00:00
Tom Lane
f2c657375d Add CREATE OR REPLACE FUNCTION syntax to allow replacing a function
definition without changing the function's OID, thereby not breaking
rules, views, triggers, etc that depend on it.  From Gavin Sherry.
2001-10-02 21:39:36 +00:00
Michael Meskes
fecbeedc7e Re-added Tom's patch fixing my setlocale patch. I accidently
deleted it.
2001-10-02 14:08:28 +00:00
Tom Lane
c7a7107f41 Revise shmget() and semget() failure messages to mention the possibility
of coping by reducing shared_buffers/max_connections settings.
2001-10-01 23:26:55 +00:00
Tom Lane
1929a90b69 Change pg_dump to produce CREATE INDEX commands by using the backend's
pg_get_indexdef() function, rather than reaching into the system catalogs
for itself.  This eliminates a fair amount of redundant code.  Also,
since I just changed pg_get_indexdef() to suppress display of default
index opclasses, this will mean that 7.2 and later dumps will not mention
opclasses unless they are non-default opclasses.  Should make life easier
for future index opclass reorganizations.
2001-10-01 21:31:52 +00:00
Tom Lane
e5bbf19659 Extend pg_get_indexdef() to know about index predicates. Also, tweak
it to suppress index opclass output for opclasses that are the default
for their datatype; only non-default opclasses are shown explicitly.
This is expected to improve portability of the CREATE INDEX command
across future versions of Postgres --- we've changed index opclasses
too often in the past to think we won't do so again.
2001-10-01 20:15:26 +00:00
Tom Lane
0648d78ac4 Make inclusion logic for sys/sem.h and sys/ipc.h consistent across all
the files that need them.  Per trouble report from Teodor.
2001-10-01 18:16:35 +00:00
Tom Lane
6d18c038b7 Fix a couple of stray // comments. 2001-10-01 17:53:12 +00:00
Bruce Momjian
77d2622498 Add sys/types.h for FreeBSD compile.
Teodor Sigaev
2001-10-01 17:52:34 +00:00
Tom Lane
87fd2dbe7c Clean up a little more carefully around fork of pgstat subprocess.
Partial support for BEOS (not sure whether second fork of grandchild
process needs these extra calls or not; someone who has BEOS will need
to test it).
2001-10-01 16:48:37 +00:00
Bruce Momjian
034895125d > > > > > - PostgreSQL requires to be compiled with --enable-multibyte
> > > > >   and --enable-unicode-convertion if it ought to work correctly
> > > > >   with Tcl/Tk >= 8.1 (client or server side).
> > > > >
> > > > > - PL/Tcl needs to be changed to use pg_do_encoding_conversion
> > > > >   if it runs on a Tcl version >= 8.1 .
> > >
> > > > I'll do pl/tcl part in the next version of patch. Using this approach we
> > > > can eliminate overhead for databases in UNICODE.
> > >
> > > Any progress on this?  I'd prefer to get rid of this --enable-pltcl-utf
> > > option before release.
> >
> > Done
> >
> > Next version removes --enable-pltcl-utf switch and enables embedded
> > utf conversion of pgsql if tcl version >=8.1 and --enable-unicode-conversion
2001-10-01 15:33:31 +00:00
Michael Meskes
9f09e8362b - Fixed truncate bug.
- Added patch by Christof Petig <christof.petig@wtal.de> to
clean up
ecpglib.
2001-10-01 12:02:28 +00:00
Tom Lane
5999e78fc4 Another round of cleanups for dynahash.c (maybe it's finally clean of
portability issues).  Caller-visible data structures are now allocated
on MAXALIGN boundaries, allowing safe use of datatypes wider than 'long'.
Rejigger hash_create API so that caller specifies size of key and
total size of entry, not size of key and size of rest of entry.
This simplifies life considerably since each number is just a sizeof(),
and padding issues etc. are taken care of automatically.
2001-10-01 05:36:17 +00:00
Tom Lane
f58179669a Suppress timestamp_ops for backwards compatibility with 7.1 pg_dump. 2001-10-01 04:19:18 +00:00
Tatsuo Ishii
a8443da57a Remove C++ style comment. Some compilers won't accept it. 2001-10-01 02:31:33 +00:00
Tatsuo Ishii
464f20cf7b Fix a compile error on a platform that does not have PAM. 2001-10-01 02:26:36 +00:00
Tom Lane
95d4821b1c Make libpq++ safe again for older C++ compilers. Do 'using namespace std'
only if configure found it was safe to do so; do not assume const_cast
is available.
2001-09-30 22:30:37 +00:00
Bruce Momjian
c6f94644a0 These are further fixes for double quotes missing in the various shell
scripts.

Justin Clift
2001-09-30 22:17:51 +00:00
Tom Lane
7eff804b49 Clean up encode/decode functions a little bit. 2001-09-30 22:03:41 +00:00
Tom Lane
12054ba506 Fix sloppiness about static vs non-static declaration of functions.
Some compilers are pickier about this than gcc is.
2001-09-30 21:48:58 +00:00
Tom Lane
b16a8f49a7 pg_stat_get_backend_idset should reset fmgr_info->fn_extra at end of
execution, so that it restarts correctly if query tree is used again.
2001-09-30 21:01:39 +00:00
Tom Lane
f00da6d841 Allow the postmaster to accept changes in PGC_BACKEND GUC variables
from the config file, so that these changes will propagate to backends
started later.  Already-started backends continue to ignore changes
in these variables.
2001-09-30 20:16:21 +00:00
Tom Lane
e43d51fddc ISTM that IsUnderPostmaster should mean we are a child process of the
postmaster ... it should not be set in the postmaster itself.
2001-09-30 20:08:18 +00:00
Tom Lane
f9f258281e Create a GUC parameter max_files_per_process that is a configurable
upper limit on what we will believe from sysconf(_SC_OPEN_MAX).  The
default value is 1000, so that under ordinary conditions it won't
affect the behavior.  But on platforms where the kernel promises far
more than it can deliver, this can be used to prevent running out of
file descriptors.  See numerous past discussions, eg, pgsql-hackers
around 23-Dec-2000.
2001-09-30 18:57:45 +00:00
Tom Lane
40ed132ce7 Addition of xid=int4 operator makes opr_sanity unhappy. 2001-09-30 17:37:32 +00:00
Tom Lane
650c175042 winsock_strerror crashed on me. This fixes a line of code that looks
cleverer than it actually is ;-) Braces are good for you :-)

Gerhard HÌring
2001-09-30 16:23:30 +00:00
Hiroshi Inoue
f7d607748a Add an operator xid '=' int and remove BINARY_COMPATI... 2001-09-30 06:46:58 +00:00
Bruce Momjian
0386ccfed1 Back out change. Too many place to change too close to beta:
* HOLDER/HOLDERTAB rename to PROCLOCKLINK/PROCLOCKLINKTAG (Bruce)

Will return later.
2001-09-30 00:45:48 +00:00
Tom Lane
1663f33838 Tweak btree page split logic so that when splitting a page that is
rightmost on its tree level, we split 2/3 to the left and 1/3 to the
new right page, rather than the even split we use elsewhere.  The idea
is that when faced with a steadily increasing series of inserted keys
(such as sequence or timestamp values), we'll end up with a btree that's
about 2/3ds full not 1/2 full, which is much closer to the desired
steady-state load for a btree.  Per suggestion from Ann Harrison of
IBPhoenix.
2001-09-29 23:49:51 +00:00
Hiroshi Inoue
1647d3ae61 Allow comparison between xid and xid, int. 2001-09-29 23:01:26 +00:00
Bruce Momjian
f738747494 Do this TODO item:
* HOLDER/HOLDERTAB rename to PROCLOCK/PROCLOCKTAG (Tom)

Didn't use PROCLOCKLINK because it made PROCLOCKLINKTAG too long.
2001-09-29 21:35:14 +00:00
Tom Lane
8ca61476e0 Cope with the likelihood that setlocale and localeconv will return
pointers to data that will be changed by any later call to setlocale.
Must copy what they return to be sure we get the right answer.
Karel Zak, further tweaks by Tom Lane.
2001-09-29 21:16:30 +00:00
Tom Lane
dc05a996c5 Fix the setlocale problem in a way that actually works. setlocale
returns a string corresponding to the new setting, not the old,
therefore the previous patch was quite wrong.
2001-09-29 20:12:07 +00:00
Tom Lane
742d0f25c1 Clean up comments. 2001-09-29 19:49:50 +00:00
Tom Lane
2a314add00 Whoops, I was a tad too enthusiastic about using shared lock mode for
SInvalLock.  GetSnapshotData(true) has to use exclusive lock, since
it sets MyProc->xmin.
2001-09-29 15:29:48 +00:00
Tom Lane
6fdf7bed60 Fixes for datetime-related regress tests, from Tom Lockhart. 2001-09-29 15:17:42 +00:00
Hiroshi Inoue
53b2e00491 Keep the contents of ItemPointerData not the pointers so that
per tuple memory context doesn't discard them.
2001-09-29 07:57:06 +00:00
Tom Lane
e3831d83a7 timetz test was omitted from parallel_schedule. 2001-09-29 05:33:25 +00:00
Tom Lane
c0bff32c84 Update horology-no-DST-before-1970.out for new horology test.
Still need an update for horology-solaris-1947.out ...
2001-09-29 05:11:10 +00:00
Tom Lane
499abb0c0f Implement new 'lightweight lock manager' that's intermediate between
existing lock manager and spinlocks: it understands exclusive vs shared
lock but has few other fancy features.  Replace most uses of spinlocks
with lightweight locks.  All remaining uses of spinlocks have very short
lock hold times (a few dozen instructions), so tweak spinlock backoff
code to work efficiently given this assumption.  All per my proposal on
pghackers 26-Sep-01.
2001-09-29 04:02:27 +00:00
Bruce Momjian
818fb55ac4 I have made three changes to the rtree code: one bug fix and
two performance improvements.  I put an explanation of the
changes at

http://cs1.cs.nyu.edu/been/postgres-rtree.html

The performance improvements are quite significant.

All the changes are in the file src/backend/access/rtree/rtree.c

I was working with the 7.1.3 code.

I'm including the diff output as an attachment.

Kenneth Been
2001-09-29 03:46:12 +00:00
Bruce Momjian
850ba41677 A couple of lines were missing from my last patch - this one fixes things.
Liam Stewart
2001-09-29 03:11:11 +00:00
Bruce Momjian
40cd81cff4 This is a simple patch to put double quotes around a few cases in
pg_ctl.sh which were unquoted when inside of [].

Justin Clift
2001-09-29 03:09:32 +00:00
Bruce Momjian
07ce9fe61d Per the recent discussion there's been some code changes in JDBC's
DatabaseMetaData.getColumn(). I proposed a patch that would change the
number of queries to find out all columns in a table from 2 * N + 1 to 1 (N
being the number of columns reported) by using some outer joins. I also
fixed the fact that getColumns() only returned columns that had a default
defined. OTOH, I did not use to change the code required for obtaining a
column's remarks (by using col_description() for 7.2  and requested by Tom
Lane).

Finally, I have found a way to get all the column details in a single query
*and* use col_description() for 7.2 servers. A patch is attached. It
overrules Ren? Pijlman's fix for this that was committed just today, but
still used N + 1 queries (sorry Ren? ;-) )

I also fixed the return values for TABLE_CAT and TABLE_SCHEM from "" to
null, to be more standard compliant (and requested in Ren?'s mail found at
http://fts.postgresql.org/db/mw/msg.html?mid=1034253).

As always, the JDBC1 version has not been tested as I have no JDK 1.1

Jeroen van Vianen
2001-09-29 03:08:01 +00:00
Hiroshi Inoue
5b328502b5 Fix the bug about boolean type handling reported by
Kristis Markis.
2001-09-29 02:48:04 +00:00
Bruce Momjian
9dcec8135b Improve wording. 2001-09-28 19:25:36 +00:00
Thomas G. Lockhart
6f58115ddd Measure the current transaction time to milliseconds.
Define a new function, GetCurrentTransactionStartTimeUsec() to get the time
 to this precision.
Allow now() and timestamp 'now' to use this higher precision result so
 we now have fractional seconds in this "constant".
Add timestamp without time zone type.
Move previous timestamp type to timestamp with time zone.
Accept another ISO variant for date/time values: yyyy-mm-ddThh:mm:ss
 (note the "T" separating the day from hours information).
Remove 'current' from date/time types; convert to 'now' in input.
Separate time and timetz regression tests.
Separate timestamp and timestamptz regression test.
2001-09-28 08:09:14 +00:00
Thomas G. Lockhart
1f075a32ee Add separate regression tests for timetz and the new timestamptz type.
Modify the timestamp test to reflect the "no time zone" behavior of this
 new code; timestamptz resembles the old timestamp code.
2001-09-28 08:00:11 +00:00
Bruce Momjian
44f18333b7 Put MD5 salt at the end for security. 2001-09-27 23:16:23 +00:00
Tom Lane
90aebf7f52 Move s_lock.c and spin.c into lmgr subdirectory, which seems a much
more reasonable location for them.
2001-09-27 19:10:02 +00:00
Tom Lane
3d59ad00e8 Remove useless LockDisable() function and associated overhead, per my
proposal of 26-Aug.
2001-09-27 16:29:13 +00:00
Bruce Momjian
19656b7445 Improve postgresql.conf descriptions. 2001-09-27 00:24:25 +00:00
Tom Lane
cdd9146863 The trailing semicolon in a plpgsql function definition is now optional.
Per gripe 9/26.
2001-09-26 21:35:28 +00:00
Tom Lane
d435592f33 Repair oversight in recent changes to index-creation: tuple time qual
check *can* return HEAPTUPLE_INSERT_IN_PROGRESS or HEAPTUPLE_DELETE_IN_PROGRESS,
even though we have ShareLock on the relation.  To wit, this can happen
if the tuple was inserted/deleted by our own transaction.  Per report from
Justin Clift 9/23.
2001-09-26 21:09:27 +00:00
Tom Lane
1481b3b28b Remove useless test for time field in pg_control being > 0. We don't
need this, and it will create a Y2038 failure.  Per report from David
Wheeler, who is evidently running on a platform where time_t is already
negative.
2001-09-26 20:24:02 +00:00
Bruce Momjian
3e9014d02c Add ALIGN() for cred packet, for OpenBSD. 2001-09-26 19:57:01 +00:00
Bruce Momjian
be83aac6d2 Disable local creds on OpenBSD because it doesn't support it. Document
supported platforms in pg_hba.conf.
2001-09-26 19:54:12 +00:00
Michael Meskes
16b9b75876 - Synced preproc.y with gram.y.
- Changed locale handling.
2001-09-25 18:37:17 +00:00
Tatsuo Ishii
1b20315008 Fix bug in mic2ascii(). It does not handle correctly if none ASCII
chars are in the input.
2001-09-25 01:27:03 +00:00
Peter Eisentraut
8401f06efd Treat __s390x__ the same as __s390__. (taken from RPM patch set) 2001-09-24 20:10:44 +00:00
Hiroshi Inoue
2df4087a70 1) Fix compile errors on Windows.
2) Change *Common* --> *Default*.
2001-09-24 00:05:59 +00:00
Peter Eisentraut
c0a9283742 Rename collect_* options to more user-friendly names. 2001-09-23 21:52:36 +00:00
Peter Eisentraut
091a7659d4 Don't refer to odbcinst.ini by absolute path. SQLGetPrivateProfileString
handles this.

Don't install our own odbcinst.ini.  That's the driver manager's business.
2001-09-23 13:32:24 +00:00
Tatsuo Ishii
bb2bf2d401 Make lpad/rpad/translate multibyte aware. Also add Copright notice etc. 2001-09-23 11:02:01 +00:00
Tatsuo Ishii
be629abfc8 Add pg_database_encoding_max_length() function. 2001-09-23 10:59:45 +00:00
Bruce Momjian
e19a5adaf7 Update regress tests for new LIMIT x,y behavior. 2001-09-23 04:28:18 +00:00
Bruce Momjian
b75814aee3 The attached patch is my first run-through of the JDBC test suite. A
summary of changes:

 . removal of the tablename property from build.xml

 . addition of a dropTable method in JDBC2Tests and cleanups of many
methods in the same

 . all tests now use non-deprecated assertXYZ methods instead of the
deprecated assert method

 . failure in TimestampTest (testSetTimestamp) fixed. The failure is
because testSetTimestamp was inserting a timestamp with hour 7 but
checkTimeTest was expecting a timestamp with hour 8. AFAICS, there are
no issues wrt daylight savings time and timestamps being pushed in and
pulled out (but more explicit tests should be added in the future)

 . failure in TimeTest (testGetTime) fixed. Times to be inserted were
interpreted in the localtime zone but checking was done with the
assumption that the insertion was done in GMT.

 . formatting changes in a few of the source files (because I found
it convenient to have consistent formatting while working on them). The
formatting is consistent with the new format for java source files in
PostgreSQL.

Liam Stewart
2001-09-23 04:11:14 +00:00
Bruce Momjian
1aab783b59 Implement TODO item:
* Change LIMIT val,val to offset,limit to match MySQL

Documentation updates too.
2001-09-23 03:39:01 +00:00
Peter Eisentraut
364a7ebe26 Provide some initial support for building the ODBC driver for
an already installed iODBC or unixODBC driver manager.  In particular,
use the include files provided by the driver manager over our own,
and use the odbcinst library of the driver manager rather than gpps.c.

Migrate portability sections common to several files into psqlodbc.h.
2001-09-22 22:54:33 +00:00
Tatsuo Ishii
67c26c12af Fix expected files. 2001-09-22 08:47:20 +00:00
Tatsuo Ishii
8ebdac0ed5 Remove test drivers
Also fix comment in conv.c.
2001-09-22 08:44:49 +00:00
Bruce Momjian
6bbdd7a9e2 sbasename $0 is now basename "$0" 2001-09-22 04:28:12 +00:00
Tatsuo Ishii
3c177edc88 Make trim/ltrim/rtrim/btrim multibyte aware
(previous commit was missing commit messages)
2001-09-22 03:30:39 +00:00
Tatsuo Ishii
3e90401c7c *** empty log message *** 2001-09-22 03:26:30 +00:00
Peter Eisentraut
fdf07fe14f For consistency with the rest of PostgreSQL, rename BLOBs to large objects
in messages and documentation.
2001-09-21 21:58:30 +00:00
Tom Lane
196700c372 Add 'reload' option to pg_ctl to send SIGHUP to the postmaster. 2001-09-21 21:10:56 +00:00
Tom Lane
c1c888a9de Code review for MD5 authorization patch. Clean up some breakage
(salts were always zero!?), add much missing documentation.
2001-09-21 20:31:49 +00:00
Peter Eisentraut
4e77b4a548 Readd test/regress/README file, this time with a well-defined and simple
rule to remake it when necessary.
2001-09-21 18:37:05 +00:00
Tom Lane
35b7601b04 Add an overall timeout on the client authentication cycle, so that
a hung client or lost connection can't indefinitely block a postmaster
child (not to mention the possibility of deliberate DoS attacks).
Timeout is controlled by new authentication_timeout GUC variable,
which I set to 60 seconds by default ... does that seem reasonable?
2001-09-21 17:06:12 +00:00
Tom Lane
e3f5bc3492 Fix type_maximum_size() to give the right answer in MULTIBYTE cases.
Avoid use of prototype-less function pointers in MB code.
2001-09-21 15:27:38 +00:00
Hiroshi Inoue
39dc8ff64f 1) Avoid an overflow of connection string for Access(Microsoft Jet).
2) Change to retry lower version in case of "Unsupported frontend
procotol".
2001-09-21 07:51:52 +00:00
Tom Lane
6f33c179b9 Produce slightly saner-looking EXPLAIN output for a Result node. 2001-09-21 04:06:04 +00:00
Tom Lane
c969fed7ec Give VACUUM its own GUC parameter for memory usage, rather than
piggybacking on SortMem.  Add documentation for some recently-added
GUC parameters that had so far escaped it.
2001-09-21 03:32:36 +00:00
Tom Lane
ae3129fd03 Quick-and-dirty fix for recursive plpgsql functions, per bug report from
Frank Miles 7-Sep-01.  This is really just sticking a finger in the dike.
Frank's case works now, but we still couldn't support a recursive function
returning a set.  Really need to restructure querytrees and execution
state so that the querytree is *read only*.  We've run into this over and
over and over again ... it has to happen sometime soon.
2001-09-21 00:11:31 +00:00
Tom Lane
ac0c234c16 Suppress gcc warning. 2001-09-20 23:31:08 +00:00
Tom Lane
272b914a45 Remove some dead code and obsolete, misleading comments. 2001-09-20 21:07:57 +00:00
Peter Eisentraut
a1ee06625c Provide tunable knob for x = NULL -> x IS NULL transformation, default to off. 2001-09-20 14:20:28 +00:00
Peter Eisentraut
fd5e95971e Remove old file. 2001-09-19 21:28:55 +00:00
D'Arcy J.M. Cain
ae64196acb Change the version. We are moving towards the next release.
Fixed a nasty bug that messed up negative money amounts.
2001-09-19 18:58:47 +00:00
Peter Eisentraut
9e774ca45e Avoid unnecessary strcasecmp -- replace by strcmp. Fixes reported bug
that made setting serializable isolation level impossible in Turkish
locale.
2001-09-19 15:19:12 +00:00
Michael Meskes
f0212ced68 - Synced preproc.y with gram.y.
- Synced pgc.l with scan.l.
- Synced keyword.c.
- Include the remaining patches by Christof Petig <christof.petig@wtal.de>.
2001-09-19 14:09:32 +00:00
Peter Eisentraut
3baf7400d9 Replace useless strcasecmp's by strcmp's. 2001-09-19 09:48:42 +00:00
Tom Lane
89fa551808 EXPLAIN ANALYZE feature to measure and show actual runtimes and tuple
counts alongside the planner's estimates.  By Martijn van Oosterhout,
with some further work by Tom Lane.
2001-09-18 01:59:07 +00:00
Peter Eisentraut
27d2890b87 Unify the zip rules and variables. 2001-09-17 23:00:27 +00:00
Tom Lane
a839258db5 Fix bogus failure-return value from lo_create, per report from Gavin
Sherry.  Also clean up leakage of open files and LOs in failure exits
from lo_import and lo_export.
2001-09-17 20:05:47 +00:00
Bruce Momjian
4f63a0e101 Attached is a patch that fixes ResultSetMetaData.isNullable() in
the JDBC driver.

This method is currently unimplemented and always returns
ResultSetMetaData.columnNullable. This is obviously incorrect
when a column is defined with NOT NULL or PRIMARY KEY. And we
have to think of check constraints, views, functions etc.

The patch simply changes the return value to
ResultSetMetaData.columnNullableUnknown. This is until someone
comes up with a real implementation of course.

On Fri, 14 Sep 2001 17:53:50 +0200, Tomisaw Kity?ski wrote:
>Hello there,
>
>could someone tell me, please, do I have any chance to get
>proper implementation of above method in JDBC (1.1+) soon?
>
>Current "return 1" works fine on most tables, however it seems
>to be a little bit incorrect with some of them ;)

Ren? Pijlman
2001-09-17 15:56:11 +00:00
Bruce Momjian
6e63468f3a I'm attaching a patch which fixes the corruption in strings caused
by escape processing in the SQL statement. I've tested this for a
while now and it appears to work well. Previously string data
with {d was getting corrupt as the {d was being stripped regardless
of whether it was an escape code or not.

I also added checking for time and timestamp escape processing strings
as per 11.3 in the specification. The patch is against the latest
CVS.

Thomas O'Dowd
2001-09-17 15:54:50 +00:00
Hiroshi Inoue
29481e170f Change FixupBlobXrefs() to take 'lo' type into account. 2001-09-17 02:07:51 +00:00
Tom Lane
052c2eaa65 Simplify and clean up FigureColname; make it work without coredumping
for TypeCast case.
2001-09-17 01:06:36 +00:00
Tom Lane
ec7ddc1586 Use portable putenv(), not unportable setenv(). 2001-09-17 00:42:42 +00:00
Tom Lane
220ae48cca Suppress compiler warning. 2001-09-17 00:29:10 +00:00
Peter Eisentraut
e648b22ddd Russian translation from Serguei Mokhov 2001-09-16 23:10:16 +00:00
Peter Eisentraut
d0a6cf2180 Update from Serguei Mokhov 2001-09-16 23:06:33 +00:00
Peter Eisentraut
264f8f2b6c Install dynamically loadable modules into a private subdirectory
under libdir, for a cleaner separation in the installation layout
and compatibility with binary packaging standards.  Point backend's
default search location there.  The contrib modules are also
installed in the said location, giving them the benefit of the
default search path as well.  No changes in user interface
nevertheless.
2001-09-16 16:11:11 +00:00
Bruce Momjian
c1fbf06654 > Here's a revised patch. Changes:
>
> 1. Now outputs '\\' instead of '\134' when using encode(bytea, 'escape')
> Note that I ended up leaving \0 as \000 so that there are no ambiguities
> when decoding something like, for example, \0123.
>
> 2. Fixed bug in byteain which allowed input values which were not valid
> octals (e.g. \789), to be parsed as if they were octals.
>
> Joe
>

Here's rev 2 of the bytea string support patch. Changes:

1. Added missing declaration for MatchBytea function
2. Added PQescapeBytea to fe-exec.c
3. Applies cleanly on cvs tip from this afternoon

I'm hoping that someone can review/approve/apply this before beta starts, so
I guess I'd vote (not that it counts for much) to delay beta a few days :-)

Joe Conway
2001-09-14 17:46:40 +00:00
Bruce Momjian
e8d5b8d290 Allow '1' in jdbc2 boolean test. 2001-09-14 17:40:41 +00:00
Tatsuo Ishii
2374be8a26 Remove --enable-unicode-conversion
unicode-conversion is always on if --enable-multibyte is specified

	   Tatsuo Ishii
2001-09-14 10:36:52 +00:00
Hiroshi Inoue
058841301c Change an *if condition*.
Hiroshi Inoue
2001-09-14 06:46:45 +00:00
Hiroshi Inoue
70b0831387 1) Improve the implementation of *Disallow Premature* for
older versions of servers.
2) Implement SQLProcedures.

Hiroshi Inoue
2001-09-14 06:30:37 +00:00
Hiroshi Inoue
5e14c9397d Fix a coversation error with pre 6.4 versions.
Hiroshi Inoue
2001-09-14 01:50:33 +00:00
Bruce Momjian
436d4aef07 Add missing paren to ODBC compiles. 2001-09-13 22:39:29 +00:00
Bruce Momjian
698a5d50c5 Didn't want that jdbc patch in there yet. 2001-09-13 17:01:31 +00:00
Bruce Momjian
54549d8dc4 > I found a problem with PQescapeString (I think). Since it escapes
> null bytes to be literally '\0', the following can happen:
> 1. User inputs string value as "<null byte>##" where ## are digits in the
> range of 0 to 7.
> 2. PQescapeString converts this to "\0##"
> 3. Escaped string is used in a context that causes "\0##" to be evaluated as
> an octal escape sequence.

I agree that this is a problem, though it is not possible to do
anything harmful with it.  In addition, it only occurs if there are
any NUL characters in its input, which is very unlikely if you are
using C strings.

The patch below addresses the issue by removing escaping of \0
characters entirely.

> If the goal is to "safely" encode null bytes, and preserve the rest of the
> string as it was entered, I think the null bytes should be escaped as \\000
> (note that if you simply use \000 the same string truncation problem
> occurs).

We can't do that, this would require 4n + 1 bytes of storage for the
result, breaking the interface.

Florian Weimer
2001-09-13 17:00:34 +00:00
Hiroshi Inoue
9f990a73c1 1) Not export ODBC 3.0 functions.
2) (Maybe) fix a bug reported by Mika Muntila.
2001-09-13 00:27:11 +00:00
Peter Eisentraut
dfdbf6898f max_locks_per_transaction seems to be a more consistent name than
max_locks_per_xact.
2001-09-12 14:06:37 +00:00
Bruce Momjian
21a7fa8a6f It is not fixed and I doubt that it is working fine in current CVS. The
bugfix is in the attached patch. Please apply it. Thanks.

 Output must be:

test=# SELECT to_char(485, 'RN');
     to_char
-----------------
         CDLXXXV
(1 row)

test=# SELECT to_char(485, 'FMRN');
 to_char
---------
 CDLXXXV
(1 row)

test=# SELECT to_char(1000, 'RN');
     to_char
-----------------
               M
(1 row)


test=# SELECT to_char(7.2, '"Welcome to"9.9 "release! :-)"');
           to_char
-----------------------------
 Welcome to 7.2 release! :-)
(1 row)

Karel Zak
2001-09-12 04:01:57 +00:00
Bruce Momjian
148f94b98f I noticed that plpython does not make the relid available inside
a trigger the way that pltcl does.

Here's a little patch that adds it in.

-Brad McLean
2001-09-12 03:03:25 +00:00
Peter Eisentraut
9b35cce9ee Link ODBC driver with -lnsl and -lsocket, for Solaris.
reported by Bob Deblier (bob@virtualunlimited.com)
2001-09-11 23:27:10 +00:00
Peter Eisentraut
3278314847 Use gcc -shared rather than gcc -G for shared library linking on Solaris.
suggested by Bob Deblier (bob@virtualunlimited.com)
2001-09-11 23:20:41 +00:00
Peter Eisentraut
93a9cc8533 Invoke on_exit() with correct number and type of arguments. 2001-09-11 23:08:07 +00:00
Hiroshi Inoue
0521051b0b Fix some multibyte related bugs.
Psqlodbc is 7.01.0007 now.

Hiroshi Inoue
2001-09-11 06:39:20 +00:00
Tatsuo Ishii
7e99cea816 Implement following item in TODO:
* Reject character sequences those are not valid in their charset
2001-09-11 05:18:59 +00:00
Tatsuo Ishii
e1de3e0833 Implement following item in TODO:
* Reject character sequences those are not valid in their charset
2001-09-11 04:50:36 +00:00
Peter Eisentraut
8f3627d89b Add explicit '-print' to 'find' commands.
(partially) from Ian Lance Taylor
2001-09-10 22:25:48 +00:00
Peter Eisentraut
51ba1c5a8c Remove extra space at end of line. 2001-09-10 19:34:18 +00:00
Bruce Momjian
3ef5bebb72 Attached is a patch that fixes DatabaseMetaDataTest in the JDBC
driver's test suite. With previous patches applied, this reduces
the number of failures of the test suite from 6 to 4. The patch
fixes the test case itself, rather than the driver.

Details:

1) The driver correctly provided DatabaseMetaData about the sort
order of NULLs. This was confirmed by Peter Eisentraut on
pgsql-hackers. I fixed the test to accept/require the current
behaviour, and made it dependent on the backend version. See
nullsAreSortedAtStart(), nullsAreSortedAtEnd(),
nullsAreSortedHigh() and nullsAreSortedLow().

2) DatabaseMetaData.supportsOrderByUnrelated() correctly
returned true (an ORDER BY clause can contain columns that are
not in the SELECT clause), but the test case required false.
Fixed that.

3) Replaced deprecated assert() of junit.framework.TestCase by
assertEquals(), assertTrue() and assertNotNull(). This is
because assert will be a new keyword in Java 1.4.

4) Replaced assert(message,false) by the more elegant
fail(message).

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-10 15:07:58 +00:00
Bruce Momjian
ec0ad67403 Attached is a patch to add bytea support to JDBC.
This patch does the following:

- Adds binary datatype support (bytea)
- Changes getXXXStream()/setXXXStream() methods to be spec compliant
- Adds ability to revert to old behavior

Details:

Adds support for the binary type bytea.  The ResultSet.getBytes() and
PreparedStatement.setBytes() methods now work against columns of bytea
type.  This is a change in behavior from the previous code which assumed
the column type was OID and thus a LargeObject.  The new behavior is
more complient with the JDBC spec as BLOB/CLOB are to be used for
LargeObjects and the getBytes()/setBytes() methods are for the databases
binary datatype (which is bytea in postgres).

Changes the behavior of the getBinaryStream(), getAsciiStream(),
getCharacterStream(), getUnicodeStream() and their setXXXStream()
counterparts.  These methos now work against either the bytea type
(BinaryStream) or the text types (AsciiStream, CharacterStream,
UnicodeStream).  The previous behavior was that these all assumed the
underlying column was of type OID and thus a LargeObject.  The
spec/javadoc for these methods indicate that they are for LONGVARCHAR
and LONGVARBINARY datatypes, which are distinct from the BLOB/CLOB
datatypes.  Given that the bytea and text types support upto 1G, they
are the LONGVARBINARY and LONGVARCHAR datatypes in postgres.

Added support for turning off the above new functionality.  Given that
the changes above are not backwardly compatible (however they are more
spec complient), I added the ability to revert back to the old behavior.
  The Connection now takes an optional parameter named 'compatible'.  If
the value of '7.1' is passed, the driver reverts to the 7.1 behavior.
If the parameter is not passed or the value '7.2' is passed the behavior
is the new behavior.  The mechanism put in place can be used in the
future when/if similar needs arise to change behavior.  This is
patterned after how Oracle does this (i.e. Oracle has a 'compatible'
parameter that behaves in a similar manner).

Misc fixes.  Cleaned up a few things I encountered along the way.


Note that in testing the patch I needed to ignore whitespace differences
in order to get it to apply cleanly (i.e. patch -l -i byteapatch.diff).
Also this patch introduces a new file
(src/interfaces/jdbc/org/postgresql/util/PGbytea.java).

Barry Lind
2001-09-10 15:07:05 +00:00
Bruce Momjian
6b50f9af33 On Fri, 07 Sep 2001 01:34:46 -0400, Tom Lane wrote:
>there is still an unpatched reference to pg_description in
>getColumns(), in both jdbc1 and jdbc2.

This was introduced by Jeroen's patch (see
http://fts.postgresql.org/db/mw/msg.html?mid=1032468). Attached
is a patch that returns getColumns() to using "select
obj_description()" instead of direct access to pg_description,
as per the request by Tom.

I've incorporated Jeroen's fix to left outer join with
pg_attrdef instead of inner join, so getColumns() also returns
columns without a default value.

I have, however, not included Jeroen's attempt to combine
multiple queries into one huge multi-join query for better
performance, because:
1) I don't know how to do that using obj_description() instead
of direct access to pg_description
2) I don't think a performance improvement (if any) in this
method is very important

Because of the outer join, getColumns() will only work with a
backend >= 7.1. Since the conditional coding for 7.1/7.2 and
jdbc1/jdbc2 is already giving me headaches I didn't pursue a
pre-7.1 solution.

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-10 14:55:08 +00:00
Bruce Momjian
c69bb04acc Attached is a patch that fixes
ConnectionTest.testTransactionIsolation() in the JDBC driver's
test suite. This reduces the number of failures of the test
suite from 7 to 6. The patch fixes the test case itself, rather
than the driver.

In addition to the change described in my posting below, I fixed
the part of the test with autocommit enabled. The author of the
test assumed that setting the transaction isolation level would
have no effect, but in fact it does. Perhaps the test case
worked with pre-7.1 behaviour, when the JDBC driver set the
isolation level in every transaction, instead of using "set
session characteristics". Anyway, now it works with a backend
built from current CVS and the behaviour is JDBC compliant.

I also extended the test case by changing the isolation level
before beginning a transaction and verifying it inside the
transaction.

Regards,
Ren? Pijlman
2001-09-10 14:54:22 +00:00
Bruce Momjian
d70a944e0a Bug #1: attribute name when column is type cast:
Given the following table:

test=# \d f
          Table "f"
 Column |  Type   | Modifiers
--------+---------+-----------
 i      | integer |
 test   | text    |

If I do the following:

test=# insert into f values(1,'test');
INSERT 139549 1
test=# select i::int8,test from f;
 ?column? | test
----------+------
        1 | test
(1 row)

It doesn't make much sense that the first column should be called
'?column?'.

The patch results in the output appearing like this:

test=# select i::int8,test from f;
 i | test
---+------
 1 | test
(1 row)

----------

Gavin Sherry
2001-09-10 14:53:10 +00:00
Bruce Momjian
be18a49d39 > NOTE: in the command.c in three places there (I believe) is a typo:
>
> "parse error at [the] end of line"
>
> Attached patch also fixes it. I noticed this while editing the po file.
> If I'm wrong, please ignore the command.c.patch. I will revert my translation
> as well then.
>
> --
> Serguei A. Mokhov
2001-09-10 14:51:33 +00:00
Bruce Momjian
9e46767161 The attached patch should be sufficient to fix libpgtcl. It requires
PostgreSQL to support unicode-conversion, but retains binary
compatibility among Tcl versions.

However, it neither checks at compile time not at runtime, if support
for unicode-conversion does really exist and it doesn't prevent the
user from changing the client encoding after initialization. I think
there should be warnings about this somewhere in the documentation.

Reinhard Max
2001-09-10 14:49:12 +00:00
Hiroshi Inoue
0ee85f853f Change dialog windows. 2001-09-10 10:13:30 +00:00
Hiroshi Inoue
9abd055405 1) Fix SQLForeignKeys() in multibyte mode.
2) Fix a bug with NUMERIC scale in case of Parse
  statement option.
3) Remove a no longer needed loop in CC_send_query().

Hiroshi Inoue
2001-09-10 08:53:27 +00:00
Bruce Momjian
da1696b5c1 Remove INV_ARCHIVE mention in python readme. 2001-09-10 04:21:14 +00:00
Bruce Momjian
39d1169939 Remove INV_ARCHIVE mention in perl. 2001-09-10 04:19:19 +00:00
Tatsuo Ishii
d330f09a56 Backout Karel's patch 2001-09-09 01:15:11 +00:00
Hiroshi Inoue
ec6c4d8c82 Improve declare/fetch mode a little.
Add a new DSN option for PREPARE hadling.

Hiroshi Inoue
2001-09-08 16:20:16 +00:00
Hiroshi Inoue
fc5ec424ab Apply 7.1.3 changes to the current tree also. 2001-09-08 16:15:28 +00:00
Peter Eisentraut
c0d4d5473a Make the world somewhat safe for (not from) DELETE FROM pg_shadow;
Assign the fixed user id 1 to the user created by initdb.
A stand-alone backend will always set the user id to 1.
(Consequently, the name of that user is no longer important.)

In stand-alone mode, the user id 1 will have implicit superuser
status, to allow repairs even if there are no users defined.

Print a warning message when starting in stand-alone mode when no
users are defined.

Disallow dropping the current user and session user.

Granting/revoking superuser status also grants/revokes usecatupd.
(Previously, it would never grant it back.  This could lead to "deadlocks".)

CREATE USER and CREATE GROUP will start allocating user ids at 100
(unless explicitly specified), to prevent accidental creation of a
superuser (plus some room for future extensions).
2001-09-08 15:24:00 +00:00
Bruce Momjian
fdbf796f36 > > A simple and robus solution is in the begin of mbutils.c set default
> > ClientEncoding to SQL_ASCII (like default DatabaseEncoding). Bruce, can
> > you change it? It's one line change. Again thanks.

 Forget it! A default client encoding must be set by actual database encoding...
Please apply the small attached patch that solve it better.

Karel Zak
2001-09-08 14:30:15 +00:00
Bruce Momjian
468b9d8202 Move updateCommon() into Win32 block because it is only used there. 2001-09-08 02:48:53 +00:00
Hiroshi Inoue
4ad1b5b766 Resolve compile errors on unix.
Rename psqlodbc.def -> psqlodbc_win32.def.
Improve internal *declare cursor* handling
a little.

Hiroshi Inoue
2001-09-08 02:28:41 +00:00
Tom Lane
02b1a7fd51 Clean up some confusion about where and how to set whereToSendOutput.
We will no longer try to send elog messages to the client before we have
initialized backend libpq (oops); however, reporting bogus commandline
switches via elog does work now (not irrelevant, because of PGOPTIONS).
Fix problem with inappropriate sending of checkpoint-process messages
to stderr.
2001-09-08 01:10:21 +00:00
Bruce Momjian
6b9f94022c Move TESTSUITE file to test/README. 2001-09-07 23:34:16 +00:00
Tom Lane
09e99a1082 Change addlit() to not assume its input is null-terminated, so that we
don't have more bugs like the quote-quote-quote-quote one.  Propagate
fix into ecpg lexer, too.
2001-09-07 23:17:14 +00:00
Bruce Momjian
b6385efb79 Attached is a patch that fixes 2 test cases of the JDBC test
suite. This reduces the number of failures from 9 to 7.

Both ConnectionTest and JBuilderTest did not create their own
tables, which caused these test cases to fail with "relation ...
does not exist". It appears these test cases relied on tables
created by the example code elsewhere in the source tree. I've
added the necessary "create table" and "drop table" statements
to the test cases, using the column definitions from the example
code.

While working on that I modified the helper method createTable
in JDBC2Tests.java to take a table parameter, rather than using
table names passed via the properties in build.xml. I'm not sure
what that was good for, and in fact, except for the default
table name "jdbctest", this functionality wasn't used at all.

Ren? Pijlman
2001-09-07 22:17:48 +00:00
Bruce Momjian
7066253ab5 Read transactions don't work on 7.0.x db's 2nd patch
Here is a revised patch with Barry's suggestions implemented

Dave Cramer
2001-09-07 22:17:02 +00:00
Bruce Momjian
6ea41dcc7b Patch for jdbc2 ResultSet.java. Looks like performance improvement.
Joseph Shraibman
2001-09-07 22:15:55 +00:00
Bruce Momjian
1834987fb6 I've attached the fixed version of the patch below. After the
discussion on pgsql-hackers (especially the frightening memory dump in
<12273.999562219@sss.pgh.pa.us>), we decided that it is best not to
use identifiers from an untrusted source at all.  Therefore, all
claims of the suitability of PQescapeString() for identifiers have
been removed.

Florian Weimer
2001-09-07 22:02:32 +00:00
Bruce Momjian
bd9b32803b Here is my much-promised patch to let people add UNIQUE constraints after
table creation time.  Big deal you say - but this patch is the basis of the
next thing which is adding PRIMARY KEYs after table creation time.  (Which
is currently impossible without twiddling catalogs)

Rundown
-------

* I have made the makeObjectName function of analyze.c non-static, and
exported it in analyze.h

* I have included analyze.h and defrem.h into command.c, to support
makingObjectNames and creating indices

* I removed the 'case CONSTR_PRIMARY' clause so that it properly fails and
says you can't add primary keys, rather than just doing nothing and
reporting nothing!!!

* I have modified the docs.

Algorithm
---------

* If name specified is null, search for a new valid constraint name.  I'm
not sure if I should "lock" my generated name somehow tho - should I open
the relation before doing this step?

* Open relation in access exclusive mode

* Check that the constraint does not already exist

* Define the new index

* Warn if they're doubling up on an existing index

Christopher Kings-Lynne
2001-09-07 21:57:53 +00:00
Bruce Momjian
68e190cfa4 >has anyone ever successfully done copy to/from stdout with the
>tcl-extension for postgreSQL.
>I'm currently using 7.0 and always getting a seg fault when I try to
>read from the database connection after issueing a "COPY table TO
>stdout;" (I'm using the connection handle, *not* the result handle).
>Maybe this is fixed in a later release.
>The README file in src/interfaces/libpgtcl tells me, that this should
>work, but unforunately it doesn't.

Yes, it seems broken. It is a bug in libpgtcl.  Are you running Tcl >= 8.3.2?
That's when the Tcl team changed the data structure for channel
callbacks.  The change itself was designed to be backward compatible, but I
suspect a related change made the code more sensitive to errors in the
structure (NULL pointers where functions are required).  Either that, or
nobody has tried to use libpgtcl with COPY in a long time.

First, I have to say I can't think of a good reason to use PostgreSQL's
COPY command from a Tcl application. I think it should only be used with
psql for importing data from another source into PostgreSQL, or for
exporting PostgreSQL data into another database (but why would anyone do
that?) If it was me, I would stick with SELECT and INSERT and be "SQL
Compliant".

OK, editorial is over. Try applying the patch below to fix
      src/interfaces/libpgtcl/pgtclId.c
and let us know if it works. I did little testing on it, but my test did
segfault before and ran fine (copy in and copy out) after the patch.  This
is for PostgreSQL-7.1.2 - since you are running older 7.0, I don't know if
this will work, but I suspect it will.

PS It's the absence of PgWatchProc which kills it. I didn't upgrade it
to the "V2" channel type structure, so it should be compatible with older
Tcl's. But aside from gets and puts, I doubt any other file operations
would work on the handle during a copy.

ljb
2001-09-07 21:55:00 +00:00
Bruce Momjian
a926c7058b Add Java testsuite info. 2001-09-07 21:45:42 +00:00
Bruce Momjian
3fb3678409 Create pgjindent for java. 2001-09-07 21:25:44 +00:00
Tom Lane
17c03b30b0 Revert treatment of NOTIFY in rules to its pre-7.1 behavior: notify will
occur unconditionally, even if the rule should otherwise execute
conditionally.  This is more useful than giving an error, even though it's
not truly the correct behavior.  Per today's pghackers discussion.
2001-09-07 20:52:31 +00:00
Bruce Momjian
8c55728295 Add CRED alignment for NetBSD. 2001-09-07 19:59:04 +00:00
Bruce Momjian
a7621c92ae Update SCM_CREDS for Net/Free/BSD-OS. Add configure checks. 2001-09-07 19:52:54 +00:00
Jan Wieck
7e26a8241d Enable SIGTERM and SIGQUIT during client authentication so
the postmaster can kill the forked off processes when shutdown
is requested.

Jan
2001-09-07 16:12:49 +00:00
Bruce Momjian
d9044b5637 Remove file, per Karel. 2001-09-07 15:14:16 +00:00
Bruce Momjian
4ea26bf354 Remove variable length macros used in debugging, per Karel. 2001-09-07 15:01:45 +00:00
Bruce Momjian
7bfc83f673 Remove unused files for Karel's patch. 2001-09-07 14:17:17 +00:00
Bruce Momjian
9f5185cf63 Remove common.c, removed in Karal's patch. 2001-09-07 14:00:25 +00:00
Hiroshi Inoue
377d131b6c 1) Most driver options could be set per DSN.
2) Keep FE/BE protocol more precisely.
3) Improve procedure calls.
4) A trial to avoid PREMATURE execution(#ifdef'd now).

Hiroshi Inoue
2001-09-07 06:02:24 +00:00
Tatsuo Ishii
3bdd67a203 Add missing files. 2001-09-07 03:32:11 +00:00
Tom Lane
0fc7779d2e Revise overflow test in int84() to avoid codegen bug in some older
versions of gcc.  We don't really need to explicitly test the limits
anyway, just reverse-convert and see if we get the same answer.
2001-09-07 01:33:44 +00:00
Bruce Momjian
4ab2393729 Update tab completion for \d*. 2001-09-07 01:24:18 +00:00
Tom Lane
ee3c51d4f5 Fix a number of places where pg_dump was careless about explicitly
coercing OID literals to OID in its queries.  Depending on the query
and the server version, this could cause failures for OIDs over 2 billion.
2001-09-07 01:11:50 +00:00
Tom Lane
e67bb7af5a Missed a few places that referred to a compile-time limit on
max_connections.
2001-09-07 00:46:42 +00:00
Tom Lane
863aceb54f Get rid of PID entries in shmem hash table; there is no longer any need
for them, and making them just wastes time during backend startup/shutdown.
Also, remove compile-time MAXBACKENDS limit per long-ago proposal.
You can now set MaxBackends as high as your kernel can stand without
any reconfiguration/recompilation.
2001-09-07 00:27:30 +00:00
Bruce Momjian
0059c4216c >Well, if it is that easy, I can do it. Patch attached and applied.
>
>> On Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
>>     public boolean isWritable(int column) throws SQLException
>>     {
>>         return !isReadOnly(column);
>>     }

Actually, I think this change has a consequence for this method
in the same class:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return isWritable(column);
    }

This is from the JDBC spec
(http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSetMetaData.html):

  isReadOnly() - Indicates whether the designated column is
definitely not writable.

  isWritable() - Indicates whether it is possible for a write on
the designated column to succeed.

  isDefinitelyWritable() - Indicates whether a write on the
designated column will definitely succeed.

At this time we don't really implement the fine semantics of
these methods. I would suggest the following defaults:

  isReadOnly()             false
  isWritable()             true
  isDefinitelyWritable()   false

And that would mean that your patch is correct, but
isDefinitelyWritable() would need to be patched accordingly:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return false;
    }

Again, both in jdbc1 and jdbc2.

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-06 20:43:39 +00:00
Bruce Momjian
afa178e7e2 On Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
>public boolean isWritable(int column) throws SQLException
>{
>        if (isReadOnly(column))
>                return true;
>        else
>                return false;
>}

The author probably intended:

    public boolean isWritable(int column) throws SQLException
    {
        return !isReadOnly(column);
    }

And if he would have coded it this way he wouldn't have made
this mistake :-)

>hence, isWritable() will always return false. this is something
>of a problem :)

Why exactly? In a way, true is just as incorrect as false, and
perhaps it should throw "not implemented". But I guess that
would be too non-backwardly-compatible.

>let me know if i can provide further information.

Will you submit a patch?

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-06 18:26:37 +00:00
Bruce Momjian
343e38a938 > The win32.mak and libpgtcl.def files had been lost (patch doesn't handle
> new files). I'm attaching those two files below.
>
> Regards
> Mikhail Terekhov
2001-09-06 15:20:19 +00:00
Bruce Momjian
495e264fa3 Add -rpath for BSD/OS, from Peter E. 2001-09-06 13:43:42 +00:00
Bruce Momjian
f57477e651 > Patch applied. Thanks.
Thanks. However, I seem to have left a single debug statement in there :-(

Here's a patch to remove it.

Vianen, Jeroen van
2001-09-06 12:53:15 +00:00
Peter Eisentraut
8837164730 Russian translation from Serguei Mokhov 2001-09-06 11:10:47 +00:00
Tatsuo Ishii
f25ed23c57 Fix Karel's patch. Suggested by Eiji Tokuya 2001-09-06 05:01:38 +00:00
Tatsuo Ishii
227767112c Commit Karel's patch.
-------------------------------------------------------------------
Subject: Re: [PATCHES] encoding names
From: Karel Zak <zakkr@zf.jcu.cz>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-patches <pgsql-patches@postgresql.org>
Date: Fri, 31 Aug 2001 17:24:38 +0200

On Thu, Aug 30, 2001 at 01:30:40AM +0200, Peter Eisentraut wrote:
> > 		- convert encoding 'name' to 'id'
>
> I thought we decided not to add functions returning "new" names until we
> know exactly what the new names should be, and pending schema

 Ok, the patch not to add functions.

> better
>
>     ...(): encoding name too long

 Fixed.

 I found new bug in command/variable.c in parse_client_encoding(), nobody
probably never see this error:

if (pg_set_client_encoding(encoding))
{
	elog(ERROR, "Conversion between %s and %s is not supported",
                     value, GetDatabaseEncodingName());
}

because pg_set_client_encoding() returns -1 for error and 0 as true.
It's fixed too.

 IMHO it can be apply.

		Karel
PS:

    * following files are renamed:

src/utils/mb/Unicode/KOI8_to_utf8.map  -->
        src/utils/mb/Unicode/koi8r_to_utf8.map

src/utils/mb/Unicode/WIN_to_utf8.map  -->
        src/utils/mb/Unicode/win1251_to_utf8.map

src/utils/mb/Unicode/utf8_to_KOI8.map -->
        src/utils/mb/Unicode/utf8_to_koi8r.map

src/utils/mb/Unicode/utf8_to_WIN.map -->
        src/utils/mb/Unicode/utf8_to_win1251.map

   * new file:

src/utils/mb/encname.c

   * removed file:

src/utils/mb/common.c

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
2001-09-06 04:57:30 +00:00
Bruce Momjian
50aa3020ac Add missing files. 2001-09-06 03:58:59 +00:00
Bruce Momjian
04c1f72920 PAM authentication:
> pam_strerror() should be used a few more times, rather than just saying
> "Error!".  Also, the configure.in snippet seems wrong.  You add
> -I$pam_prefix/include/security to $INCLUDES and then you #include
> <security/pam_appl.h>.  This whole thing is probably unnecessary, since
> PAM is a system library on the systems where it exists, so the headers
> and libraries are found automatically, unlike OpenSSL and
> Kerberos.

See attached revised patch. (I'm sure the configure.in stuff can be done
right/better, I'm just not enough of a autoconf guru to know what to
change it to.)

Dominic J. Eidson
2001-09-06 03:23:38 +00:00
Bruce Momjian
2a34134b6c - new to_char(interval, text)
- new millisecond (ms) and microsecond (us) support
 - more robus parsing from string - used is separator checking for
   non-exact formats like to_date('2001-9-1', 'YYYY-MM-DD')
 - SGML docs are included

Karel Zak
2001-09-06 03:22:42 +00:00
Bruce Momjian
57040f78f7 Attached is a patch for JDBC's getColumn() function that was broken /
flawed in the following ways:

1. Only returned columns that had a default value defined, rather than all
columns in a table
2. Used 2 * N + 1 queries to find out attributes, comments and typenames
for N columns.

By using some outer join syntax it is possible to retrieve all necessary
information in just one SQL statement. This means this version is only
suitable for PostgreSQL >= 7.1. Don't know whether that's a problem.

I've tested this function with current sources and 7.1.3 and patched both
jdbc1 and jdbc2. I haven't compiled nor tested the jdbc1 version though, as
I have no JDK 1.1 available.

Note the discussion in http://fts.postgresql.org/db/mw/msg.html?mid=1029626
regarding differences in obtaining comments on database object in 7.1 and
7.2. I was unable to use the following syntax (or similar ones):

select
     ...,
     description
from
     ...
     left outer join col_description(a.attrelid, a.attnum) description
order by
     c.relname, a.attnum;

(the error was parse error at or near '(') so I had to paste the actual
code for the col_description function into the left outer join. Maybe
someone who is more knowledgable about outer joins might provide me with a
better SQL statement.

Jeroen van Vianen
2001-09-06 03:20:30 +00:00
Bruce Momjian
0b71596fdd This fixes clashing defines of ERROR. On win32, winapi.h is included, which
includes windows.h, which #defines ERROR to 0. PostgreSQL's logging functions
define ERROR to -1. This patch redefines ERROR to -1 to avoid current or
future breakage of the logging functions.

Gerhard H?ring
2001-09-06 03:18:12 +00:00
Bruce Momjian
e9f546365f > > I sent this to -hackers and peter_e, but thought it ought to go to
> > -patches as well.
>
> The -Bdynamic probably ought to disappear.

That was there already, but I have no objections.  I was trying to
make minimal changes.

Larry Rosenman
2001-09-06 03:16:46 +00:00
Bruce Momjian
56b102a96e This fixes the regression test .so builds on sysv5 systems:
I believe this will fix peter_e's problen with gcc.

Larry Rosenman
2001-09-06 03:15:43 +00:00
Bruce Momjian
e30b283f30 Attached is my attempt to clean up the horrors of the ExecSQL() method in
the JDBC driver.

I've done this by extracting it into a new method object called
QueryExecutor (should go into org/postgresql/core/) and then taking it
apart into different methods in that class.

A short summary:

* Extracted ExecSQL() from Connection into a method object called
  QueryExecutor.

* Moved ReceiveFields() from Connection to QueryExecutor.

* Extracted parts of the original ExecSQL() method body into smaller
  methods on QueryExecutor.

* Bug fix: The instance variable "pid" in Connection was used in two
  places with different meaning. Both were probably in dead code, but it's
  fixed anyway.

Anders Bengtsson
2001-09-06 03:13:34 +00:00
Bruce Momjian
d99794e613 Attached is a patch for current CVS, consisting of a cvs diff -c
for the changed files and a few new files:
- test/jdbc2/BatchExecuteTest.java
- util/MessageTranslator.java
- jdbc2/PBatchUpdateException.java

As an aside, is this the best way to submit a patch consisting
of both changed and new files? Or is there a smarter cvs command
which gets them all in one patch file?

This patch fixes batch processing in the JDBC driver to be
JDBC-2 compliant. Specifically, the changes introduced by this
patch are:

1) Statement.executeBatch() no longer commits or rolls back a
transaction, as this is not prescribed by the JDBC spec. Its up
to the application to disable autocommit and to commit or
rollback the transaction. Where JDBC talks about "executing the
statements as a unit", it means executing the statements in one
round trip to the backend for better performance, it does not
mean executing the statements in a transaction.

2) Statement.executeBatch() now throws a BatchUpdateException()
as required by the JDBC spec. The significance of this is that
the receiver of the exception gets the updateCounts of the
commands that succeeded before the error occurred. In order for
the messages to be translatable, java.sql.BatchUpdateException
is extended by org.postgresql.jdbc2.PBatchUpdateException() and
the localization code is factored out from
org.postgresql.util.PSQLException to a separate singleton class
org.postgresql.util.MessageTranslator.

3) When there is no batch or there are 0 statements in the batch
when Statement.executeBatch() is called, do not throw an
SQLException, but silently do nothing and return an update count
array of length 0. The JDBC spec says "Throws an SQLException if
the driver does not support batch statements", which is clearly
not the case. See testExecuteEmptyBatch() in
BatchExecuteTest.java for an example. The message
postgresql.stat.batch.empty is removed from the language
specific properties files.

4) When Statement.executeBatch() is performed, reset the
statement's list of batch commands to empty. The JDBC spec isn't
100% clear about this. This behaviour is only documented in the
Java tutorial
(http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/batchupdates.html).
Note that the Oracle JDBC driver also resets the statement's
list in executeBatch(), and this seems the most reasonable
interpretation.

5) A new test case is added to the JDBC test suite which tests
various aspects of batch processing. See the new file
BatchExecuteTest.java.

Regards,
Ren? Pijlman
2001-09-06 03:11:59 +00:00
Bruce Momjian
e5d3df2019 Apply jdbc error changes. 2001-09-06 03:07:27 +00:00
Bruce Momjian
914eec7d3b Sync up jdbc error files. 2001-09-06 03:03:37 +00:00
Bruce Momjian
02566f14f4 On Sat, Aug 25, 2001 at 08:15:45PM -0400, Bruce Momjian wrote:
> Can someone research this and figure out what the proper solution for
> this is?  Seems we are going around in circles if we keep
> adding/removing DLLIMPORT.

I believe that the attached patch is the correct solution --  I apologize
for the gyrations.  With the attached patch, Cygwin libpq++ builds
cleanly again.  The root cause was that DLLIMPORT was defaulting to
__declspec(dllimport) since BUILDING_DLL was *not* defined when building
the libpq++ DLL.

Unfortunately, to test my patch requires changing the following makefile:

    src/interfaces/libpq++/examples/Makefile

and the #includes in all of the *.cc to build against the source tree
instead of the following hardcoded installation directory structure:

    /usr/local/pgsql

I was able to manually build

    src/interfaces/libpq++/examples/testlibpq0.exe

against my Cygwin libpq++ without errors.  However, I have not tried to
actually test testlibpq0.exe.

Is this sufficient?  Or, do you want me to clean up libpq++/examples too?
(Or, is it silly to even ask? :,))  Let me know how you want to proceed and
I will submit a patch to pgsql-patches.

Jason Tishler
2001-09-06 02:58:33 +00:00
Bruce Momjian
16910e44de Next version of patch.
Now with documentation update and disabling of UTF conversion for Tcl <=8.0

On Fri, 24 Aug 2001, Vsevolod Lobko wrote:

> On Thu, 23 Aug 2001, Tom Lane wrote:
>
> > > Is this looks better?
> >
> > It does, but one small gripe: the lack of semicolons will probably cause
> > pg_indent to mess up the indentation.  (I know emacs' autoindent mode
> > will not work nicely with it, either.)  Please set up the macros so that
> > you write
> >
> >                         UTF_BEGIN;
> >                         Tcl_DStringAppend(&unknown_src, UTF_E2U(part), -1);
> >                         UTF_END;
> >
> > and then I'll be happy.
>
> Attached revised patch
>
> > Your point about overhead is a good one, so I retract the gripe about
> > using a configure switch.  But please include documentation patches to
> > describe the configure option in the administrator's guide (installation
> > section).
>
> This patch still uses configure switch for enabling feature.
>
> For enabling based on tcl version we have 2 posibilites:
>  1) having feature enabled by default, but in pltcl.c check for tcl
>     version and disable it for old versions
>  2) enable or disable at configure time based on tcl version, but there
>     are problem - current configure don't checks for tcl version at all
>     and my configure skills not enought for adding this
>

Vsevolod Lobko
2001-09-06 02:56:32 +00:00
Bruce Momjian
37c0b64875 Below is the patch against current cvs for libpgtcl and
two additional files win32.mak and libpgtcl.def.
This patch allows to compile libpgtcl.dll on Windows
with tcl > 8.0. I've tested it on WinNT (VC6.0), SUSE Linux (7.0)
and Solaris 2.6 with tcl 8.3.3.

Mikhail Terekhov
2001-09-06 02:54:56 +00:00
Bruce Momjian
ee0ef05b8d Hello, i just reviewed the win32 errno patch and i saw that maybe i didn't
really played it totally safe in my last suggestion, the system table might
pick up the msg but not the netmsg.dll, so better try both.
I also added a hex printout of the "errno" appended to all messages, that's
nicer.

If anyone hate my coding style, or that i'm using goto constructs, just tell
me, and i'll rework it into a nested if () thing.

Magnus Naeslund(f)
2001-09-06 02:52:00 +00:00
Tom Lane
6c91eef7b7 Fix handling of pg_type.typdefault per bug report from Dave Blasby.
If there's anyone out there who's actually using datatype-defined
default values, this will be an incompatible change in behavior ...
but the old behavior was so broken that I doubt anyone was using it.
2001-09-06 02:07:42 +00:00