Commit Graph

11533 Commits

Author SHA1 Message Date
Tom Lane c6106d91e2 Fix regression test broken by recent view change. 2003-07-21 20:24:31 +00:00
Tom Lane 5e6d691e0d Error message editing in backend/executor. 2003-07-21 17:05:12 +00:00
Bruce Momjian 82f18c4a2c Fix relkind test for pg_tables.
Mike Quinn
2003-07-21 15:20:27 +00:00
Tom Lane d85286305d Error message editing in backend/catalog. 2003-07-21 01:59:11 +00:00
Tom Lane da4ed8bfdd Another round of error message editing, covering backend/commands/. 2003-07-20 21:56:35 +00:00
Bruce Momjian 9132506477 Add Opteron/Itanium comment. 2003-07-20 04:31:32 +00:00
Tom Lane fa3bd4dbd0 Error message editing: finish up undone task of reporting the problem
xid when we fail to access pg_clog.
2003-07-19 21:37:37 +00:00
Tom Lane 2a4a0c4d71 Add ereport-related functions to GETTEXT_TRIGGERS list. 2003-07-19 20:32:12 +00:00
Tom Lane a56ff9a0bd Another round of error message editing, covering backend/parser/. 2003-07-19 20:20:53 +00:00
Tom Lane 216311d590 First bits of work on error message editing. 2003-07-18 23:20:33 +00:00
Bruce Momjian 44f665bf40 Add cleaner formatting to config file. 2003-07-18 19:16:03 +00:00
Michael Meskes 45d8f61ff2 Added more compat stuff ot the parser. 2003-07-18 14:32:56 +00:00
Tom Lane 5ea214b590 It seems some case-insensitive locales sort upper case before lower
(BBBB before bbbb) and others the other way around.  Provide comparison
files that cater to both approaches.
2003-07-18 03:21:53 +00:00
Tom Lane 157e17e20d Add an upper limit to IS_VALID_JULIAN() to defend against overflow in
date2j().  This ensures we give reasonable errors instead of bizarre
behavior for input dates far in the future.
2003-07-17 22:28:42 +00:00
Tom Lane 0347d310d7 Oh, for crying in a bucket ... relax Assert so that glibc's strxfrm
does not dump core.
2003-07-17 22:20:14 +00:00
Tom Lane 59d9a37080 Work around buggy strxfrm() present in some Solaris releases. 2003-07-17 20:52:36 +00:00
Tom Lane 0c172909d5 For COMMENT ON DATABASE where database name is unknown or not the current
database, emit a WARNING and do nothing, rather than raising ERROR.
Per recent discussion in which we concluded this is the best way to deal
with database dumps that are reloaded into a database of a new name.
2003-07-17 20:13:57 +00:00
Tom Lane 8cf63ba920 Repair boundary-case bug introduced by patch of two months ago that
fixed incorrect initial setting of StartUpID.  The logic in XLogWrite()
expects that Write->curridx is advanced to the next page as soon as
LogwrtResult points to the end of the current page, but StartupXLOG()
failed to make that happen when the old WAL ended exactly on a page
boundary.  Per trouble report from Hannu Krosing.
2003-07-17 16:45:04 +00:00
Michael Meskes c15b66ef82 Allow blanks at the end of numerical values. 2003-07-17 11:27:55 +00:00
Michael Meskes 7d32551a81 Fixed some bugs in Informix compat functions. 2003-07-17 07:54:29 +00:00
Tom Lane 764f72dc82 Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL convention
for the sign of timezone offsets, ie, positive is east from UTC.  These
were previously out of step with other operations that accept or show
timezones, such as I/O of timestamptz values.
2003-07-17 00:55:37 +00:00
Tom Lane 93236b58e0 Add defenses against trying to attach qual conditions to a setOperation
query node, since that won't work unless the planner is upgraded.
Someday we should try to support at least some cases of this, but for
now just plug the hole in the dike.  Per discussion with Dmitry Tkach.
2003-07-16 17:25:48 +00:00
Michael Meskes 96be4b28a3 Applied patch to fix two compatibility functions. 2003-07-16 13:18:51 +00:00
Tom Lane ffcb1491af Now that I look, SHOW TRANSACTION_ISOLATION isn't quite consistent
with SET TRANSACTION_ISOLATION, either.
2003-07-15 19:34:43 +00:00
Tom Lane cfa6999d3b Cause SHOW DATESTYLE to produce a string that will be accepted by SET
DATESTYLE, for instance 'SQL, European' instead of
'SQL with European conventions'.  Per gripe a month or two back from
Barry Lind.
2003-07-15 19:19:56 +00:00
Tom Lane 274328c8a8 Avoid use of int64_t, which seems not to be very portable. Simplify
padding logic for struct sockaddr_storage --- original version did not
do what it claimed to when SALEN is defined.
2003-07-15 17:54:34 +00:00
Tom Lane bbac4188f9 OSF supports pthreads, per Philip Yarra. 2003-07-15 17:28:36 +00:00
Michael Meskes 42df5e311f Started to create different error codes for different backend messages. 2003-07-15 12:38:38 +00:00
Tom Lane 9117e55493 Tweak original coding so that we can determine the platform-specific
shared_buffers and max_connections values to use before we run the
bootstrap process.  Without this, initdb would fail on platforms where
the hardwired default values are too large.  (We could get around that
by making the hardwired defaults tiny, perhaps, but why slow down
bootstrap by starving it for buffers...)
2003-07-15 00:11:14 +00:00
Tom Lane 683f4d0a25 Remove duplicate definition of ERROR. 2003-07-14 23:36:15 +00:00
Tom Lane 3d09f6c560 Make cost estimates for SubqueryScan more realistic: charge cpu_tuple_cost
for each row processed, and don't forget the evaluation cost of any
restriction clauses attached to the node.  Per discussion with Greg Stark.
2003-07-14 22:35:54 +00:00
Tom Lane b800196230 Fix typo in comment, as noted by Weiping He. 2003-07-14 20:34:18 +00:00
Tom Lane de98a7e23a The default values for shared_buffers and max_connections are now 1000
and 100 respectively, if the platform will allow it.  initdb selects
values that are not too large to allow the postmaster to start, and
places these values in the installed postgresql.conf file.  This allows
us to continue to start up out-of-the-box on platforms with small SHMMAX,
while having somewhat-realistic default settings on platforms with
reasonable SHMMAX.  Per recent pghackers discussion.
2003-07-14 20:00:23 +00:00
Tom Lane 8460000069 Whoops, missed committing this change to match cosmetic changes in
ascii.c.
2003-07-14 16:58:24 +00:00
Tom Lane b1eb992cc5 Fix a *second* buffer overrun bug in to_ascii(). Grumble. 2003-07-14 16:41:38 +00:00
Michael Meskes 6eb27d16b6 Missed one rule in syncinc preproc.y which resulted in reduce/reduce conflicts. 2003-07-14 12:18:25 +00:00
Michael Meskes e895eb197d - Synced preproc.y with gram.y
- Init sqlca in ECPGprepare().
        - Added CLOSE DATABASE for Informix compatibility.
