Tom Lane [Sat, 11 Mar 2000 06:19:00 +0000 (06:19 +0000)]
exec_simple_check_plan() must not allow a plan having initPlans or
subPlans to be considered 'simple'. This fixes reported problem with
'return exists (select 1 from foo);' in plpgsql function.
Tom Lane [Sat, 11 Mar 2000 05:14:06 +0000 (05:14 +0000)]
Finish cleaning up backend's handling of /* ... */ and -- comments,
per pghackers discussion around 20-Feb. Also add specific error messages
for unterminated comments and unterminated quoted strings. These things
are nonissues for input coming from psql, but they do matter for input
coming from other front ends.
Tom Lane [Sat, 11 Mar 2000 03:08:37 +0000 (03:08 +0000)]
Change PQconndefaults() to return a malloc'd array, instead of a static
array. This allows processing of conninfo strings to be made thread-safe,
at the cost of a small memory leak in applications that use
PQconndefaults() and are not updated to free the returned array via
the new PQconninfoFree() function. But PQconndefaults() is probably not
used very much, so this seems like a good compromise.
Tom Lane [Thu, 9 Mar 2000 05:15:33 +0000 (05:15 +0000)]
Redo permissions-checking code so that it does the right thing at APPEND
nodes. The former version failed to check permissions of relations that
were referenced in second and later clauses of UNIONs, and it did not
check permissions of tables referenced via inheritance.
Bruce Momjian [Wed, 8 Mar 2000 01:58:46 +0000 (01:58 +0000)]
I've made a diff against the 7.0beta1 tree that accomplishes several things:
1) adds NetBSD shared lib support on both ELF and a.out platforms
2) replaces "-L$(LIBPQDIR) -lpq" with "$(LIBPQ)" defined in
Makefile.global. This makes it much easier to build stuff in
the source tree after you've already installed the libraries.
3) adds TEMPLATEDIR in Makefile.global that indicates where the
database templates are stored. This separates the template files
from real libraries that are installed in $(LIBDIR).
4) changes include order of <readline/readline.h> and <readline.h>.
The latest GNU readline installs its headers under a readline
subdirectory.
In addition to applying the patch below the following files need to be copied:
Bruce Momjian [Wed, 8 Mar 2000 01:46:47 +0000 (01:46 +0000)]
Bruce and all:
Here's a patch to fix the " '.' not allowed in db path" problem I ran into.
I removed '.' from the set of illegial characters, but added backtick. I also
included an explicit test for attempting include a reference to a parent dir.
Bruce Momjian [Wed, 8 Mar 2000 01:38:59 +0000 (01:38 +0000)]
Hi Peter,
I try change prompt in the psql, but it is set '.' (as '%m') for
non-TCP/IP
connection. This small patch try use uname() information for non-TCP/IP
instead '.'.
Bruce Momjian [Wed, 8 Mar 2000 01:34:41 +0000 (01:34 +0000)]
Hi,
the to_char() source code is large, here are regression tests for
numeric/timestamp/int8 part. It is probably enough test for formatting
code in the formatting.c module. The others (float4/float8/int4) types
share this formatting code and eventual bugs for these types aren't
few probable.
Patch fix timestamp_to_char() for infinity/invalid timestamp too.
Bruce Momjian [Tue, 7 Mar 2000 23:49:31 +0000 (23:49 +0000)]
I've recently written to pgsql-ports about a problem with PG7.0 on NT
(Subj: [PORTS] initdb problem on NT with 7.0). Since nobody helped me,
I had to find out the reson. The difference between NT and Linux (for
instance) is that "open( path, O_RDWR );" opens a file in text mode. So
sometime less block can be read than required.
I suggest a following patch. BTW the situation appeared before, see
hba.c, pqcomm.c and others.
The v4bitncmp() function was only taking one bit length argument so
it would determine that the networks were different, even though
they really aren't (and the netmask test wouldn't be used). This
ONLY happens if the tuple with the longer bit length is used as the
ip_bits() for the v4bitncmp call AND there happens to be junk data
in place in the shorter tuple. Odd and random, but I saw it happen
a couple times so...
Tom Lane [Wed, 1 Mar 2000 05:18:20 +0000 (05:18 +0000)]
Simplify parsing of column constraints by treating constraint attributes
as independent clauses in the grammar. analyze.c takes care of putting
the data where it belongs and complaining about invalid combinations.
Also, make TEMP (and TEMPORARY) non-reserved words.
Jan Wieck [Tue, 29 Feb 2000 12:28:25 +0000 (12:28 +0000)]
Changed execution time of ON <event> RESTRICT referential
integrity triggers to after statement allways. Ignores
deferred state now, closer to SQL3 semantics.
Tom Lane [Sun, 27 Feb 2000 07:18:29 +0000 (07:18 +0000)]
Add 'volatile' declarations to silence gcc warnings about longjmp.
Shouldn't create any portability problems, since we have a configure
test to #define away volatile if the compiler doesn't support it.
Tom Lane [Sun, 27 Feb 2000 02:48:15 +0000 (02:48 +0000)]
Fix poorly worded error messages for unary operator type resolution
failures. Fix some outright bugs too, including a reference to
uninitialized memory that would cause failures like this one:
select -('1234567890.1234567'::text);
ERROR: Unable to locate type oid 2139062143 in catalog
Tom Lane [Sat, 26 Feb 2000 23:03:12 +0000 (23:03 +0000)]
Add date and time datatype handling to convert_to_scalar. (I was waiting
for Thomas to do the datetime consolidation before touching this, but
it's done now...)
Tom Lane [Sat, 26 Feb 2000 21:13:18 +0000 (21:13 +0000)]
Change rule dumper to produce reasonable output for casts that assign
a specific length or precision, such as foo::char(8). Remove erroneous
removal of user-written casts at the top level of a SELECT target item.
Tom Lane [Sat, 26 Feb 2000 21:11:10 +0000 (21:11 +0000)]
Fix exprTypmod to recognize length-coercion function expressions,
such as bpchar(char_expression, N), and pull out the attrtypmod that
the function is coercing to. This allows correct deduction of the
column type in examples such as
CREATE VIEW v AS SELECT f1::char(8) FROM tbl;
Formerly we labeled v's column as char-of-unknown-length not char(8).
Also, this change causes the parser not to insert a redundant length
coercion function if the user has explicitly casted an INSERT or UPDATE
expression to the right length.
Tom Lane [Sat, 26 Feb 2000 18:31:25 +0000 (18:31 +0000)]
psql's \d command wasn't doing the right things with 'char' (type 18)
fields, nor with bpchar and varchar fields that have typmod -1. The
latter effectively have an unspecified length, so I made them display
as char() and varchar() rather than falsely equating them to char(1)
and varchar(1).
Tom Lane [Sat, 26 Feb 2000 06:36:44 +0000 (06:36 +0000)]
Undo a couple of mistaken applications of NameStr() to StringInfos.
It worked, because they both have fields named 'data', but it's surely
trouble waiting to happen. I wonder whether there are more ...
Tom Lane [Sat, 26 Feb 2000 05:25:55 +0000 (05:25 +0000)]
Shared-memory hashtables have non-extensible directories, which means
it's a good idea to choose the directory size based on the expected
number of entries. But ShmemInitHash was using a hard-wired constant.
Boo hiss. This accounts for recent report of postmaster failure when
asking for 64K or more buffers.
Tom Lane [Fri, 25 Feb 2000 02:58:48 +0000 (02:58 +0000)]
Fix longstanding bug that kept functional indexes from working when you
defaulted the opclass. This addresses TODO item
* Allow creation of functional indexes to use default types
(Does that make it a feature? Oh dear...)
Tom Lane [Thu, 24 Feb 2000 04:50:51 +0000 (04:50 +0000)]
Tweak libpq so that if a backend ERROR message arrives while libpq
thinks the connection is idle, the error message is displayed as if
it were a NOTICE. This seems better than dropping the message on
the floor ... particularly if the message is the backend telling us
why it's about to close the connection. The previous behavior was
Backend message type 0x45 arrived while idle
pqReadData() -- backend closed the channel unexpectedly.
which is not real helpful.