-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: support for "meta" postgresql tables? #5194
Comments
Actually, slightly closer inspection of |
The immediate issue in that stack trace is not that the We are not planning to implement the |
👍 I suppose this should be closed in favor of #2970 then. |
Some sort of virtual table mechanism would be nice, so that all of these PG system tables could be implemented virtually via a plugin that in turn used native introspection. That said, the real trick or fly in the ointment might be achieving near-100% compatibility with the actual values in the tables, like for entity types that simply don't exist in CockroachDB. |
I think it would be difficult to get close enough to postgresql's system tables to be useful. In my work so far with django replacing the introspection code was only a small part of what was required. |
Also ruins using at connect time: Kind of a bummer to have to fork all of these. |
The SQL standard defines an |
Looks like |
It varies. Sometimes you can swap out the network protocol independently of the rest, sometimes it's configured as one big unit (and even if the protocol were separate, using the mysql introspection code would typically pull in a lot of other mysqlisms). In the specific case of django, you can't make this change without a custom plugin (which I have in a branch in cockroach-python), and once we're going that far it's easier to just implement the necessary introspection commands with |
I strongly suspect the answer is that folks are unaware of On Fri, Apr 8, 2016 at 3:48 PM, Ben Darnell notifications@github.com
"I disapprove of what you say, but I will defend to the death your right to |
It's not just a lack of awareness (although it's possible that that's the root cause and no one has had any reason to update the old code): django uses both information_schema and pg_catalog in adjacent methods. Anyway, we don't support information_schema yet either, so there's not much point in trying to promote its use at this point. |
Outside the technical reasons for meta-fields (and the cited standards above), from an end-user point of view there are some valid points to have queryable metadata on table.
[RFC] meta-fields on tables for end-users per-table meta-fields:
per-column meta-fields:
With this setting, visible rowname could link the meta_column_rowname value, be easy to change/modify. easy to move in the columns order. per-row meta-fields:
Values should be native/internally triggered on insert/update, as option, not by default. Every cited meta-field should be queryable (select). Comments are welcome. HTH |
@dmedri Mind filing a separate issue for your feature request? It feels sufficiently different than the original issue which is about exposing existing table metadata in a way that is compatible with ORMs. Tables and columns have associated IDs, but those IDs are not UUIDs. The table ID and column IDs are encoded in the keys used to store the rows for table data so space efficiency is a concern. Small integer IDs are much more space efficient than UUIDs. |
It would be helpful if people could identify some specific ORM usage examples that attention could then focus on. If I Google "ORM example", SQLAlchemy comes up on top: |
One question about ORMs - is the interest primarily in simply having an object-oriented interface to traditional SQL data models, or... is the primary interest in how to map non-relational, object-oriented data structures to the relational data model. Looking at the SQLAlchemy example list, it seems like the latter. If that's the true goal of ORM support, fine, but the goal should be made explicit. As a side comment, with CockroachDB and its flexible underlying KV store, focusing too heavily on ORM for supporting graphs and other object-oriented structures may be a distraction from eventually focusing on a native object-oriented keystore data model and direct, non-SQL data access. That said, ORM support seems like a relatively easy way to get a lot of traction in the near-term. |
Looks like |
We're still working on adding more tables to |
@nvanbenschoten FWIW, the next place the django tests bail is the missing function |
I'm going to close this issue in favor of more targeted issues for missing meta tables and functions, as I think we've gotten the bulk of them at this point. I've opened #12538 to track the missing |
Right now cockroach supports the PostgreSQL wire protocol (which is pretty sweet). On a lark I decided to see what happened if I pointed the django test suite against it. Right now it fails pretty early with:
I believe the problem is a lack of support for
pg_catalog.pg_class
. Is the intent to only support PostgreSQL at the wire protocol level, or also the full API surface (notably these tables).The exact query being run is: https://github.com/django/django/blob/master/django/db/backends/postgresql/introspection.py#L56-L69
The text was updated successfully, but these errors were encountered: