- 12 2月, 2016 1 次提交
-
-
由 Heikki Linnakangas 提交于
In cdbcat.h, include only the header files that are actually needed for the single function prototype in that file. And don't include cdbcat.h unnecessarily. A couple of .c files were including cdbcat.h to get GpPolicy, but that's actually defined in catalog/gp_policy.h, so #include that directly instead where needed.
-
- 08 2月, 2016 1 次提交
-
-
由 Daniel Gustafsson 提交于
oldPersistentSerialNum and segmentFileNum are only initalized in the subsequent loop and printing them before the loop doesn't make any sense.
-
- 19 1月, 2016 1 次提交
-
-
由 Venkatesh Raghavan 提交于
-
- 18 1月, 2016 1 次提交
-
-
由 Heikki Linnakangas 提交于
parser/analyze.c is bloated, moving larger chunks of GPDB-specific functionality like this elsewhere makes it more readable. Make diffing and merging of analyze.c with upstream easier, too. I also ran pgindent on parse_partition.c.
-
- 12 1月, 2016 1 次提交
-
-
由 Heikki Linnakangas 提交于
Moving the installation of gp_toolkit.sql into initdb, in commit f8910c3c, broke all the functions that are supposed to execute on all nodes, like gp_toolkit.__gp_localid. After that change, gp_toolkit.sql was executed in utility mode, and the gp_distribution_policy entries for those functions were not created as a result. To fix, change the code so that gp_distribution_policy entries are never never created, or consulted, for EXECUTE-type external tables. They have more fine-grained information in pg_exttable.location field anyway, so rely on that instead. With this change, there is no difference in whether an EXECUTE-type external table is created in utility mode or not. We would still have similar problems if gp_toolkit contained other kinds of external tables, but it doesn't. This removes the isMasterOnly() function and changes all its callers to call GpPolicyFetch() directly instead. Some places used GpPolicyFetch() directly to check if a table is distributed, so this just makes that the canonical way to do it. The check for system schemas that used to be in isMasterOnly() are no longer performed, but they should've unnecessary in the first place. System tables don't have gp_distribution_policy entries, so they'll be treated as master-only even without that check.
-
- 07 1月, 2016 1 次提交
-
-
由 Heikki Linnakangas 提交于
These were both only used by a single, static, function.
-
- 30 12月, 2015 1 次提交
-
-
由 Heikki Linnakangas 提交于
Just some random things I happened to spot while reading code.
-
- 11 12月, 2015 1 次提交
-
-
由 Heikki Linnakangas 提交于
These were renamed to 'typname' in GPDB a long time ago because 'typename' is a reserved keyword in C++. That's a valid concern for header files that need to be included in C++ code (like src/backend/gpopt), but it's not necessary for local variables that appear in .c files, as long as we're careful to compile those files as C code, not C++. So rename local variables back to 'typename', to reduce diff vs. upstream and make merging slightly easier. In the upstream header files, the 'typename' fields were renamed to 'typeName', in a later PostgreSQL version. In GPDB, we've renamed them to 'typname' instead. Would be good to adopt the upstream naming at some point, but not in this patch.
-
- 02 12月, 2015 1 次提交
-
-
由 Gang Xiong 提交于
Alter partitioned table set distributed by will dispatch information from QD to QEs, the information is not correctly coded and decoded on both sides when: 1. reorganize = false. 2. table have index. 3. partition table have "with" option.
-
- 19 11月, 2015 1 次提交
-
-
由 Heikki Linnakangas 提交于
The current plan is to use something like pg_upgrade for future in-place upgrades. The gpupgrade mechanism will not scale to the kind of drastic catalog and other data directory layout changes that are coming as we merge with later PostgreSQL releases. Kept gpupgrademirror for now. Need to check if there's some logic that's worth saving, for a possible pg_upgrade based solution later.
-
- 18 11月, 2015 1 次提交
-
-
由 Heikki Linnakangas 提交于
It was just syntax and catalogs, you couldn't actually do anything useful with it. Remove it, so that we have less code to maintain, until it's time to merge this stuff from upstream again when we merge with PostgreSQL 8.4. It's probably easier to merge this back at that point than maintain this backported version in the meanwhile. Less effort now, until we reach that point, and once we get to the point in 8.4 that we merge this in, we'll have all the preceding patches applied already, so it should merge quite smoothly.
-
- 07 11月, 2015 1 次提交
-
-
由 Ashwin Agrawal 提交于
-
- 05 11月, 2015 1 次提交
-
-
由 Ashwin Agrawal 提交于
Relation can potential be dropped while waiting to acquire lock. If cannot find the relation for "if_exists" case should just emit NOTICE and act as noop.
-
- 03 11月, 2015 1 次提交
-
-
由 Asim Praveen 提交于
If DROP has to wait for a lock on the relation after its OID was looked up, it may happen that the name is no longer valid by the time DROP acquires the lock. This case is handled by pulling a function from upstream commit commit 4240e429 Author: Robert Haas <rhaas@postgresql.org> Date: Fri Jul 8 22:19:30 2011 -0400 Try to acquire relation locks in RangeVarGetRelid.
-
- 30 10月, 2015 1 次提交
-
-
由 Entong Shen 提交于
Exchanging a default partition is currently not allowed because there is no validation on the data being exchanged. This commit add a GUC to enable this if the user chooses to do so.
-
- 28 10月, 2015 1 次提交
-
-
- 14 2月, 2007 1 次提交
-
-
由 Tom Lane 提交于
equality checks it applies, instead of a random dependence on whatever operators might be named "=". The equality operators will now be selected from the opfamily of the unique index that the FK constraint depends on to enforce uniqueness of the referenced columns; therefore they are certain to be consistent with that index's notion of equality. Among other things this should fix the problem noted awhile back that pg_dump may fail for foreign-key constraints on user-defined types when the required operators aren't in the search path. This also means that the former warning condition about "foreign key constraint will require costly sequential scans" is gone: if the comparison condition isn't indexable then we'll reject the constraint entirely. All per past discussions. Along the way, make the RI triggers look into pg_constraint for their information, instead of using pg_trigger.tgargs; and get rid of the always error-prone fixed-size string buffers in ri_triggers.c in favor of building up the RI queries in StringInfo buffers. initdb forced due to columns added to pg_constraint and pg_trigger.
-
- 02 2月, 2007 1 次提交
-
-
由 Tom Lane 提交于
made query plan. Use of ALTER COLUMN TYPE creates a hazard for cached query plans: they could contain Vars that claim a column has a different type than it now has. Fix this by checking during plan startup that Vars at relation scan level match the current relation tuple descriptor. Since at that point we already have at least AccessShareLock, we can be sure the column type will not change underneath us later in the query. However, since a backend's locks do not conflict against itself, there is still a hole for an attacker to exploit: he could try to execute ALTER COLUMN TYPE while a query is in progress in the current backend. Seal that hole by rejecting ALTER TABLE whenever the target relation is already open in the current backend. This is a significant security hole: not only can one trivially crash the backend, but with appropriate misuse of pass-by-reference datatypes it is possible to read out arbitrary locations in the server process's memory, which could allow retrieving database content the user should not be able to see. Our thanks to Jeff Trout for the initial report. Security: CVE-2007-0556
-
- 25 1月, 2007 2 次提交
-
-
由 Bruce Momjian 提交于
objects. Jaime Casanova
-
由 Bruce Momjian 提交于
might cause server crash. Backpatch to 8.2.X.
-
- 06 1月, 2007 1 次提交
-
-
由 Bruce Momjian 提交于
back-stamped for this.
-
- 04 1月, 2007 1 次提交
-
-
由 Tom Lane 提交于
having md.c return a success/failure boolean to smgr.c, which was just going to elog anyway, let md.c issue the elog messages itself. This allows better error reporting, particularly in cases such as "short read" or "short write" which Peter was complaining of. Also, remove the kluge of allowing mdread() to return zeroes from a read-beyond-EOF: this is now an error condition except when InRecovery or zero_damaged_pages = true. (Hash indexes used to require that behavior, but no more.) Also, enforce that mdwrite() is to be used for rewriting existing blocks while mdextend() is to be used for extending the relation EOF. This restriction lets us get rid of the old ad-hoc defense against creating huge files by an accidental reference to a bogus block number: we'll only create new segments in mdextend() not mdwrite() or mdread(). (Again, when InRecovery we allow it anyway, since we need to allow updates of blocks that were later truncated away.) Also, clean up the original makeshift patch for bug #2737: move the responsibility for padding relation segments to full length into md.c.
-
- 31 12月, 2006 1 次提交
-
-
由 Tom Lane 提交于
about typmod representation for standard types out into type-specific typmod I/O functions. Teodor Sigaev, with some editorialization by Tom Lane.
-
- 23 12月, 2006 1 次提交
-
-
由 Tom Lane 提交于
cases. Operator classes now exist within "operator families". While most families are equivalent to a single class, related classes can be grouped into one family to represent the fact that they are semantically compatible. Cross-type operators are now naturally adjunct parts of a family, without having to wedge them into a particular opclass as we had done originally. This commit restructures the catalogs and cleans up enough of the fallout so that everything still works at least as well as before, but most of the work needed to actually improve the planner's behavior will come later. Also, there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way to create a new family right now is to allow CREATE OPERATOR CLASS to make one by default. I owe some more documentation work, too. But that can all be done in smaller pieces once this infrastructure is in place.
-
- 14 10月, 2006 1 次提交
-
-
由 Tom Lane 提交于
-
- 12 10月, 2006 1 次提交
-
-
由 Tom Lane 提交于
don't cheat on the raw-vs-cooked status of a constraint.
-
- 07 10月, 2006 1 次提交
-
-
由 Peter Eisentraut 提交于
-
- 04 10月, 2006 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 05 9月, 2006 1 次提交
-
-
由 Tom Lane 提交于
the target relation(s). There might be some cases where we could discard the pending event instead, but for the moment a conservative approach seems sufficient. Per report from Markus Schiltknecht and subsequent discussion.
-
- 25 8月, 2006 1 次提交
-
-
由 Tom Lane 提交于
blocking concurrent writes to the table. Greg Stark, with a little help from Tom Lane.
-
- 21 8月, 2006 1 次提交
-
-
由 Tom Lane 提交于
by abandoning the idea that it should say SERIAL in the dump. Instead, dump serial sequences and column defaults just like regular ones. Add a new backend command ALTER SEQUENCE OWNED BY to let pg_dump recreate the sequence-to-column dependency that was formerly created "behind the scenes" by SERIAL. This restores SERIAL to being truly "just a macro" consisting of component operations that can be stated explicitly in SQL. Furthermore, the new command allows sequence ownership to be reassigned, so that old mistakes can be cleaned up. Also, downgrade the OWNED-BY dependency from INTERNAL to AUTO, since there is no longer any very compelling argument why the sequence couldn't be dropped while keeping the column. (This forces initdb, to be sure the right kinds of dependencies are in there.) Along the way, add checks to prevent ALTER OWNER or SET SCHEMA on an owned sequence; you can now only do this indirectly by changing the owning table's owner or schema. This is an oversight in previous releases, but probably not worth back-patching.
-
- 04 8月, 2006 1 次提交
-
-
由 Tom Lane 提交于
the DROP pass rather than the ADD_CONSTR pass. On examining the code I think this was just an oversight rather than intentional, and it seems to satisfy the principle of least surprise better than the alternative solution that was discussed. Add an example to the ref page showing how to do ALTER TYPE and update the default in one command. Per gripe from Markus Bertheau that that wasn't possible.
-
- 01 8月, 2006 1 次提交
-
-
由 Tom Lane 提交于
(table or index) before trying to open its relcache entry. This fixes race conditions in which someone else commits a change to the relation's catalog entries while we are in process of doing relcache load. Problems of that ilk have been reported sporadically for years, but it was not really practical to fix until recently --- for instance, the recent addition of WAL-log support for in-place updates helped. Along the way, remove pg_am.amconcurrent: all AMs are now expected to support concurrent update.
-
- 31 7月, 2006 1 次提交
-
-
由 Tom Lane 提交于
created in the bootstrap phase proper, rather than added after-the-fact by initdb. This is cleaner than before because it allows us to retire the undocumented ALTER TABLE ... CREATE TOAST TABLE command, but the real reason I'm doing it is so that toast tables of shared catalogs will now have predetermined OIDs. This will allow a reasonably clean solution to the problem of locking tables before we load their relcache entries, to appear in a forthcoming patch.
-
- 14 7月, 2006 2 次提交
-
-
由 Bruce Momjian 提交于
-
由 Bruce Momjian 提交于
Strip unused include files out unused include files, and add needed includes to C files. The next step is to remove unused include files in C files.
-
- 12 7月, 2006 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 11 7月, 2006 1 次提交
-
-
由 Tom Lane 提交于
a table. Otherwise a USING clause that yields NULL can leave the table violating its constraint (possibly there are other cases too). Per report from Alexander Pravking.
-
- 04 7月, 2006 1 次提交
-
-
由 Tom Lane 提交于
discussion (including making def_arg allow reserved words), add missed opt_definition for UNIQUE case. Put the reloptions support code in a less random place (I chose to make a new file access/common/reloptions.c). Eliminate header inclusion creep. Make the index options functions safely user-callable (seems like client apps might like to be able to test validity of options before trying to make an index). Reduce overhead for normal case with no options by allowing rd_options to be NULL. Fix some unmaintainably klugy code, including getting rid of Natts_pg_class_fixed at long last. Some stylistic cleanup too, and pay attention to keeping comments in sync with code. Documentation still needs work, though I did fix the omissions in catalogs.sgml and indexam.sgml.
-
- 02 7月, 2006 1 次提交
-
-
由 Neil Conway 提交于
the read lock we hold on the table's parent relation until commit. Update equalfuncs.c for the new field in AlterTableCmd. Various improvements to comments, variable names, and error reporting. There is room for further improvement here, but this is at least a step in the right direction.
-