Commit Graph

11595 Commits

Author SHA1 Message Date
Tom Lane f353f8e83b There is no reason to cast valuntil to timestamp, and a very good
reason not to: it fails for an 'invalid' abstime.  Per bug report
of today's date.
2003-07-29 14:17:37 +00:00
Tom Lane a5e804df71 Use a process-specific temp file name, per Andreas Haumer. 2003-07-29 14:12:50 +00:00
Tom Lane 9c2a7c2269 Apply (a somewhat revised version of) Greg Mullane's patch to eliminate
heuristic determination of day vs month in date/time input.  Add the
ability to specify that input is interpreted as yy-mm-dd order (which
formerly worked, but only for yy greater than 31).  DateStyle's input
component now has the preferred spellings DMY, MDY, or YMD; the older
keywords European and US are now aliases for the first two of these.
Per recent discussions on pgsql-general.
2003-07-29 00:03:19 +00:00
Tom Lane 2baf4efe09 Code review for recent GUC changes --- try to make it less obvious that
these things were added at different times by different people ;-).
Includes Aizaz Ahmed's patch to remove duplicate array in help_config.c.
2003-07-28 19:31:32 +00:00
Tom Lane aad71b40ca Add error stack traceback support for SQL-language functions. 2003-07-28 18:33:18 +00:00
Bruce Momjian 1c241545e3 There was enough code drift since this patch, that a couple of bugs
materialized.

New items have been added to GucContext and GucSource enums, but of
course they were not added to the corresponding GucContextName[] and
GucSourceName[] arrays in the patch. Here's a new patch to fix the
resulting bugs.

Joe Conway
2003-07-28 16:22:16 +00:00
Tom Lane 00941bf9ba Localizability improvement. 2003-07-28 06:27:06 +00:00
Tom Lane b7489ac445 elog() is no longer a gettext trigger --- all remaining uses are considered
internal errors.
2003-07-28 00:25:21 +00:00
Tom Lane 02d79e765b Rename psql's VERBOSE variable to VERBOSITY, per suggestion from Bruce. 2003-07-28 00:14:43 +00:00
Tom Lane 81b5c8a136 A visit from the message-style police ... 2003-07-28 00:09:16 +00:00
Tom Lane b556e8200e elog mop-up: bring some straggling fprintf(stderr)'s into the elog world. 2003-07-27 21:49:55 +00:00
Bruce Momjian 440953e6cd Tom, happier with the attached patch?
I'd have to disagree with regards to the memory leaks not being worth
a mention - any such leak can cause problems when the PostgreSQL
installation is either unattended, long-living andor has very high
connection levels. Half a kilobyte on start-up isn't negligible in
this light.

Regards, Lee.

Tom Lane writes:
 > Lee Kindness <lkindness@csl.co.uk> writes:
 > > Guys, attached is a patch to fix two memory leaks on start-up.
 >
 > I do not like the changes to miscinit.c.  In the first place, it is not
 > a "memory leak" to do a one-time allocation of state for a proc_exit
 > function.  A bigger complaint is that your proposed change introduces
 > fragile coupling between CreateLockFile and its callers, in order to
 > save no resources worth mentioning.  More, it introduces an assumption
 > that the globals directoryLockFile and socketLockFile don't change while
 > the postmaster is running.  UnlinkLockFile should unlink the file that
 > it was originally told to unlink, regardless of what happens to those
 > globals.
 >
 > If you are intent on spending code to free stuff just before the
 > postmaster exits, a better fix would be for UnlinkLockFile to free its
 > string argument after using it.

Lee Kindness
2003-07-27 19:39:13 +00:00
Tom Lane e7f3645171 Fix some localizability issues with existing errcontext() calls. 2003-07-27 18:38:26 +00:00
Tom Lane 2d7a6a9ef2 Move ERRCODE_XXX macros into their own header file. 2003-07-27 18:37:52 +00:00
Tom Lane e8db9b26d0 elog mop-up. 2003-07-27 17:10:07 +00:00
Tom Lane b6a1d25b0a Error message editing in utils/adt. Again thanks to Joe Conway for doing
the bulk of the heavy lifting ...
2003-07-27 04:53:12 +00:00
Bruce Momjian 38fb906f93 > Joe Conway <mail@joeconway.com> writes:
>>ISTM that "source" is worth knowing.
>
> Hm, possibly.  Any other opinions?

This version has the seven fields I proposed, including "source". Here's
an example that shows why I think it's valuable:

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | on
context | user
vartype | bool
source  | default
min_val |
max_val |