2003-07-14 10:16:45 +00:00
Bruce Momjian cbdda3e2a9 Add description for new GUC context.
Aizaz Ahmed
2003-07-09 17:57:47 +00:00
Michael Meskes 18936ef372 Argh! Missed one file. 2003-07-09 14:53:18 +00:00
Michael Meskes abfa8ae54f Fixed some Informix compat functions so they handle NULL resp. indicators better. 2003-07-09 13:49:38 +00:00
Bruce Momjian 0ecc8ac425 Add special checks for non-super-user setting LOG_MIN_DURATION_STATEMENT
to zero.
2003-07-09 08:51:19 +00:00
Bruce Momjian bf889e649a Add new USERLIMIT GUC source level so certain options can be disabled
or increased only by super-users.

This fixes problems caused by making certain variables SUSET for
security reasons.
2003-07-09 06:47:34 +00:00
Barry Lind 6896bfa86c Applied patch from Kim Ho @ redhat.com to make support for setObject() more
spec complient with regards to various data/time/timestamp objects

 Modified Files:
 	jdbc/org/postgresql/errors.properties
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-07-09 05:12:04 +00:00
Michael Meskes f207718b0c More informix fixes. 2003-07-08 12:11:35 +00:00
Michael Meskes fee6fd7f65 Fix segfault in connect in informix mode. 2003-07-08 07:13:48 +00:00
Michael Meskes 91d60637cf "char *" of course is not the same as "char []". So I had to fix the way ecpg treated the second one. 2003-07-07 12:15:33 +00:00
Tom Lane 841b4a2d55 tm2timestamp should return -1, not elog, on overflow. (In the backend
this is merely an API inconsistency, but in ecpg it's fatal.)  Also,
fix misconceived overflow test in HAVE_INT64_TIMESTAMP case.
2003-07-04 18:21:14 +00:00
Tom Lane 3abbce39d5 Fix missing code for HAVE_INT64_TIMESTAMP. 2003-07-04 18:15:10 +00:00
Tom Lane b700a672fe Add --help-config facility to dump information about GUC parameters
without needing a running backend.  Reorder postgresql.conf.sample
to match new layout of runtime.sgml.  This commit re-adds work lost
in Wednesday's crash.
2003-07-04 16:41:22 +00:00
Tom Lane efbbd107c7 Add #include <limits.h> (re-add lost change from Wednesday). 2003-07-04 16:28:03 +00:00
Michael Meskes c7fddd3072 date, interval and timestamp data should be quoted. 2003-07-04 12:00:52 +00:00
Michael Meskes 23e4fc18a7 Fixed informix behaviour for select without into. 2003-07-04 11:30:48 +00:00
Tom Lane 79fafdf49c Some early work on error message editing. Operator-not-found and
function-not-found messages now distinguish the cases no-match and
ambiguous-match, and they follow the style guidelines too.
2003-07-04 02:51:34 +00:00
Tom Lane cdb8a844e6 Fix bug I introduced in recent rewrite of NUMERIC code: numeric to
integer conversions gave the wrong answer for values with stripped
trailing zeroes, such as 10000000.
2003-07-03 19:41:47 +00:00
Tom Lane b89140a7ec Do honest transformation and preprocessing of LIMIT/OFFSET clauses,
instead of the former kluge whereby gram.y emitted already-transformed
expressions.  This is needed so that Params appearing in these clauses
actually work correctly.  I suppose some might claim that the side effect
of 'SELECT ... LIMIT 2+2' working is a new feature, but I say this is
a bug fix.
2003-07-03 19:07:54 +00:00
Tom Lane 455891bf96 Code review for UPDATE tab SET col = DEFAULT patch ... whack it around
so it has some chance of working in rules ...
2003-07-03 16:34:26 +00:00
Michael Meskes 7b1885bf98 Fixed initialization bug and added postgres_fe.h to pgtypeslib. 2003-07-02 07:57:36 +00:00
Tom Lane b837c99210 Support polymorphic functions in plpgsql. Along the way, replace
linked-list search of function cache with hash-table lookup.
By Joe Conway.
2003-07-01 21:47:09 +00:00
Bruce Momjian cc3002313f Fix ecpg typo --- change ;; to ;. 2003-07-01 19:58:23 +00:00
Tom Lane e3b1b6c0cd Aggregates can be polymorphic, using polymorphic implementation functions.
It also works to create a non-polymorphic aggregate from polymorphic
functions, should you want to do that.  Regression test added, docs still
lacking.  By Joe Conway, with some kibitzing from Tom Lane.
2003-07-01 19:10:53 +00:00
Tom Lane 02b5d8e371 Dept. of second thoughts: supporting inlining of polymorphic SQL functions
takes only a few more lines of code than preventing it, so might as well
support it.
2003-07-01 19:07:02 +00:00
Tom Lane e0016db7d2 STRENGH => STRENGTH, per Jon Jensen. 2003-07-01 13:49:47 +00:00
Michael Meskes 2bdd2e5dcf Use ISO dates in pgtypeslib by default.
Applied patch by Philip Yarra to fix some thread issues.
Added a new data type "decimal" which is mostly the same as our
	"numeric" but uses a fixed length array to store the digits. This is
	for compatibility with Informix and maybe others.
2003-07-01 12:40:52 +00:00
Tom Lane f973b74583 Department of second thoughts: even if we can't run the full parser on
a SQL function with polymorphic inputs, we can at least run the raw
parser to catch silly syntactic errors.
2003-07-01 01:28:32 +00:00
Peter Eisentraut c5faf2cf3c Translation update 2003-07-01 00:05:49 +00:00
Tom Lane d6d07a0eea SQL functions can have arguments and results declared ANYARRAY or
ANYELEMENT.  The effect is to postpone typechecking of the function
body until runtime.  Documentation is still lacking.

Original patch by Joe Conway, modified to postpone type checking
by Tom Lane.
2003-07-01 00:04:39 +00:00
Peter Eisentraut 71e9f3b07f Change EXECUTE INTO to CREATE TABLE AS EXECUTE. 2003-07-01 00:04:31 +00:00
Dave Cramer df08f5c003 patches by Kim Ho to fix
getByte, getSort if input has decimal or whitespace
setObject if object is a BIT
boolean not on list of SQLKeywords
2003-06-30 21:10:55 +00:00
Tom Lane 6115224448 Rename plpython to plpythonu, and update documentation to reflect its
now-untrusted status.
2003-06-30 18:31:42 +00:00
Tom Lane 219e29784d Add GUC option log_error_verbosity to control which fields of error
reports get put into the postmaster log.  Options are TERSE, DEFAULT,
VERBOSE, with the same behavior as implemented on the client side in
libpq.
2003-06-30 16:47:02 +00:00
Barry Lind 9af05a9d10 Patches applied:
1) Patch from Kris Jurka to fix IPv6 parsing of the jdbc URL
	2) Patch from Kris Jurka to fix an ArrayIndexOutOfBounds error
	   when calling moveToCurrentRow while currentRow is "beforeFirst"
	3) Patch from Kim Ho to fix add some bounds checking in setMaxRows(),
	   setQueryTimeout(), setFetchSize()

 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/errors.properties
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
2003-06-30 16:38:30 +00:00
Tom Lane 835bb975d8 Restructure building of join relation targetlists so that a join plan
node emits only those vars that are actually needed above it in the
plan tree.  (There were comments in the code suggesting that this was
done at some point in the dim past, but for a long time we have just
made join nodes emit everything that either input emitted.)  Aside from
being marginally more efficient, this fixes the problem noted by Peter
Eisentraut where a join above an IN-implemented-as-join might fail,
because the subplan targetlist constructed in the latter case didn't
meet the expectation of including everything.
Along the way, fix some places that were O(N^2) in the targetlist
length.  This is not all the trouble spots for wide queries by any
means, but it's a step forward.
2003-06-29 23:05:05 +00:00
Michael Meskes cf883ea95c - Made sure Informix style decimal vars are initialized. They use a
fixed amount of digits and not an allocated one. So we have to work
  around. PostgreSQL numeric type remains the same.
