Commit Graph

5646 Commits

Author SHA1 Message Date
Tom Lane 2d4a05d7df Update strings test to reflect the fact that casting to char() will
now truncate or pad to the specified length.
2000-01-17 00:16:41 +00:00
Tom Lane 49528361f5 Create a new parsetree node type, TypeCast, so that transformation of
SQL cast constructs can be performed during expression transformation
instead of during parsing.  This allows constructs like x::numeric(9,2)
and x::int2::float8 to behave as one would expect.
2000-01-17 00:14:49 +00:00
Tom Lane e0bd60171a Rearrange coding in COPY so that expansible string buffer for data being
read is reused for successive attributes, instead of being deleted and
recreated from scratch for each value read in.  This reduces palloc/pfree
overhead a lot.  COPY IN still seems to be noticeably slower than it was
in 6.5 --- we need to figure out why.  This change takes care of the only
major performance loss I can see in copy.c itself, so the performance
problem is at a lower level somewhere.
2000-01-16 21:37:50 +00:00
Tom Lane d00391e7ac Sigh, I'm an idiot ... I broke the async startup logic a couple days ago,
by creating a race condition.  It wasn't waiting for select() to say
write-ready immediately after connect, which meant that you might get
an unhelpful 'broken pipe' error message if connect failed, rather than
the intended error message.
2000-01-16 21:18:52 +00:00
Tom Lane fdc85f50a3 Put back change to 'connection failed' message formatting that someone
overwrote.
2000-01-16 20:34:54 +00:00
Peter Eisentraut bb61218c5f Removed lextest, because lex'ed files are now in the distribution. 2000-01-16 20:08:45 +00:00
Peter Eisentraut 759fba4873 Included all yacc and lex files into the distribution. 2000-01-16 20:05:00 +00:00
Tom Lane a4e1304ed1 Add check that inherited constraints and defaults work. 2000-01-16 19:57:48 +00:00
Tom Lane 47a895fe72 Repair breakage of inherited constraint expressions --- needed a
CommandCounterIncrement to make new relation visible before trying to
parse/deparse the expressions.  Also, eliminate unnecessary
setheapoverride calls in AddNewAttributeTuples.
2000-01-16 19:57:00 +00:00
Tom Lane 7d715ba063 Fix broken FOR UPDATE error message. 2000-01-16 08:21:59 +00:00
Bruce Momjian faff1b776b Fix passing of atttypmod that Tom found. 2000-01-16 05:18:19 +00:00
Tom Lane 97e82dc72c Clean up pg_dump coredumps caused by change of output formatting for
oidvector/int2vector.  pg_dump code was assuming that it would see
exactly FUNC_MAX_ARGS integers in the string returned by the backend.
That's no longer true.  (Perhaps that change wasn't such a good idea
after all --- will it break any other applications??)
2000-01-16 03:54:58 +00:00
Tom Lane b0b3187bb4 Add some examples to numeric regress test to verify that recently-fixed
problems are indeed fixed.
2000-01-15 23:44:17 +00:00
Tom Lane 3cb8c8da68 Clean up problems with rounding/overflow code in NUMERIC, particularly
the case wherein zero was rejected for a field like NUMERIC(4,4).
Miscellaneous other code beautification efforts.
2000-01-15 23:42:49 +00:00
Tom Lane 584e646ad8 Fix a passel of problems with incorrect calls to typinput and typoutput
functions, which would lead to trouble with datatypes that paid attention
to the typelem or typmod parameters to these functions.  In particular,
incorrect code in pg_aggregate.c explains the platform-specific failures
that have been reported in NUMERIC avg().
2000-01-15 22:43:25 +00:00
Tom Lane 5e6004135b Now that new psql is fflush()'ing properly, it emerges that several
regress test expected outputs were committed with NOTICEs appearing out
of order.  Update to correct results.
2000-01-15 19:18:24 +00:00
Tom Lane 6ce5e0abb6 Update arrays regress test to reflect fact that several things
work now that did not work in 6.5.
2000-01-15 19:11:40 +00:00
Peter Eisentraut 2a1bfbce24 - Allow array on int8
- Prevent permissions on indexes
- Instituted --enable-multibyte option and tweaked the MB build process where necessary
- initdb prompts for superuser password
2000-01-15 18:30:35 +00:00
Tatsuo Ishii bfbd58ce13 Adapt to the changes of libpq(eliminateing using putenv()). 2000-01-15 05:38:50 +00:00
Tatsuo Ishii 8fc386a2d8 Eliminate using putenv(). 2000-01-15 05:37:21 +00:00
Tatsuo Ishii 6095e36cca Prepare for new psql 2000-01-15 05:17:45 +00:00
Peter Eisentraut 1cd4c14116 Fixed all elog related warnings, as well as a few others. 2000-01-15 02:59:43 +00:00
Peter Eisentraut 7c9390caa1 Fixed psql variables vs array syntax, as well as minor psql enhancements 2000-01-14 22:18:03 +00:00
Peter Eisentraut 4ceb2d0cb6 * User management commands no longer user pg_exec_query_dest -> more robust
* Let unprivileged users change their own passwords.

* The password is now an Sconst in the parser, which better reflects its text datatype and also
forces users to quote them.

* If your password is NULL you won't be written to the password file, meaning you can't connect
until you have a password set up (if you use password authentication).