regression=# update pg_settings set setting = 'off' where name =
'enable_seqscan';
-[ RECORD 1 ]---
set_config | off

regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | off
context | user
vartype | bool
source  | session
min_val |
max_val |

regression=# alter user postgres set enable_seqscan to 'off';
ALTER USER

(log out and then back in again)

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | off
context | user
vartype | bool
source  | user
min_val |
max_val |

In the first case, enable_seqscan is set to its default value. After
setting it to off, it is obvious that the value has been changed for the
session only. In the third case, you can see that the value has been set
specifically for the user.

Joe Conway
2003-07-27 04:35:54 +00:00
Bruce Momjian 9ae6905520 This is a totally trivial patch for something that was a very minor nit that
annoyed me the other day while I was documenting my current project. It
makes pg_dump use the same layout for types as for tables, by putting "\n\t"
before the first field and "\n" before the final ");"

Can't really justify this too much except to say I had an itch and I
scratched it ;-)

Andrew Dunstan
2003-07-27 03:47:22 +00:00
Bruce Momjian 9df48371c2 here are the patches for psql on Win32:
psql4win32.patch  - changes in the psql source code
  psql-ref.patch    - changes in the documentation psql-ref.sgml
                      (for new builtin variable WIN32_CONSOLE)

To apply them use "patch -p 1" in the root directory of the
postgres source directory.

These patches fix the following problems of psql on Win32
(all changes only have effect #ifdef WIN32):

  a) Problem:  Static library libpq.a did not work
     Solution: Added WSAStartup() in fe-connect.c

  b) Problem:  Secret Password was echoed by psql
     Solution: Password echoing disabled in sprompt.c

  c) Problem:  8bit characters were displayed/interpreted wrong in psql
               This is due to the fact that the Win32 "console" uses a
               different encoding than the rest of the Windows system
     Solution: Introduced a new psql variable WIN32_CONSOLE
               When set with "\set WIN32_console", the function OemToChar()
               is applied after reading input and CharToOem() before
               displaying Output

Christoph Dalitz
2003-07-27 03:32:26 +00:00
Bruce Momjian e7fe89d57d This makes the initcap function compatible with Oracle 9i, it has been
tested on both redhat 8 and FreebSD.
--
Mike Nolan
2003-07-27 03:16:20 +00:00
Bruce Momjian 1e5a16cc9c The deferred trigger queue pushing to disk patch pointed out
that the regression tests for foreign keys didn't seem to test
a deferred constraint that was not satisified by a later
statement and was not made immediate by set constraints,
so here's a simple added test with a single invalid insert and
a commit.

Stephan Szabo
2003-07-27 03:13:17 +00:00
Bruce Momjian 1be17f1f26 >>You can alias $0, similar to the argument variables. And, I confirmed
>>that you cannot change the value, similar to the argument variables:
>
> Perhaps you shouldn't mark it isconst; then it would actually have some
> usefulness (you could use it directly as a temporary variable to hold
> the intended result).  I can't see much value in aliasing it if it's
> const, either.

OK; the only change in this version is "isconst = false;". Now you can
use $0 as a result placeholder if desired. E.g.:

create or replace function tmp(anyelement, anyelement) returns anyarray as '
declare
  v_ret alias for $0;
  v_el1 alias for $1;
  v_el2 alias for $2;
begin
  v_ret := ARRAY[v_el1, v_el2];
  return v_ret;
end;
' language 'plpgsql';

create table f(f1 text, f2 text, f3 int, f4 int);
insert into f values ('a','b',1,2);
insert into f values ('z','x',3,4);

select tmp(f1,f2) from f;
select tmp(f3,f4) from f;


Joe Conway
2003-07-26 23:58:23 +00:00
Bruce Momjian abc7f73273 Have SSL text print only when SSL mode is enabled. 2003-07-26 15:22:22 +00:00
Bruce Momjian 74ca686796 I corecting date_trunc('quarter',...) and friends because orig version
doing '2003-07-30' -> '2003-04-01', '2003-11-30' ->'2003-07-01'

B?jthe Zolt?n
2003-07-26 15:17:36 +00:00
Bruce Momjian 397831e103 At long last I put together a patch to support 4 client SSL negotiation
modes (and replace the requiressl boolean). The four options were first
spelled out by Magnus Hagander <mha@sollentuna.net> on 2000-08-23 in email
to pgsql-hackers, archived here:

http://archives.postgresql.org/pgsql-hackers/2000-08/msg00639.php