- In INFORMIX_SE mode with autcommit set, make all cursors be "with
  hold". Is this really they way SE behaves?
2003-06-29 16:52:58 +00:00
Peter Eisentraut 4355d4fb21 Information schema views for group privileges, some corrections on column
privileges.
2003-06-29 15:14:41 +00:00
Peter Eisentraut ae20518c7e It was comparing the wrong pair of columns, which triggered the previously
mentioned bug.
2003-06-29 10:18:26 +00:00
Peter Eisentraut 823bd7d129 Add missing PO files from last commit. 2003-06-29 10:13:13 +00:00
Michael Meskes 9aeb1eff24 Just another sync. 2003-06-29 09:25:19 +00:00
Tom Lane bee217924d Support expressions of the form 'scalar op ANY (array)' and
'scalar op ALL (array)', where the operator is applied between the
lefthand scalar and each element of the array.  The operator must
yield boolean; the result of the construct is the OR or AND of the
per-element results, respectively.

Original coding by Joe Conway, after an idea of Peter's.  Rewritten
by Tom to keep the implementation strictly separate from subqueries.
2003-06-29 00:33:44 +00:00
Peter Eisentraut df7618020b Merge PO file updates from 7.3 branch. 2003-06-28 22:31:01 +00:00
Peter Eisentraut 2f80f81e5e Make information schema aware of arrays.
The view element_types is currently not functional, awaiting some fixes in
the planner (reported on -hackers).
2003-06-28 20:50:08 +00:00
Tom Lane f9ebf36970 Update psql for some features of new FE/BE protocol. There is a
client-side AUTOCOMMIT mode now: '\set AUTOCOMMIT off' supports
SQL-spec commit behavior.  Get rid of LO_TRANSACTION hack --- the
LO operations just work now, using libpq's ability to track the
transaction status.  Add a VERBOSE variable to control verboseness
of error message display, and add a %T prompt-string code to show
current transaction-block status.  Superuser state display in the
prompt string correctly follows SET SESSION AUTHORIZATION commands.
Control-C works to get out of COPY IN state.
2003-06-28 00:12:40 +00:00
Tom Lane ea20397b79 When using new protocol, PQexec can get out of a COPY IN or COPY OUT
state by itself, so do so.
2003-06-28 00:06:01 +00:00
Bruce Momjian bf75f1a063 Adjust pgtest grep. 2003-06-27 22:04:50 +00:00
Bruce Momjian 757b718476 Update pgtest to use 'gmake check'. 2003-06-27 21:46:20 +00:00
Tom Lane ea886339b8 Add is_superuser parameter reporting, soon to be used by psql. 2003-06-27 19:08:38 +00:00
Tom Lane 7f1249a8d2 Fix compile warnings. 2003-06-27 17:07:03 +00:00
Tom Lane 7dc5472d48 Missing calls to PQclear in large_obj.c and describe.c.
Greg Sabino Mullane
2003-06-27 16:55:23 +00:00
Peter Eisentraut b256f24264 First batch of object rename commands. 2003-06-27 14:45:32 +00:00
Tom Lane b3c0551eda Create real array comparison functions (that use the element datatype's
comparison functions), replacing the highly bogus bitwise array_eq.  Create
a btree index opclass for ANYARRAY --- it is now possible to create indexes
on array columns.
Arrange to cache the results of catalog lookups across multiple array
operations, instead of repeating the lookups on every call.
Add string_to_array and array_to_string functions.
Remove singleton_array, array_accum, array_assign, and array_subscript
functions, since these were for proof-of-concept and not intended to become
supported functions.
Minor adjustments to behavior in some corner cases with empty or
zero-dimensional arrays.

