Merged PRs
doltgresql
- 1270: Bug fixes for primary and foreign key naming
Addresses several issues around primary key and foreign key naming:- ability to drop a primary key using its default postgres name
- declaring a foreign key reference inline in a column definition
- default foreign key names now match postgres
- fix for
pg_constaints
incorrectly listing non-unique and non-pk indexes
Note that the regressions listed are all related to now honoring foreign key references inline in a column definition. Before, these statements were executing, but the FK reference was ignored. Now that we honor the FK reference, several tests broke for the following reasons: DROP TABLE
doesn't automatically sort multiple tables by FK dependencies- A required index didn't exist or wasn't automatically created
- FKs aren't currently supported for temp tables
- A new FK references a generated column, which we don't support yet, so FK checks failed on insert
- 1255: Support for
RAISE
in PL/pgSQL
Adds initial support forRAISE
statements in PL/pgSQL functions. There are still a few edge case TODOs (e.g. using theclient_min_messages
config param to determine what level of notices to send to clients), and this initial pass does not include any exception handling.
Notice messages are queued in the current session, then sent to the client from the connection handler, right before results are sent to the client. Support for setting notices in the DoltSession is added in dolthub/dolt#8974.
PostgreSQL Docs - 1244: Support for text keys in ALTER TABLE statements
Stacked on top of #1243, relies on dolthub/go-mysql-server#2871 - 1243: Implemented a couple jsonb functions
- 1239: Fixed bug with generated values not being properly quoted
This wasn't due to a bug in GMS, but rather a bug in our CreateTable wrapper node. This wasn't caught earlier because column default values in postgres can't contain column references, only generated columns can.
Fixing this bug exposed others, namely when using functions in check constraints. - 1233: Bug fix for generated columns when creating a primary key
This PR implements the parser changes in dolthub/go-mysql-server#2861 and adds tests.
There are still bugs around quoting in generated columns that need to be fixed in GMS, which will come in a follow-up PR. - 1230: go.mod: Bump go version to 1.24.0.
- 1228: Add support for
CASE ... WHEN
in PL/pgSQL - 1226: Unskip a dataloader BATS test now that a unique index bug was fixed
- 1224: Allow primary keys to contain address columns sorted by their resolved values, anf add always-disabled AutoGCConfig to get doltgresql compiling
This is a merge of #1219 and #1214
Due to concurrent changes in Dolt, these PRs need to be combined in order to get a clean CI. - 1222: Initial support for
DROP FUNCTION
Adds initial support forDROP FUNCTION
. (PostgreSQL Docs)
Two of the main features not supported yet are: cascading deletes of function dependencies, and restricting deletes when function dependencies are detected. The resolution of a type from its name also needs to fleshed out more to support types outside of thepg_catalog
schema. - 1221: json_build_array and json_build_object functions
- 1219: servercfg: Add always-disabled AutoGCConfig to get doltgresql compiling.
Goes with dolthub/dolt#8849, which adds a config stanza like:for now, this just gets doltgresql compiling and always disables auto_gc.behavior: auto_gc_behavior: enable: true
- 1214: Allow primary keys to contain address columns sorted by their resolved values.
This is the Doltgres part of this change.
GMS PR: dolthub/go-mysql-server#2854
Dolt PR: dolthub/dolt#8870
The goal of the change is to allow for indexes to use an out-of-line variable-length type (like TEXT or BLOB) as a primary key while still storing just the address in the index (instead of being forced to store a prefix of the value).
As a result of this change, any tuple comparison operation may need to resolve a hash in the NodeStore. This poses two complications:- The tuple logic exists at a much lower level than the node store and can't depend on it without creating a dependency cycle. We get around this with a new
ValueStore
interface that can store and retrieve variable-length bytestrings by their content hash.NodeStore
is the only implementation of this interface, but decoupling the interface from the implementation allows us to not depend onNodeStore
's internals when passing it to lower-level code. - Tuple comparison operations can now end up doing disk IO, which means they need a context parameter.
- The tuple logic exists at a much lower level than the node store and can't depend on it without creating a dependency cycle. We get around this with a new
- 1213: Changed created functions to persist on the root
This changes created functions such that they're now written to the root value, instead of being added to the global function list. This also supports overloading created functions.