My original less-flexible patch and the ensuing thread are archived at:

http://dbforums.com/t623845.html

Attached is a new patch, including documentation.

To sum up, there's a new client parameter "sslmode" and environment
variable "PGSSLMODE", with these options:

sslmode   description
-------   -----------
disable   Unencrypted non-SSL only
allow     Negotiate, prefer non-SSL
prefer    Negotiate, prefer SSL (default)
require   Require SSL

The only change to the server is a new pg_hba.conf line type,
"hostnossl", for specifying connections that are not allowed to use SSL
(for example, to prevent servers on a local network from accidentally
using SSL and wasting cycles). Thus the 3 pg_hba.conf line types are:

pg_hba.conf line types
----------------------
host       applies to either SSL or regular connections
hostssl    applies only to SSL connections
hostnossl  applies only to regular connections

These client and server options, the postgresql.conf ssl = false option,
and finally the possibility of compiling with no SSL support at all,
make quite a range of combinations to test. I threw together a test
script to try many of them out. It's in a separate tarball with its
config files, a patch to psql so it'll announce SSL connections even in
absence of a tty, and the test output. The test is especially informative
when run on the same tty the postmaster was started on, so the FATAL:
errors during negotiation are interleaved with the psql client output.

I saw Tom write that new submissions for 7.4 have to be in before midnight
local time, and since I'm on the east coast in the US, this just makes it
in before the bell. :)

Jon Jensen
2003-07-26 13:50:02 +00:00
Tom Lane 5f2499d5af Update to match error editing. 2003-07-26 00:02:02 +00:00
Tom Lane 3b04893ffc Error message editing in src/pl. The plpython module could use another
look ... I'm not real certain which errors are strictly internal and which
are likely to be provoked by users.
2003-07-25 23:37:31 +00:00
Bruce Momjian ad73f6b86f Update copyrights to 2003.
print.c: Add one more line to pager calculation to account for the prompt.
help.c: Call PageOutput with correct number of lines within slashUsage
        Add one to line count in helpSQL to account for "Available help:" line.
        Make copyright match COPYRIGHT file. (Just "1994")

Greg Sabino Mullane
2003-07-25 21:48:45 +00:00
Bruce Momjian 57748fc25d > Having read the list, and noticed the message about table inheritance I
> thought that I would see if I could come up with a simple solution, and
> have my first delve into the code for PostgreSQL.
>
> Attached is a diff against 7.3.3 source, of changes to describe.c for
> psql. This should print out a list of parent tables in a similar style
> to that of the index listing. I have done some testing on my side and it
> all seems fine, can some other people have a quick look? What do people
> think? Useful?

Nick Barr
2003-07-25 21:42:26 +00:00
Tom Lane b92d055b56 Recent patch to dump nondefault attstorage settings broke pg_dump for
dropped columns.  Fix by using LEFT JOIN rather than straight join
between pg_attribute and pg_type.  Also, use pg_type.oid as input to
format_type, so that we don't get a failure on deleted types of deleted
columns (this may be a change we ought to backpatch to 7.3....).
2003-07-25 21:02:52 +00:00
Tom Lane 689eb53e47 Error message editing in backend/utils (except /adt). 2003-07-25 20:18:01 +00:00
Bruce Momjian 9fecf302f7 Seems my check constraint change did break stuff.
Alias the appropriate columns back to their original name.

Fixed formatting of a few other places as I went along (indenting)
--
Rod Taylor <rbt@rbt.ca>
2003-07-25 19:37:21 +00:00
Bruce Momjian 187e865174 > Rod Taylor <rbt@rbt.ca> writes:
> > It seems that readline() on my system (FreeBSD 4.8) isn't declared to
> > take the prompt as a const.  Thus, remove const from gets_interactive()
> > to remove the warning.
>
> I think it would be a lot cleaner to just put a cast to char * into the
> readline call (with a note about why).

Ok.. that works.

I must say it's a little strange being able to take a constant and say
its no longer constant anymore -- but I suppose it's no different than
defining then undefining pre-processor constants.