Joe Conway (with some editorializing by Tom Lane).
2003-06-27 00:33:26 +00:00
Tom Lane 0c985ab5a8 Add comment pointing out that XLByteToPrevSeg macro is not broken. 2003-06-26 18:23:07 +00:00
Michael Meskes 4505653e54 Added just another compatibility level for Informix. 2003-06-26 11:37:05 +00:00
Bruce Momjian b143210639 Wrap LONG_LONG_MIN redfinition around HAVE_LONG_LONG_INT_64. 2003-06-26 01:45:04 +00:00
Bruce Momjian 095a0c83d5 Fix compile problem for missing LONG_LONG_MIN on BSD/OS. 2003-06-26 01:33:23 +00:00
Bruce Momjian 111d8e522b Back out array mega-patch.
Joe Conway
2003-06-25 21:30:34 +00:00
Tom Lane 621691d816 In ISO datestyle, never emit just HH:MM, always emit HH:MM:SS or
HH:MM:SS.SSS... when there is a nonzero part-of-a-day field in an
interval value.  The seconds part used to be suppressed if zero,
but there's no equivalent behavior for timestamp, and since we're
modeling this format on timestamp it's probably wrong.  Per complaint
and patch from Larry Rosenman.
2003-06-25 21:14:15 +00:00
Tom Lane 5cf18b1ae3 Don't generate 'zero' typeids in the output from gen_cross_product.
This is no longer necessary or appropriate since we don't use zero typeid
as a wildcard anymore, and it fixes a nasty performance problem with
functions with many parameters.  Per recent example from Reuven Lerner.
2003-06-25 20:07:39 +00:00
Michael Meskes 6f30d5665c The remaining files ... 2003-06-25 17:55:50 +00:00
Michael Meskes 8d8b9401b8 remove including of postgres_fe.h 2003-06-25 16:12:27 +00:00
Michael Meskes 54fae9c20a Some systems need another header file included. 2003-06-25 11:51:18 +00:00
Michael Meskes fd3ca524eb Implemented Informix special way to treat NULLs, removed warnings, synced. 2003-06-25 10:44:21 +00:00
Bruce Momjian ff4c69e021 Fix up JOIN .. USING with domains
The attached fixes select_common_type() to support the below case:

create table t1( c1 int);
create domain dom_c1 int;
create table t2(c1 dom_c1);
select * from t1 join t2 using( c1 );

I didn't see a need for maintaining the domain as the preferred type. A
simple getBaseType() call on all elements of the list seems to be
enough.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 04:32:03 +00:00
Bruce Momjian 53c4f1233f UPDATE ... SET <col> = DEFAULT
Rod Taylor
2003-06-25 04:19:24 +00:00
Bruce Momjian a09ccc70dd If they're not, the below causes problems, as the foreign key is added
after the CHECK.  Cluster depends on the index name, so I thought it
wise to ensure all names are available, rather than leaving off the
CONSTRAINT "$n" portion for internally named constraints.

CREATE TABLE jkey (col integer primary key);
CREATE TABLE j (col integer REFERENCES jkey);
ALTER TABLE j ADD CHECK(col > 5);

This is a problem in 7.3 series as well as -Tip.

Rod Taylor <rbt@rbt.ca>
2003-06-25 04:08:19 +00:00
Bruce Momjian ca64391d6c Updated the pg_get_constraintdef() to use conbin. Update pg_dump to use
pg_get_constraintdef() for >= 70400.

Rod Taylor <rbt@rbt.ca>
2003-06-25 03:56:31 +00:00
Bruce Momjian c70e606a4c Includes:
- LIKE <subtable> [ INCLUDING DEFAULTS | EXCLUDING DEFAULTS ]
- Quick cleanup of analyze.c function prototypes.
- New non-reserved keywords (INCLUDING, EXCLUDING, DEFAULTS), SQL 200X