* When you drop a user that owns a database you get an error. The database is not gone.
2000-01-14 22:11:38 +00:00
Tom Lane 2af360ed1c Clean up some problems in new asynchronous-connection logic
in libpq --- mostly, poor response to error conditions.  You now actually
get to see the postmaster's 'The Data Base System is starting up' message,
which you didn't before.  I suspect the SSL code is still broken though.
2000-01-14 05:33:15 +00:00
Tom Lane 0e6d72db55 Make PSQLexec's behavior on loss of connection more reasonable;
report original error before attempting reset, not after.
2000-01-14 05:28:31 +00:00
Tom Lane 19ff2e4d55 Make connection-failed messages a little friendlier on
80-column displays...
2000-01-14 04:01:55 +00:00
Tom Lane 6256fcb927 Remove redundant and now-incorrect declaration of pstrdup. 2000-01-14 01:36:42 +00:00
Tom Lane 9b003129fe Bump catversion to ensure initdb. 2000-01-14 00:53:50 +00:00
Tom Lane 338fd40bfc Revise quoting conventions in outfuncs/readfuncs so that nodeRead doesn't
choke on relation or attribute names containing spaces, quotes, or other
special characters.  This fixes a TODO item.  It also forces initdb,
since stored rule strings change.
2000-01-14 00:53:21 +00:00
Peter Eisentraut 46a28f1b14 Fixed everything in and surrounding createdb and dropdb to make it more
error-proof. Rearranged some old code and removed dead sections.
2000-01-13 18:26:18 +00:00
Peter Eisentraut bfa3b59d25 initdb didn't load pg_description 2000-01-13 18:22:10 +00:00
Tatsuo Ishii 1f9d535aca Add UDC (User Defined Characters) support to SJIS/EUC_JP conversion
Update README so that it reflects all source file names
Add an entry to make sjistest (testing between SJIS/EUC_JP conversion)
2000-01-13 01:08:14 +00:00
Peter Eisentraut f6689a328f Fixed a few "fixes" and bugs. Adjusted messages and options to GNU suggestions. 2000-01-12 19:36:36 +00:00
Tatsuo Ishii 267c6c7f06 Multi-byte case fix by Oliver Elphick (olly@lfix.co.uk) 2000-01-12 13:08:55 +00:00
Tom Lane 0b14b0c87e Use fmgr_array_args() to avoid dependency on FUNC_MAX_ARGS. 2000-01-12 05:28:47 +00:00
Tom Lane 72ed6ff5ad In PQfn(), defend against too many args, and avoid dependency
on FUNC_MAX_ARGS by using an appropriate fmgr() call.
2000-01-12 05:27:20 +00:00
Tom Lane ef899c7f62 RemoveFunction didn't defend against too many args. 2000-01-12 05:25:09 +00:00
Tom Lane 488f315913 Defend against > INDEX_MAX_KEYS keys in an index. 2000-01-12 05:04:42 +00:00
Tom Lane 8acc568a6b CommentProc was careless about too many arguments. 2000-01-12 04:59:41 +00:00
Tom Lane 421d4f9bd7 Put back erroneously removed zeroing of sentinel elements
in indexkeys, classlist arrays.
2000-01-12 00:53:21 +00:00
Tom Lane b9d832f6ef Make FUNC_MAX_ARGS equal INDEX_MAX_KEYS, as it should.
Set default INDEX_MAX_KEYS to 16.  Document minimum safe value is 9.
2000-01-11 05:58:55 +00:00
Tom Lane f1e1634e72 oid8 => oidvector in alter_table regress test 2000-01-11 05:56:33 +00:00
Tom Lane 41f17e676f Another FUNC_MAX_ARGS tweak. 2000-01-11 05:41:49 +00:00
Tom Lane fa3aa5e1bb Wrong boundary condition on number-of-args check. 2000-01-11 05:22:25 +00:00
Tom Lane cc2e19ef9a Ah-hah, there are attribute size constants lurking here too. 2000-01-11 05:18:42 +00:00
Tom Lane 5c2fb2a1e2 Use symbolic INDEX_MAX_KEYS in pg_type entries for oidvector
and int2vector.
2000-01-11 04:02:28 +00:00
Tom Lane c2fa275d20 Correct hardwired type information in bootstrap. 2000-01-11 04:00:30 +00:00
Tom Lane 7bc1fbe100 Remove no-longer-used symbols. 2000-01-11 03:59:31 +00:00
Bruce Momjian bd52f4bffd More cleanups. Still doesn't work. 2000-01-11 03:33:14 +00:00
Bruce Momjian aadd14b8f2 More cleanups. 2000-01-11 02:46:48 +00:00
Bruce Momjian 401e6de7ee More fixes, but still need +1 for FUNC_MAX_ARGS 2000-01-11 02:30:06 +00:00
Tom Lane bf49f0849d Remove outdated comment about 8 arguments. 2000-01-11 01:42:08 +00:00
Bruce Momjian a97caacb5e Fix initdb so it works, but still only for 8. 2000-01-10 23:03:41 +00:00
Bruce Momjian 182162a388 Update type stuff. 2000-01-10 20:46:23 +00:00
Bruce Momjian dd8b0e67ec Cleanup for func args > 8. 2000-01-10 20:23:31 +00:00
Bruce Momjian 2d920dc717 More updates for function call interface > 8. 2000-01-10 18:27:41 +00:00
Bruce Momjian 0bdd0cdd98 Update fmgr to allow 32 arguments. 2000-01-10 18:18:30 +00:00
Bruce Momjian 8a093d0ae3 Make number of args to a function configurable. 2000-01-10 17:14:46 +00:00
Bruce Momjian 6456b17bc1 Rename oid8 -> oidvector and int28 -> int2vector. Cleanup of *out functions. 2000-01-10 16:13:23 +00:00
Bruce Momjian 3f03f74f36 Update int28out and out8out and _in_ functions to handle trailing zeros
properly.
2000-01-10 15:41:34 +00:00
Hiroshi Inoue 0f2e7948e2 Improve cache invalidation handling. Eespecially
this would fix TODO
* elog() flushes cache, try invalidating just entries from
  current xact, perhaps using invalidation cache