Rod Taylor <rbt@rbt.ca>
2003-07-25 19:27:06 +00:00
Michael Meskes 6a0d6d0060 Added explicit casts for date/interval/timestamp. 2003-07-25 16:10:26 +00:00
Michael Meskes 4c4a667f4d Applied Peter's patch to use yyless instead of my string_unput function. 2003-07-25 05:42:27 +00:00
Bruce Momjian b2312c4eae No need for Static.Entries, use -rHEAD. 2003-07-25 02:11:17 +00:00
Bruce Momjian 8355901a0e Add example of cvs log pulls _just_ from HEAD. 2003-07-25 01:40:02 +00:00
Tom Lane 45708f5ebc Error message editing in backend/optimizer, backend/rewrite. 2003-07-25 00:01:09 +00:00
Tom Lane cfa191f3b8 Error message editing in backend/storage. 2003-07-24 22:04:15 +00:00
Tom Lane 8fd5b3ed67 Error message editing in contrib (mostly by Joe Conway --- thanks Joe!) 2003-07-24 17:52:50 +00:00
Peter Eisentraut cf16f51a43 Fix grant option dumping and related cross-version compatibility issues. 2003-07-24 15:52:53 +00:00
Michael Meskes 060229b9d7 Fixed mdy functions to use correct offset. 2003-07-24 08:41:07 +00:00
Tom Lane 0643b6a1ba Fix timestamp_date for HAVE_INT64_TIMESTAMP case. 2003-07-24 04:38:19 +00:00
Barry Lind a7a012d167 Fixes additional sql injection vulnerabilities reported by Oliver Jowett
and Dmitry Tkach.  Specifically the previous fix still allowed the statement termination character through in unquoted places in the sql statement, and the driver never correctly handled someone passing a value of \0 in a string which under the v2 protocol would end the statement causing the following text to possibly
be treated as a new sql statement
 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-07-24 00:30:39 +00:00
Tom Lane 47f14e7ddf Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000. 2003-07-24 00:21:26 +00:00
Tom Lane 2d9a001c9e Don't refer to AF_UNIX in code not protected with HAVE_UNIX_SOCKETS. 2003-07-24 00:02:53 +00:00
Tom Lane df63503dc2 Have a go at fixing various outstanding portability issues in code that
was modified for IPv6.  Use a robust definition of struct sockaddr_storage,
do a proper configure test to see if ss_len exists, don't assume that
getnameinfo() will handle AF_UNIX sockets, don't trust getaddrinfo to
return the protocol we ask for, etc.  This incorporates several outstanding
patches from Kurt Roeckx, but I'm to blame for anything that doesn't
work ...
2003-07-23 23:30:41 +00:00
Peter Eisentraut 56b8a6f5d1 Czech translation updates from Karel Zak 2003-07-23 09:36:43 +00:00
Peter Eisentraut ef889e925e Update German translations. 2003-07-23 08:49:30 +00:00
Peter Eisentraut c154fc3a20 Apply message style guide to frontend programs. 2003-07-23 08:47:41 +00:00
Bruce Momjian a7e898785b Stamp 7.3.4. 2003-07-23 04:08:44 +00:00
Tom Lane c72839d5be Error message editing in backend/bootstrap, /lib, /nodes, /port. 2003-07-22 23:30:39 +00:00
Tom Lane 56f87688c4 Error message editing for foreign-key triggers. 2003-07-22 22:14:57 +00:00
Tom Lane fe5de484fe A few parentheses shy of a load here ... 2003-07-22 21:19:22 +00:00
Bruce Momjian a0cc9f3cb9 Add GUC parameter to control rendezvous name. 2003-07-22 20:29:13 +00:00
Tom Lane 25114d3e29 wups, took out one memset too many ... 2003-07-22 19:13:19 +00:00
Tom Lane b05d3ae1ed Error message editing in backend/libpq, backend/postmaster, backend/tcop.
Along the way, fix some logic problems in pgstat_initstats, notably the
bogus assumption that malloc returns zeroed memory.
2003-07-22 19:00:12 +00:00
Barry Lind 0a73f69cb4 Fix to prevent SQL injection attacks for code calling setObject(int,Object,int)
where Object is a user supplied String and the type is a numeric type
(i.e. INTEGER,LONG,etc).
Also applied a patch from Kim Ho that fixes compile problems under jdk1.2

 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2003-07-22 05:17:09 +00:00
Bruce Momjian 0fe252b5da Don't report sequendces in pg_tables. 2003-07-22 00:02:55 +00:00
Bruce Momjian a4bfb055d4 Back out comment on GucContexts. 2003-07-21 21:02:12 +00:00
Barry Lind 80bbd3281d Applied patch from dmitry@openratings.com to fix parsing of array values
Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc2/Array.java
2003-07-21 20:48:31 +00:00
Tom Lane ec7aa4b515 Error message editing in backend/access. 2003-07-21 20:29:40 +00:00
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