Attempts to use the obsoleted attributes of pg_operator or pg_proc
in the CREATE commands will be greeted by a warning. For pg_type,
there is no warning (yet) because pg_dump scripts still contain these
attributes.
Also remove new but already obsolete spellings
isVolatile, isStable, isImmutable in WITH clause. (Use new syntax
instead.)
Barry Lind [Tue, 23 Jul 2002 03:59:55 +0000 (03:59 +0000)]
Initial restructuring to add jdbc3 support. There was a significant amount
of duplicated code between the jdbc1 and jdbc2. This checkin restructures
the code so that the duplication is removed so that the jdbc3 support
can be added without adding yet another copy of everything. Also many
classes were renamed to avoid confusion with multiple different objects
having the same name. The timestamp tests were also updated to add support
for testing timestamp without time zone in addition to timestamp with time zone
Tom Lane [Sat, 20 Jul 2002 19:55:38 +0000 (19:55 +0000)]
Tweak CreateTrigger() so that the OID used in the name of an
RI_ConstraintTrigger is the same OID assigned to the pg_trigger row.
This reduces consumption of OIDs and may ease debugging.
Bruce Momjian [Sat, 20 Jul 2002 16:45:07 +0000 (16:45 +0000)]
Mark items as done:
> * -Add GUC parameter for DATESTYLE
> o -Allow specification of column names
> o -Change syntax to WITH DELIMITER, (keep old syntax around?)
> o -Remove SET KSQO option now that OR processing is improved (Tom)
> o -Allow SHOW to output as a query result, like EXPLAIN
> * -Add SQL92 schemas (Tom)
Bruce Momjian [Sat, 20 Jul 2002 05:57:31 +0000 (05:57 +0000)]
I can't remember who said they were working on schema related psql
changes, but I kept finding myself wishing I could see what schema a
table or view exists in when I use \dt, \dv, etc. So, here is a patch
which does just that.
It sorts on "Schema" first, and "Name" second.
It also changes the test for system objects to key off the namespace
name starting with 'pg_' instead of the object name.
Sample output:
test=# create schema testschema;
CREATE SCHEMA
test=# create view testschema.ts_view as select 1;
CREATE VIEW
test=# \dv
List of relations
Name | Schema | Type | Owner
--------------------+------------+------+----------
__testpassbyval | public | view | postgres
fooview | public | view | postgres
master_pg_proc | public | view | postgres
rmt_pg_proc | public | view | postgres
vw_dblink_get_pkey | public | view | postgres
vw_dblink_replace | public | view | postgres
ts_view | testschema | view | postgres
(7 rows)
Bruce Momjian [Sat, 20 Jul 2002 05:49:28 +0000 (05:49 +0000)]
> 2. This patch includes the same Table Function API fixes that I
> submitted on July 9:
>
> http://archives.postgresql.org/pgsql-patches/2002-07/msg00056.php
>
> Please disregard that one *if* this one is applied. If this one is
> rejected please go ahead with the July 9th patch.
The July 9th Table Function API patch mentioned above is now in CVS, so
here is an updated version of the guc patch which should apply cleanly
against CVS tip.
Bruce Momjian [Sat, 20 Jul 2002 05:43:31 +0000 (05:43 +0000)]
Hello, i noticed that win32 native stopped working/compiling after the SSL merge
.
So i took the opportunity to fix some stuff:
1. Made the thing compile (typos & needed definitions) with the new pqsecure_* s
tuff, and added fe-secure.c to the win32.mak makefile.
2. Fixed some MULTIBYTE compile errors (when building without MB support).
3. Made it do that you can build with debug info: "nmake -f win32.mak DEBUG=1".
4. Misc small compiler speedup changes.
The resulting .dll has been tested in production, and everything seems ok.
I CC:ed -hackers because i'm not sure about two things:
1. In libpq-int.h I typedef ssize_t as an int because Visual C (v6.0)
doesn't de fine ssize_t. Is that ok, or is there any standard about what
type should be use d for ssize_t?
2. To keep the .dll api consistent regarding MULTIBYTE I just return -1
in fe-connect.c:PQsetClientEncoding() instead of taking away the whole
function. I wonder if i should do any compares with the
conn->client_encoding and return 0 if not hing would have changed (if so
how do i check that?).
Bruce Momjian [Sat, 20 Jul 2002 05:16:59 +0000 (05:16 +0000)]
oid is needed, it is added at the end of the struct (after the null
bitmap, if present).
Per Tom Lane's suggestion the information whether a tuple has an oid
or not is carried in the tuple descriptor. For debugging reasons
tdhasoid is of type char, not bool. There are predefined values for
WITHOID, WITHOUTOID and UNDEFOID.
This patch has been generated against a cvs snapshot from last week
and I don't expect it to apply cleanly to current sources. While I
post it here for public review, I'm working on a new version against a
current snapshot. (There's been heavy activity recently; hope to
catch up some day ...)
This is a long patch; if it is too hard to swallow, I can provide it
in smaller pieces:
Part 1: Accessor macros
Part 2: tdhasoid in TupDesc
Part 3: Regression test
Part 4: Parameter withoid to heap_addheader
Part 5: Eliminate t_oid from HeapTupleHeader
Part 2 is the most hairy part because of changes in the executor and
even in the parser; the other parts are straightforward.
Up to part 4 the patched postmaster stays binary compatible to
databases created with an unpatched version. Part 5 is small (100
lines) and finally breaks compatibility.
Bruce Momjian [Sat, 20 Jul 2002 04:59:10 +0000 (04:59 +0000)]
The attached patch fixes a build problem with GEQO when using the
PX recombination operator, changes some elog() messages from LOG
to DEBUG1, puts some debugging functions inside the appropriate
#ifdef (not enabled by default), and makes a few other minor
cleanups.
BTW, the elog() change is motivated by at least one user who
has sent a concerned email to -general asking exactly what the
"ERX recombination operator" is, and what it is doing to their
DBMS.
Bruce Momjian [Sat, 20 Jul 2002 04:57:13 +0000 (04:57 +0000)]
This patch fixes a regression caused by my recent changes to heap
tuple header. The fix is based on the thought that HEAP_MOVED_IN is
not needed any more as soon as HEAP_XMIN_COMMITTED has been set. So
in tqual.c and vacuum.c the HEAP_MOVED bits are cleared when
HEAP_XMIN_COMMITTED is set.
Vacuum robustness is enhanced by rearranging ifs, so that we have a
chance to elog(ERROR, ...) before an assertion fails.
> Hi Tatsuo,
>
> I've attached a patch for the version of pgbench in CVS. It includes the
> following changes:
>
> - fix some spelling mistakes, indentation stuff, etc.
>
> - minor code cleanup -- (void) args instead of (), etc.
>
> - allocate the state array dynamically, so that it is only as
> large as needed. This reduces the memory consumption of pgbench
> slightly, and makes a larger MAXCLIENTS setting possible
>
> - (the only controversial change) add an option "-l" to log
> transaction latencies to a file. The "transaction latency"
> is the time between when the BEGIN is issued and the transaction
> commits. This is written to a file, along with the client #
> and the transaction #. The data in the file can then be used
> for things like:
>
> - consistency analysis: is the TPS the same through the
> entire run of pgbench, or does it change?
>
> - more detailed stats: what is the average latency, worse-case
> latency, best-case latency?
>
> - graphs: feed the data to gnuplot, graph latency versus. time
>
> - etc.
>
> I was going to store this data in memory and write it to disk
> at the end of the pgbench run, but that isn't feasible because
> the data can be very large: for example, ~70MB if benchmarking
> 128 clients doing 100,000 transactions each.
>
> Cheers,
>
> Neil
Peter Eisentraut [Thu, 18 Jul 2002 23:11:32 +0000 (23:11 +0000)]
pg_cast table, and standards-compliant CREATE/DROP CAST commands, plus
extension to create binary compatible casts. Includes dependency tracking
as well.
pg_proc.proimplicit is now defunct, but will be removed in a separate
commit.
pg_dump provides a migration path from the previous scheme to declare
casts. Dumping binary compatible casts is currently impossible, though.
Tom Lane [Thu, 18 Jul 2002 16:47:26 +0000 (16:47 +0000)]
Implement DROP SCHEMA. It lacks support for dropping conversions and
operator classes, both of which are schema-local and so should really
be droppable.
Bruce Momjian [Thu, 18 Jul 2002 04:47:17 +0000 (04:47 +0000)]
Here (finally ;-)) is a doc patch covering the Table Function C API. It
reflects the changes in the tablefunc-fix patch that I sent in the other
day. It also refers to "see contrib/tablefunc for more examples", which
is next on my list of things to finish and submit.
Bruce Momjian [Thu, 18 Jul 2002 04:43:51 +0000 (04:43 +0000)]
The attached patch (against HEAD) implements
COPY x (a,d,c,b) from stdin;
COPY x (a,c) to stdout;
as well as the corresponding changes to pg_dump to use the new
functionality. This functionality is not available when using
the BINARY option. If a column is not specified in the COPY FROM
statement, its default values will be used.
In addition to this functionality, I tweaked a couple of the
error messages emitted by the new COPY <options> checks.
Bruce Momjian [Thu, 18 Jul 2002 04:40:30 +0000 (04:40 +0000)]
Here is a patch for the Table Function API. It fixes a bug found by Neil
Conway (BuildTupleFromCStrings sets NULL for pass-by-value types when
intended value is 0). It also implements some other improvements
suggested by Neil.
I have committed many support files for CREATE CONVERSION. Default
conversion procs and conversions are added in initdb. Currently
supported conversions are:
Note that initial contents of pg_conversion system catalog are created
in the initdb process. So doing initdb required is ideal, it's
possible to add them to your databases by hand, however. To accomplish
this:
Tom Lane [Tue, 16 Jul 2002 22:12:20 +0000 (22:12 +0000)]
Add more dependency insertions --- this completes the basic pg_depend
functionality. Of note: dropping a table that has a SERIAL column
defined now drops the associated sequence automatically.
Tom Lane [Tue, 16 Jul 2002 17:48:46 +0000 (17:48 +0000)]
Add initdb code to set up initial contents of pg_depend, pinning all
objects created during initdb (except for the system views, which I
think do not need to be pinned).
Bruce Momjian [Tue, 16 Jul 2002 17:05:46 +0000 (17:05 +0000)]
> pgsql-bugs@postgresql.org wrote:
> > David Clark (dclarknospam@opsi.co.za) reports a bug with a severity
> > Table 3-7 SQL Literal escaped octets shows the input escape
> > representation for a single quote as '\\'' , but the third paragraph
> > below table 3-8 SQL Output Escaped Octets says that the single quote
> > must be input as '\''
>
> Nice catch. '\'' is correct as shown in the example in Table 3-7.
>
> >
> > Also in the same paragraph mentioned above it says input for the
> > single quote must be '\'' (or '\\134') shouldn't this be (or '\\047')
>
> Also a bug. Should be '\\047', as you pointed out.
>
Here's a patch to fix the binary string doc errors.
Tom Lane [Tue, 16 Jul 2002 05:53:34 +0000 (05:53 +0000)]
Add code to extract dependencies from an expression tree, and use it
to build dependencies for rules, constraint expressions, and default
expressions. Repair some problems in the original design of
recursiveDeletion() exposed by more complex dependency sets. Fix
regression tests that were deleting things in illegal sequences.
Bruce Momjian [Tue, 16 Jul 2002 00:51:37 +0000 (00:51 +0000)]
This fixes 2 inaccuracies in the recently added SQL99 feature list docs.
UNIQUE and DISTINCT predicates are both listed as implemented -- AFAIK,
neither is.
I also included another trivial patch which adds the default location
of the DSSSL stylesheets on my system (Debian unstable, docbook-dsssl
1.76) to the list of paths that configure looks for.
Tom Lane [Mon, 15 Jul 2002 16:33:32 +0000 (16:33 +0000)]
Use the dependency mechanism to manage column defaults. We need this
so that dependencies in default expressions (on operators, functions,
etc) can be expressed properly.