2000-01-10 06:30:56 +00:00
Bruce Momjian 5770935965 Fix oid8in and int28in for spaces 2000-01-10 05:23:47 +00:00
Bruce Momjian a040281787 Move fixes for >8 indexed fields. 2000-01-10 05:20:26 +00:00
Bruce Momjian b99f300675 Move INDEX_MAX_KEYS to postgres.h, and make it configurable for users. 2000-01-10 04:36:37 +00:00
Tom Lane fcb7c14d02 Repair subtle VACUUM bug that led to 'HEAP_MOVED_IN was not expected'
errors.  VACUUM normally compacts the table back-to-front, and stops
as soon as it gets to a page that it has moved some tuples onto.
(This logic doesn't make for a complete packing of the table, but it
should be pretty close.)  But the way it was checking whether it had
got to a page with some moved-in tuples was to look at whether the
current page was the same as the last page of the list of pages that
have enough free space to be move-in targets.  And there was other
code that would remove pages from that list once they got full.
There was a kluge that prevented the last list entry from being
removed, but it didn't get the job done.  Fixed by keeping a separate
variable that contains the largest block number into which a tuple
has been moved.  There's no longer any need to protect the last element
of the fraged_pages list.
Also, fix NOTICE messages to describe elapsed user/system CPU time
correctly.
2000-01-10 04:09:50 +00:00
Tom Lane b86ca72f39 Update platform-specific-expected-file support so that platforms can be
specified by regular-expression patterns.  Add some more files.
2000-01-09 20:54:36 +00:00
Tom Lane 4f9d74f98b install_plpgsql is no longer a regress test (it's done via createlang);
remove the no-longer-used files.
2000-01-09 19:34:43 +00:00
Tatsuo Ishii 85b309ee8f Add SetPidFile() and friends. 2000-01-09 12:19:27 +00:00
Tatsuo Ishii ac0d141ead Do not start if postmaster is running. 2000-01-09 12:17:33 +00:00
Tatsuo Ishii 10283ee6a4 Move SetPidFile() and firends to utils/init/miscinit.c from
postmaster/postmaster.c so that
tcop/postgres.c can use them. Now we have an interlock between
postmaster and postgres.
2000-01-09 12:15:57 +00:00
Tatsuo Ishii 3f3421f905 Move SetPidFile() and firends to utils/init/miscinit.c so that
tcop/postgres.c can use them. Now we have an interlock between
postmaster and postgres.
2000-01-09 12:13:24 +00:00
Tatsuo Ishii 359652898b Add more portability to echo -n (code stolen from createlang)
Do not start postmaster if postgres is running
2000-01-09 12:06:52 +00:00
Tom Lane bd62e062aa New scheme for managing platform-specific regress test result files.
Instead of hard-wiring one result file per platform, there is a map file
'resultmap' that says which one to use --- a lot like template/.similar.
I have only created entries in resultmap for my own platform (HPUX) so
far; feel free to add lines for other platforms.
2000-01-09 07:54:00 +00:00
Tom Lane 2a19ac97a7 Remove obsolete platform-specific comparison files. 2000-01-09 06:34:46 +00:00
Tom Lane 8ba050698b First examples of multiplatform result comparison files. 2000-01-09 06:32:33 +00:00
Tom Lane 62cbd53bcd Remove obsolete platform-specific regress test comparison files.
Note: don't put any of these back till you've grokked the new code for
platform-specific comparisons that I'm about to commit...
2000-01-09 06:30:55 +00:00
Tom Lane fc0a46dc16 Remove CVS $Header lines from a couple of regress test files that had
them --- it is just *way* too painful to keep expected results in sync
when these are present.
2000-01-09 04:01:49 +00:00
Tom Lane f5b754a492 Update remaining tests for new psql, with the exception of 'arrays'. 2000-01-09 03:50:27 +00:00
Tom Lane 260b6afc79 Update remaining tests for new psql, with the exception of 'arrays',
which is broken in some weird way that I don't understand.  I think it
may be exposing a bug in the new psql --- for one thing, I get different
results when I run psql by hand than the regress script gets.  What
the heck???
2000-01-09 03:48:39 +00:00
Tom Lane 0e821fb771 Fix some missing substitutions of _OBJWD_ and _DLSUFFIX_. 2000-01-09 02:48:01 +00:00
Tom Lane 166b5c1def Another round of planner/optimizer work. This is just restructuring and
code cleanup; no major improvements yet.  However, EXPLAIN does produce
more intuitive outputs for nested loops with indexscans now...
2000-01-09 00:26:47 +00:00
Bruce Momjian 69d4299e3e This patch removes the initialization of ri in loop in
quote_postgres(...) in ecpglib.c.

The code in CVS reads:

quote_postgres(char *arg, int lineno)
{
 char    *res = (char *) ecpg_alloc(2 * strlen(arg) + 3, lineno);
 int   i,
    ri = 0;

 if (!res)
  return (res);

 res[ri++] = '\'';
 for (i = 0, ri=0; arg[i]; i++, ri++)
 {
  switch (arg[i])
  {
   case '\'':
    res[ri++] = '\'';
    break;
   case '\\':
    res[ri++] = '\\';
    break;
   default:
    ;
  }

The problem here is that ri is reset to 0, thus overwriting the initial
quote.

Stephen Birch
2000-01-08 22:58:03 +00:00
Tom Lane 2515882a0f Modify PageIsEmpty and PageGetMaxOffsetNumber macros to behave sanely
if presented an uninitialized (all zeroes) page.  The system no longer
crashes hard if an all-zeroes page is present in a relation.  There seem
to be some boundary conditions where a page will be appended to a relation
and zeroed, but its page header is never initialized; until we can track
down and fix all of those, robustness seems like a good idea.
Also, clean up some obsolete and downright wrong comments.
2000-01-08 21:59:55 +00:00
Tom Lane b79e75d66f Need defense against oversize index entries in btree CREATE INDEX,
as well as when inserting entries into an existing index.
2000-01-08 21:24:49 +00:00
Bruce Momjian 8da88a6f2b Sorry, that I send this letter/patch again, but previous sending is
still
without answer. I want continue with to_char(), but I need any answer
for this patch. Please.

Thank! (and sorry of my impatient :-)
                                                        Karel
2000-01-07 17:22:47 +00:00
Tatsuo Ishii 27fdbca749 Correct grammatical error 2000-01-07 09:28:03 +00:00
Michael Meskes 33d71e3037 *** empty log message *** 2000-01-07 08:01:18 +00:00
Bruce Momjian 5633e22e2c Update pg_dumpall for new psql format. 2000-01-06 21:16:18 +00:00
Jan Wieck b7b6d4bf53 Changed "triggered data change violation" detection code
in trigger manager.

Jan
2000-01-06 20:47:01 +00:00
Jan Wieck 88016a564a Fixed bug in targetlist expression replacement of
SET DEFAULT referential action triggers.

Jan
2000-01-06 16:30:43 +00:00
Thomas G. Lockhart d1e6368816 Clean up header for uniform appearance throughout tests. 2000-01-06 06:41:55 +00:00
Thomas G. Lockhart 67ac38085c Update for new psql formatting. 2000-01-06 06:40:54 +00:00
Thomas G. Lockhart 6e0cc2ac45 Freshen up the banner displayed when running the regression test. 2000-01-06 06:40:18 +00:00
Bruce Momjian b78769fda2 Fix it's and its to be correct. 2000-01-05 18:23:54 +00:00
Thomas G. Lockhart c0cab6f4fa Update format to add uniform headers on files. 2000-01-05 17:32:29 +00:00
Thomas G. Lockhart 69789bf33d Update format to add uniform headers on files.
Update output to new psql conventions.
2000-01-05 17:32:18 +00:00
Thomas G. Lockhart 9c1b29816e Update output to new psql conventions. 2000-01-05 17:31:08 +00:00
Thomas G. Lockhart 6033cfd429 Fix spaces in text message. 2000-01-05 17:30:05 +00:00
Thomas G. Lockhart 4c4e68dccc Clean up format of tests.
Remove older "::" type coersion syntax in favor of extended SQL92 style.
Include a few new tests for datetime/timespan arithmetic.
2000-01-05 06:07:58 +00:00
Thomas G. Lockhart d83105539a Verified output from new psql.
Include a few new tests for datetime/timespan arithmetic.
2000-01-05 06:06:23 +00:00
Thomas G. Lockhart 24e8ca6ef9 Move numeric test to be near other numeric data types like int4 and float8. 2000-01-05 06:04:56 +00:00
Thomas G. Lockhart 61ef6a1a3f Clean up syntax to use SQL92-ish type coersion
rather than the Postgres "::" notation.
All of these tests have been completely inspected and give correct results.
2000-01-04 16:21:02 +00:00
Thomas G. Lockhart f54668d617 Match results with format from new psql.
All of these tests have been completely inspected and give correct results.
2000-01-04 16:19:34 +00:00
Thomas G. Lockhart 3ec826f99a Repair two recently reported problems:
1) datetime_pl_span() added the seconds field before adding the months
 field.  This lead to erroneous results for e.g.
   select datetime '1999-11-30' + timespan '1 mon - 1 sec';
 Reverse the order of operations to add months first.
2) tm2timespan() did all intermediate math as integer, converting to double
 at the very end. This resulted in hidden overflows when given very large
 integer days, hours, etc. For example,
   select '74565 days'::timespan;
 produced the wrong result. Change code to ensure that doubles are used
 for intermediate calculations.
Thanks to Olivier PRENANT <ohp@pyrenet.fr> and
 Tulassay Zsolt <zsolt@tek.bke.hu> for problem reports and to Tom Lane for
 accurate analyses.
2000-01-04 07:53:27 +00:00
Bruce Momjian aae7b19077 Update DATEDEBUG removal. 2000-01-02 02:32:37 +00:00
Bruce Momjian a8587d02eb Update length of timestamp to 30. 2000-01-02 02:11:08 +00:00
Bruce Momjian 7a877dfd2d Remove DATEDEBUG because it didn't look Y2K safe, and fix timestamp elog
to be Y2K safe.
2000-01-02 01:37:28 +00:00
Bruce Momjian eb9bb3de33 Make psql \dT always show descriptions. There is room. 1999-12-31 21:06:19 +00:00
Tom Lane d8f3752133 Generate double-sided LIKE indexquals that work even in weird locales,
by continuing to increment the rightmost character until we get a string
that is demonstrably greater than the pattern prefix.
1999-12-31 05:38:25 +00:00
Tom Lane 5f68d5c38f Clean up loose end in LIKE optimization fix: parser's code would generate
<= and >= indexquals from a LIKE even if the index in question didn't
support those operators.  (As, for example, a hash index does not.)
1999-12-31 03:41:03 +00:00
Tom Lane 2784a5aedf Clean up datatypes and comments for op_class() routine. 1999-12-31 03:18:43 +00:00
Tom Lane f35e1c8c1f Revise init_sequence so that it doesn't leak memory if the requested
sequence doesn't exist.
1999-12-31 00:54:27 +00:00
Tom Lane 8a40400d40 elog() was set up to call abort() if it saw an ERROR or FATAL exit
during InitProcessingMode and the CurrentTransactionState was neither
TRANS_DEFAULT nor TRANS_DISABLED.  Unfortunately, after someone's recent
change to start the transaction manager earlier in startup than it used
to be started, that caused an abort() and consequent database system
reset on quite harmless errors (such as rejecting an invalid user name!).
As far as I can see, the test on CurrentTransactionState was completely
useless anyway, so I've removed it.
1999-12-30 23:03:40 +00:00
Tatsuo Ishii 0022f21dcb Allow --with-mb=SQL_ASCII 1999-12-30 08:33:49 +00:00
Tom Lane 9c95f8c9b2 Repair bugs discussed in pghackers thread of 15 May 1999: creation of a
relcache entry no longer leaks a small amount of memory.  index_endscan
now releases all the memory acquired by index_beginscan, so callers of it
should NOT pfree the scan descriptor anymore.
1999-12-30 05:05:13 +00:00
Bruce Momjian 649ffe1616 Improve subquery error message, now says "More than one tuple returned
by subselect used as expression."
1999-12-29 22:57:17 +00:00
Bruce Momjian e1b212ff3b Move ipc patch into README.NT. 1999-12-29 10:28:00 +00:00
Bruce Momjian 25f187d339 Add NT patch. 1999-12-29 10:24:16 +00:00
Bruce Momjian f63ff18153 Move NT patch into readme. 1999-12-29 10:18:04 +00:00
Bruce Momjian 2e2fb0a2a6 Update comment. 1999-12-29 10:13:20 +00:00
Bruce Momjian b21ee21455 Update comments. 1999-12-29 10:12:23 +00:00
Jan Wieck e3cec20ccd Removed LZTEXT datatype as discussed.
Jan
1999-12-28 13:40:53 +00:00
Bruce Momjian e9bfedc9bc Fix length limit, MikeA 1999-12-27 18:21:07 +00:00
Bruce Momjian 635498623d Hi, all,
This is the patch for the final bit.  Sorry that it's separate.

Cheers...


MikeA
1999-12-27 15:45:04 +00:00
Bruce Momjian 24a0f021ef Hi, all
I finally got around to schlepping through pg_dump, to finish what I started
about three months (or more) ago.  Attached is a gzipped diff file to apply
in the bin/pg_dump directory.  This should remove all string length
dependencies, except one, which I'm working on.  It has been through some
rudimentary unit testing, but that's about it, so if any of you would give
it a more strenuous run-through, I'd be grateful for the feedback.

Cheers...

 Ansley, Michael
1999-12-27 15:42:44 +00:00
Tom Lane bc036a063d Put back erroneously-removed definition of 'defines' variable. 1999-12-26 21:31:35 +00:00
Tom Lane a6a70315af It turns out that the item size limit for btree indexes is about BLCKSZ/3,
not BLCKSZ/2 as some of us thought.  Add check for oversize item so that
failure is detected before corrupting the index, not after.
1999-12-26 03:48:22 +00:00
Tom Lane 350cb386af Clean up handling of explicit NULL constants. Cases like
SELECT null::text;
	SELECT int4fac(null);
work as expected now.  In some cases a NULL must be surrounded by
parentheses:
	SELECT 2 + null;                 fails
	SELECT 2 + (null);               OK
This is a grammatical ambiguity that seems difficult to avoid.  Other
than that, NULLs seem to behave about like you'd expect.  The internal
implementation is that NULL constants are typed as UNKNOWN (like
untyped string constants) until the parser can deduce the right type.
1999-12-24 06:43:34 +00:00
Michael Meskes bd5ea42a8d *** empty log message *** 1999-12-23 12:33:19 +00:00
Tatsuo Ishii e80ade5e22 Fix minor bug. 1999-12-22 04:41:17 +00:00
Tatsuo Ishii e3736d2c3a Add installtion of postmaster.opts.default. 1999-12-22 04:23:31 +00:00
Tatsuo Ishii b680d5bec7 Add installation of pg_ctl
Locate path of postmaster in a portable way (stolen from initdb)
Add postmaster.opts.default.sample which should be copied into
$PGLIB in the installtion process. Also, it will be installed into
$PGDATA while initdb is running.
1999-12-22 04:12:55 +00:00
Hiroshi Inoue a3e2bc732d to live in a transaction before access to db
during backend startup.
1999-12-22 00:07:16 +00:00
Jan Wieck 3e99158548 update_pg_pwd() is an AR trigger. Corrected return type.
Jan
1999-12-21 22:39:02 +00:00
Bruce Momjian b57b0e0445 The first fix is to allow an input file with a relative path and without
a ".pgc " extension. The second patch fixes a coredump when there is
more than one input file (in that case, cur and types were not set to
NULL before processing the second f ile)

The patch below modifies the accepted grammar of ecpg to accept

 FETCH [direction] [amount] cursor name

i.e. the IN|FROM clause becomes optional (as in Oracle and Informix).
This removes the incompatibility mentioned in section "Porting From
Other RDBMS Packages" p169, PostgreSQL Programmer's Guide. The grammar
is modified in such a way as to avoid shift/reduce conflicts. It does
not accept the statement "EXEC SQL FETCH;" anymore, as the old grammar
did (this seems to be a bug of the old grammar anyway).

This patch cleans up the handling of space characters in the scanner;
some patte rns require \n to be in {space}, some do not. A second fix is
the handling of cpp continuati on lines; the old pattern did not match
these. The parser is patched to fix an off-by-one error in the #line
directives. The pa rser is also enhanced to report the correct location
of errors in declarations in the "E XEC SQL DECLARE SECTION". Finally,
some right recursions in the parser were replaced by  left-recursions.


This patch adds preprocessor directives to ecpg; in particular

EXEC SQL IFDEF, EXEC SQL IFNDEF, EXEC SQL ELSE, EXEC SQL ELIF and EXEC SQL ENDIF

"EXEC SQL IFDEF" is used with defines made with "EXEC SQL DEFINE" and
defines, specified on the command line with -D. Defines, specified on
the command line are persistent across multiple input files. Defines can
be nested up to a maximum level of 128 (see patch). There is a fair
amount of error checking to make sure directives are matched properly. I
need preprocessor directives for porting code, that is written for an
Informix database, to a PostgreSQL database, while maintaining
compatibility with the original code. I decided not to extend the
already large ecpg grammar. Everything is done in the scanner by adding
some states, e.g. to skip all input except newlines and directives. The
preprocessor commands are compatible with Informix. Oracle uses a cpp
replacement.

Rene Hogendoorn
1999-12-21 17:42:16 +00:00
Bruce Momjian bb50fb517f This patch will avoid SIGFPE on some geo functions , if PostgreSQL is compiled
with DEC C.

DEC C doesn't handle double values greater than DBL_MAX, but some
PostgreSQL geo functions assign greater than DBL_MAX values to some vars
in some special cases - that couses SIGFPE. I dunno if that is the only place
to fix to work well with DEC C.

Kirill Nosov.
1999-12-21 17:01:44 +00:00
Bruce Momjian 04c78e2eb4 autoconf 1999-12-21 16:56:42 +00:00
Bruce Momjian 6a554a07b4 Clean up qnx template finding. 1999-12-21 16:55:38 +00:00
Jan Wieck e2aef49694 Added empty TOASTER files and corrected some minor glitches
in regression tests.

Jan
1999-12-21 00:06:44 +00:00
Bruce Momjian 2c29c96ed6 tr cleanup 1999-12-20 14:41:55 +00:00
Jan Wieck 7c385f73e5 Required catalog changes for extended LONG attribute storage.
Jan
1999-12-20 10:40:43 +00:00
Bruce Momjian 665db209e5 Cleanup of effective username test. 1999-12-20 05:39:40 +00:00
Tom Lane f74b94db09 Finally found a platform which has finite() but nonetheless sets errno
rather than returning a NaN for bogus input to pow().  Namely, HPUX 10.20.
I think this is sufficient evidence for what I thought all along, which
is that the float.c code *must* look at errno whether finite() exists or
not.
1999-12-20 02:15:35 +00:00
Tom Lane 76b110c82a Clean up some minor gcc warnings. 1999-12-20 01:41:32 +00:00
Tom Lane ec806d72c0 Clean up some minor gcc warnings. 1999-12-20 01:34:19 +00:00
Tom Lane 80dc7e207a Clean up some minor gcc warnings. I'm not touching the
major one, though, which is the truly ugly stores into libpq private
storage.  Can't you find a better way to do this?
1999-12-20 01:31:26 +00:00
Tom Lane 939229904a Clean up some minor gcc warnings. 1999-12-20 01:23:04 +00:00
Tom Lane c16afb4e24 Whoever touched this code last doesn't seem to understand
what a header file is for :-(
1999-12-20 01:19:58 +00:00
Tom Lane 76898cd330 Avoid compiler warnings on systems that have snprintf and/or vsnprintf
but do not bother to declare them in <stdio.h>.  Seems to be a more
common omission than you'd think...
1999-12-20 00:51:25 +00:00
Bruce Momjian 095d83e129 Cleanup --alldb option handling. 1999-12-18 08:46:44 +00:00
Bruce Momjian d2cf8b4776 Cleanup vacuumdb 1999-12-18 08:39:12 +00:00
Bruce Momjian 1c2257648a > > It would be nice for new users; I think it would make it easier
> > for them to actually set out and do it.  Many new users are
> > of the not-so-knowledgable variety, and shell scripting isn't
> > something they want to undertake.
>
> Can someone modify the vacuumdb shell script to do that?
i tried it... it seems to work

neko@kredit.sth.sz
1999-12-18 08:34:50 +00:00
Bruce Momjian fd96e1754c Finally initdb.sh works. Was problem with assuming EUID was defined. 1999-12-18 04:04:24 +00:00
Bruce Momjian 12118301fd initdb cleanup 1999-12-18 03:31:14 +00:00
Bruce Momjian f08e8ae7cb initdb cleanup 1999-12-18 03:21:21 +00:00
Bruce Momjian a08eb45c52 More initdb cleanup 1999-12-18 02:56:01 +00:00
Bruce Momjian 24edd34da5 Cleanup of initdb.sh script to be portable, at least marginally. 1999-12-18 02:48:53 +00:00
Bruce Momjian 65f694f802 Add cvs. 1999-12-18 00:34:48 +00:00
Bruce Momjian 93ca944077 autoconf 1999-12-17 18:19:30 +00:00
Bruce Momjian 9f013a552a Lowercase $host for QNX. 1999-12-17 18:18:26 +00:00
Bruce Momjian 1520f60f0e Remove unused files. 1999-12-17 18:07:17 +00:00
Bruce Momjian 5c99f9cd84 Fix MULTIBYTE handling in string by using strcat. 1999-12-17 18:05:32 +00:00
Jan Wieck 219652d5f7 Okay, this is how it looks: Please apply the attached patch to the current
sources, otherwise this whole things fails anyway (fails to create the
views).

Peter Eisentraut

Manually applied - Jan
1999-12-17 16:53:11 +00:00
Thomas G. Lockhart aac9f5bee8 Re-enable makeAttr() if ENABLE_OUTER_JOINS is defined.
Somehow got bracketed with #ifdef NOT_USED instead.
1999-12-17 14:47:35 +00:00
Bruce Momjian 4f73187bb7 ANother initdb cleanup 1999-12-17 03:46:33 +00:00
Bruce Momjian 21992ed10a Reverse out nextval patch. 1999-12-17 01:25:25 +00:00
Bruce Momjian ac00256ceb initdb.sh fix from Peter. 1999-12-17 01:16:03 +00:00
Bruce Momjian 83bad7c063 This is my -- hopefully sufficiently portable -- attempt at cleaning out
initdb. No more obscure dependencies on environment variables or paths.
It
now finds the templates and the right postgres itself (with cmd line
options as fallback). It also no longer depends on $USER (su safe), and
doesn't advertise that --username allows you to install the db as a
different user, since that doesn't work anyway. Also, recovery and
cleanup
on all errors. Consistent options, clearer documentation.

Please take a look at this and adopt it if you feel it's safe enough. I
have simulated all the stupid circumstances I could think of, but you
never know with shell scripts.

Oh yeah, you can give the postgres user a default password now.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-17 01:05:31 +00:00
Bruce Momjian 1b22a8cb03 Clear paren level flag on \r or any backslash command, rather than
keeping parenlevel unchanged.
1999-12-16 23:54:41 +00:00
Jan Wieck 397e9b32a3 Some changes to prepare for LONG attributes.
Jan
1999-12-16 22:20:03 +00:00
Bruce Momjian 5ca971a18a Hi,
I sending promised patch with:

        * getopt_long() - for pg_dump (portable)

        * and "Usage: " changes in scripts in src/bin/
          - this changes are cosmetic only, not change any
          feature ...etc.

 All PostgreSQL routines (scripts) support now long options and
help's output is alike for all scripts and all support -? or --help.

                                                Karel

Karel Zak <zakkr@zf.jcu.cz>              http://home.zf.jcu.cz/~zakkr/
1999-12-16 20:10:02 +00:00
Bruce Momjian cf374febf5 >Turning nextval and currval into keywords is not an acceptable way to
>go about this.  That will risk breaking existing applications that use
>those names as column names.
>
>It should actually almost work to write sq.nextval as things stand,
>because Postgres has for a long time considered table.function and
>function(table) to be interchangeable notations for certain kinds of
>functions.  nextval doesn't seem to be one of that kind of function,
>at the moment.  I'd suggest leaving the grammar as it was, and taking a
>look at ParseFuncOrColumn in parse_func.c to see if you can't persuade
>it to accept the sequence functions in that style.

OK, good point. I tried to implement it somewhere else and ended up
extending transformAttr. Attached you'll find the patch.

Jeroen van Vianen
1999-12-16 20:07:41 +00:00
Bruce Momjian 99b8f84511 Here's the Create/Alter/Drop Group stuff that's been really overdue. I
didn't have time for documentation yet, but I'll write some. There are
still some things to work out what happens when you alter or drop users,
but the group stuff in and by itself is done.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-16 17:24:19 +00:00
Bruce Momjian 4cb1fb6f59 Update for QNX. 1999-12-16 16:52:53 +00:00
Bruce Momjian 8d49a6608a autoconf 1999-12-16 16:34:06 +00:00
Michael Meskes 50a5b4ab41 *** empty log message *** 1999-12-16 06:53:12 +00:00
Bruce Momjian d033e17530 Ethernet MAC addresses (macaddr type) are not compared correctly for
equality.  The lobits macro is wrong and extracts the wrong set of
bits out of the structure.

To exhibit the problem:

select '000000:000000'::macaddr = '000000:110000'::macaddr ;
?column?
--------
t
(1 row)

Daniel Boyd
1999-12-16 01:30:49 +00:00
Bruce Momjian 7585deb087 I have done the QNX4 port with the current source tree. The number of
backend/Makefiles to be patched could significantly be reduced since
they
have been adopted to the QNX4 needs.

Andreas Kardos
1999-12-16 01:25:23 +00:00
Bruce Momjian 9805abb0fb This patch solves a couple of memory leaks in ecpglib.c. The patch is
ok for both the
development tree (CVS) and for 6.5.3.

 Stephen Birch
1999-12-14 22:03:48 +00:00
Tom Lane 7431796b46 fix_parsetree_attnums was not nearly smart enough about walking parse
trees.  Also rewrite find_all_inheritors() in a more intelligible style.
1999-12-14 03:35:28 +00:00
Bruce Momjian 549a8ba59a > From what I gather, this should be a little cleaner because the
triggered
> function now returns the right datatype.

Oops, I got crossed up with Jan's improvements. Ignore this.

--
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
1999-12-14 00:17:33 +00:00
Bruce Momjian f5a613c0ed >From what I gather, this should be a little cleaner because the
triggered
function now returns the right datatype.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-14 00:12:06 +00:00
Bruce Momjian bcaabc5698 Depending on my interpreting (and programming) skills, this might solve
anywhere from zero to two TODO items.

* Allow flag to control COPY input/output of NULLs

I got this:
COPY table .... [ WITH NULL AS 'string' ]
which does what you'd expect. The default is \N, otherwise you can use
empty strings, etc. On Copy In this acts like a filter: every data item
that looks like 'string' becomes a NULL. Pretty straightforward.

This also seems to be related to

* Make postgres user have a password by default

If I recall this discussion correctly, the problem was actually that the
default password for the postgres (or any) user is in fact "\N", because
of the way copy is used. With this change, the file pg_pwd is copied out
with nulls as empty strings, so if someone doesn't have a password, the
password is just '', which one would expect from a new account. I don't
think anyone really wants a hard-coded default password.

Peter Eisentraut                  Sernanders väg 10:115
1999-12-14 00:08:21 +00:00
Bruce Momjian a82f9ffde6 New LDOUT makefile variable for QNX os. 1999-12-13 22:35:27 +00:00
Bruce Momjian 662371cc5d Prevent _deadcode from showing in ctags and mkid 1999-12-13 04:54:01 +00:00
Tom Lane a8ae19ec3d aggregate(DISTINCT ...) works, per SQL spec.
Note this forces initdb because of change of Aggref node in stored rules.
1999-12-13 01:27:21 +00:00
Tom Lane efb36d2be8 any_ordering_op()'s argument should be declared Oid not int. 1999-12-12 20:51:29 +00:00
Bruce Momjian cb00b7faa5 I'm in TODO mood today ...
* Document/trigger/rule so changes to pg_shadow recreate pg_pwd

I did it with a trigger and it seems to work like a charm. The function
that already updates the file for create and alter user has been made a
built-in "SQL" function and a trigger is created at initdb time.

Comments around the pg_pwd updating function seem to be worried about
this
routine being called concurrently, but I really don't see a reason to
worry about this. Verify for yourself. I guess we never had a system
trigger before, so treat this with care, and feel free to adjust the
nomenclature as well.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-12 05:57:36 +00:00
Bruce Momjian 11023eb1f5 Meanwhile, database names with single quotes in names don't work very well
at all, and because of shell quoting rules this can't be fixed, so I put
in error messages to that end.

Also, calling create or drop database in a transaction block is not so
good either, because the file system mysteriously refuses to roll back rm
calls on transaction aborts. :) So I put in checks to see if a transaction
is in progress and signal an error.

Also I put the whole call in a transaction of its own to be able to roll
back changes to pg_database in case the file system operations fail.

The alternative location issues I posted recently were untouched, awaiting
the outcome of that discussion. Other than that, this should be much more
fool-proof now.

The docs I cleaned up as well.

Peter Eisentraut                  Sernanders väg 10:115
1999-12-12 05:15:10 +00:00
Bruce Momjian 1ff0a475ee Fix for psql from Peter. 1999-12-11 21:35:49 +00:00
Bruce Momjian 298845a6f0 Allow ; in () in psql. 1999-12-11 01:03:36 +00:00
Bruce Momjian e639a1a6a8 This takes care of TODO item
* pg_dump should preserve primary key information

Also a couple of warnings removed.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-11 00:31:05 +00:00
Bruce Momjian 3c75d64f40 Remove old file. 1999-12-10 17:46:41 +00:00
Bruce Momjian c91e5a4465 Update drop.sql 1999-12-10 17:32:57 +00:00
Bruce Momjian c613e69f40 Rename destroy.sql to drop.sql. 1999-12-10 17:31:30 +00:00
Jan Wieck 62c42a05a2 Added global variable to have RI triggers override
time qualification of HeapTupleSatisfiesSnapshot()

Jan
1999-12-10 12:34:15 +00:00
Tatsuo Ishii d31ff14ed8 Fix memory overrun while setting ps status 1999-12-10 10:29:01 +00:00
Tom Lane 18c3000286 Teach grammar and parser about aggregate(DISTINCT ...). No implementation
yet, but at least we can give a better error message:
regression=> select count(distinct f1) from int4_tbl;
ERROR:  aggregate(DISTINCT ...) is not implemented yet
instead of 'parser: parse error at or near distinct'.
1999-12-10 07:37:35 +00:00
Bruce Momjian ecba5d308c Remove unneeded action. 1999-12-10 05:17:13 +00:00