Opted not to extend for check constraints at this time.

As per the definition that it's user defined columns, OIDs are NOT
inherited.

Doc and Source patches attached.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 03:40:19 +00:00
Bruce Momjian dbca370278 Back out commit. 2003-06-25 03:02:37 +00:00
Bruce Momjian ad41cd6c4a Adjust expected output for new functions. 2003-06-25 03:01:35 +00:00
Bruce Momjian d57d000627 Update catversion for ipv6 addition. 2003-06-25 01:26:16 +00:00
Bruce Momjian d9ddbdaa95 > This change (I'm sure this will wrap poorly -- sorry):
> http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/libpq/pqcomm.h.diff?r1=1.85&r2=1.86
>
> modified SockAddr, but no corresponding change was made here
> (fe-auth.c:612):
>
>   case AUTH_REQ_KRB5:
> #ifdef KRB5
>   if (pg_krb5_sendauth(PQerrormsg, conn->sock, &conn->laddr.in,
>                        &conn->raddr.in,
>                        hostname) != STATUS_OK)
>
> It's not obvious to me what the change ought to be though.

This patch should hopefully fix both kerberos 4 and 5.

Kurt Roeckx
2003-06-25 01:19:47 +00:00
Bruce Momjian afb17d912b > I've worked with the Pl/Python code in the past and will see about removing
> rexec and making it an untrusted language.  Last time I looked, it didn't
> look particularly difficult.  I've set aside some time next week, so stay
> tuned.

Attached is a patch that removes all of the RExec code from plpython from
the current PostgreSQL CVS.  In addition, plpython needs to be changed to an
untrusted language in createlang.  Please let me know if there are any
problems.

Kevin Jacobs
2003-06-25 01:18:58 +00:00
Bruce Momjian e1be2ee831 Here's a small patch to pg_hba.conf.sample that explains the use of CIDR
addresses.

Andrew Dunstan
2003-06-25 01:15:24 +00:00
Bruce Momjian 92798de02e This is a bug in python interface module,
postgresql-7.3.3/src/interfaces/python/pg.py.

_quote() function fails due to integer overflow if input d is larger
than max integer.

In the case where the column type is "BIGINT", the input d may very well
be larger than max integer while its type, t, is labeled 'int'.
The conversion on line 19, return "%d" % int(d), will fail due to
"OverflowError: long int too large to convert to int".



Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

[1] create a table with a column type 'BIGINT'.
[2] use pg.DB.insert() to insert a value that is larger than max integer

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Just changing the conversion at line 19 of pg.py to long(d) instead of
int(d) should fix it. The following is a patch:

Chih-Hao Huang
2003-06-25 01:09:24 +00:00
Bruce Momjian dd23a882fa >> If a transaction marks a tuple for update and later commits without
>> actually having updated the tuple, [...] can we simply
>> set the HEAP_XMAX_INVALID hint bit of the tuple?
>
>AFAICS this is a reasonable thing to do.

Thanks for the confirmation.  Here's a patch which also contains some
more noncritical changes to tqual.c:
 .  make code more readable by introducing local variables for xvac
 .  no longer two separate branches for aborted and crashed.
    The actions were the same in all cases.

Manfred Koizar
2003-06-25 01:08:13 +00:00
Bruce Momjian 7f7919256a In an attempt to simplify my life I'm submitting this patch that
restructures the deferred trigger queue.  The fundamental change is to
put all the static variables to hold the deferred triggers in a single
structure.

Alvaro Herrera
2003-06-24 23:25:44 +00:00
Bruce Momjian aa62f7f74a Add x86_64 support for spinlocks.
Jeffrey W. Baker
2003-06-24 23:20:08 +00:00
Bruce Momjian 7cb4278e82 Small patch to link to the proper place in the "runtime" file,
and to add the "schemaname" column to the description of the
pg_stats view.

Greg Sabino Mullane
2003-06-24 23:19:11 +00:00
Bruce Momjian 46bf651480 Array mega-patch.
Joe Conway
2003-06-24 23:14:49 +00:00
Bruce Momjian 4b1fe23153 Prevent compiler warning from sprintf in recent ipv6 patch. 2003-06-24 22:42:42 +00:00
Bruce Momjian 945543d919 Add ipv6 address parsing support to 'inet' and 'cidr' data types.
Regression tests for IPv6 operations added.

        Documentation updated to document IPv6 bits.

        Stop treating IPv4 as an "unsigned int" and IPv6 as an array of
        characters.  Instead, always use the array of characters so we
        can have one function fits all.  This makes bitncmp(), addressOK(),
        and several other functions "just work" on both address families.

        add family() function which returns integer 4 or 6 for IPv4 or
        IPv6.  (See examples below)  Note that to add this new function
        you will need to dump/initdb/reload or find the correct magic
        to add the function to the postgresql function catalogs.

        IPv4 addresses always sort before IPv6.

        On disk we use AF_INET for IPv4, and AF_INET+1 for IPv6 addresses.
        This prevents the need for a dump and reload, but lets IPv6 parsing
        work on machines without AF_INET6.

        To select all IPv4 addresses from a table:

                select * from foo where family(addr) = 4 ...

        Order by and other bits should all work.

Michael Graff
2003-06-24 22:21:24 +00:00
Bruce Momjian 975674a952 Add -L../ecpglib -lecpg for Cygwin compile. 2003-06-24 14:45:46 +00:00
Bruce Momjian 5249172e1f typedef sa_family_t for cygwin. 2003-06-24 01:49:22 +00:00
Bruce Momjian 646e7f8415 Do not include:
#include <pwd.h>
	#include <netdb.h>

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

Also handle __ss_family as a synonym for ss_family.

Kurt Roeckx
2003-06-23 23:52:00 +00:00
Bruce Momjian 3bfabc36b6 Add mention that the grep's have to be adjusted in pgtest. 2003-06-23 19:33:25 +00:00
Tom Lane ab5c775116 Change pqInternalNotice to accept a format string and args instead of
just a preformatted message; per suggestion by Sean Chittenden.
2003-06-23 19:20:25 +00:00
Bruce Momjian 408625321c Remove crypt.h from fe-connect.c --- not needed, and caused problems on
Solaris with Open SSL version 0.9.7b
2003-06-23 17:03:19 +00:00
Tom Lane bff0422b6c Revise hash join and hash aggregation code to use the same datatype-
specific hash functions used by hash indexes, rather than the old
not-datatype-aware ComputeHashFunc routine.  This makes it safe to do
hash joining on several datatypes that previously couldn't use hashing.
The sets of datatypes that are hash indexable and hash joinable are now
exactly the same, whereas before each had some that weren't in the other.
2003-06-22 22:04:55 +00:00
Michael Meskes 36fe7577f8 Added missing terminating '\0' char for data put into char *. 2003-06-22 11:00:48 +00:00
Bruce Momjian c1ae39a0cd Add pgtest script. 2003-06-22 04:22:57 +00:00
Tom Lane dd81eee222 Use libpq's new logic to get the server version, instead of doing it ourselves. 2003-06-22 00:56:58 +00:00
Tom Lane e92dc1e199 Bring the libpq example programs into the 21st century. 2003-06-22 00:29:29 +00:00
Tom Lane 21e0b7b8f2 Get rid of extraneous newline in PQendcopy error output (was causing
regression test diffs...).
2003-06-21 23:25:38 +00:00
Tom Lane efc3a25bb0 Update libpq to make new features of FE/BE protocol available to
client applications.  Some editorial work on libpq.sgml, too.
2003-06-21 21:51:35 +00:00
Tom Lane 4342e6ea18 Fix for extended-query protocol: in event of error, backend was issuing
a ReadyForQuery (Z message) immediately and then another one after the
Sync message arrives.  Suppress the first one to make it work per spec.
2003-06-20 21:58:02 +00:00
Michael Meskes 94b59faeb7 Synced with backend. 2003-06-20 15:16:06 +00:00
Michael Meskes 2cbaaee6c3 Just another Informix compatibility change. They uses "free" for cursors as wellafter closing them. 2003-06-20 13:36:34 +00:00
Michael Meskes cf5ec3d12b Sorry, missed a file. 2003-06-20 12:01:46 +00:00
Michael Meskes abd310a3b1 Allow constants in using clauses. 2003-06-20 12:00:59 +00:00
Tom Lane 5fc9f3d574 We neglected to set conn->raddr.salen, leading to breakage of CANCEL
and probably other stuff.
2003-06-20 04:09:12 +00:00
Tom Lane 1bd22f55cf Disallow dollar sign in operator names, instead allow it as a non-first
character in identifiers.  The first change eliminates the current need
to put spaces around parameter references, as in "x<=$2".  The second
change improves compatibility with Oracle and some other RDBMSes.  This
was discussed and agreed to back in January, but did not get done.
2003-06-19 23:22:40 +00:00
Michael Meskes 8902aaaa6c Fixed fetch into char * and added missing prototype for an Informix function. 2003-06-19 09:52:11 +00:00
Peter Eisentraut f374a9dae9 Change clusterdb and vacuumdb into C programs. 2003-06-18 12:19:11 +00:00
Tom Lane eab5d643b2 Make FLOAT(p) measure the precision p in bits, not decimal digits, to
match the SQL standard.  Document FLOAT and FLOAT(p) notations in
datatype.sgml.  Per recent pghackers discussion.
2003-06-17 23:12:36 +00:00
Peter Eisentraut 596652d6eb More information schema views. 2003-06-17 18:00:48 +00:00
Peter Eisentraut 3d6fd2557c Add missing file to clean target. 2003-06-17 17:58:54 +00:00
Michael Meskes 8a2aa79fee Fixed several more parsing bugs. 2003-06-17 07:28:22 +00:00
Tom Lane f12f8990e4 Fix error line numbers reported for errors in plpgsql_parse_word and
siblings.
2003-06-17 04:35:03 +00:00
Tom Lane 3467b1a1f9 Fix bugs in interval-to-time conversion: HAVE_INT64_TIMESTAMP case did not
work at all, and neither case behaved sanely for negative intervals.
2003-06-16 18:56:45 +00:00
Michael Meskes 76924b5d94 Fixed two small bugs. 2003-06-16 16:58:11 +00:00
Tom Lane a499725469 Allow GROUP BY, ORDER BY, DISTINCT targets to be unknown literals,
silently resolving them to type TEXT.  This is comparable to what we
do when faced with UNKNOWN in CASE, UNION, and other contexts.  It gets
rid of this and related annoyances:
	select distinct f1, '' from int4_tbl;
	ERROR:  Unable to identify an ordering operator '<' for type unknown
This was discussed many moons ago, but no one got round to fixing it.
2003-06-16 02:03:38 +00:00