Skip to content
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: allow specifying namespaced types #16395

Closed
jordanlewis opened this issue Jun 7, 2017 · 6 comments · Fixed by #49307
Closed

sql: allow specifying namespaced types #16395

jordanlewis opened this issue Jun 7, 2017 · 6 comments · Fixed by #49307
Assignees
Labels
A-sql-name-resolution SQL name resolution rules and CTEs. A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-intermediate Intermediate complexity, needs a contributor with 3-6 months of past contribution experience.

Comments

@jordanlewis
Copy link
Member

psql emits the following query when you try to describe a table with \d foo:

SELECT c.relchecks, c.relkind, c.relhasindex, c.relhasrules, c.relhastriggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoids, '', c.reltablespace, CASE WHEN c.reloftype = 0 THEN '' ELSE c.reloftype::pg_catalog.regtype::pg_catalog.text END, c.relpersistence, c.relreplident
FROM pg_catalog.pg_class c
 LEFT JOIN pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid)
WHERE c.oid = '3546415663';

We currently don't support specifying types with namespaces, such as pg_catalog.text. We may want to add a trivial amount of support for this kind of specification to improve compatibility.

@dianasaur323
Copy link
Contributor

@jordanlewis Do you mind explaining if this is a compatibility issue related to ORMs, GUIs or just everything in general? Trying to get a sense for how often and in what situations this issue would occur.

@jordanlewis
Copy link
Member Author

It's a compatibility issue related to any client program that uses this syntax. So far I've only observed it to be used by psql. This is not a high priority task.

@knz knz added the fruit label Jun 8, 2017
@knz knz added E-intermediate Intermediate complexity, needs a contributor with 3-6 months of past contribution experience. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-name-resolution SQL name resolution rules and CTEs. and removed fruit labels Apr 24, 2018
@jordanlewis
Copy link
Member Author

@rohany did this get fixed?

@rohany
Copy link
Contributor

rohany commented May 20, 2020

This is possible now, but some work will need to be done for type resolution on these virtual schemas.

@jordanlewis
Copy link
Member Author

It would be cool to get just the pg_catalog prefix done if it's easy, as that comes up from time to time in ORM compat stuff.

@rohany
Copy link
Contributor

rohany commented May 20, 2020

Yeah it seems pretty easy. I'll take a look this week.

rohany added a commit to rohany/cockroach that referenced this issue May 20, 2020
Fixes cockroachdb#16395.

Release note (sql change): Allows for referencing static data types
under the `pg_catalog` qualification like `pg_catalog.int`.
rohany added a commit to rohany/cockroach that referenced this issue May 20, 2020
Fixes cockroachdb#16395.

Release note (sql change): Allows for referencing static data types
under the `pg_catalog` qualification like `pg_catalog.int`.
rohany added a commit to rohany/cockroach that referenced this issue May 26, 2020
Fixes cockroachdb#16395.

Release note (sql change): Allows for referencing static data types
under the `pg_catalog` qualification like `pg_catalog.int`.
@rohany rohany mentioned this issue May 27, 2020
35 tasks
craig bot pushed a commit that referenced this issue May 27, 2020
49307: sql: add support for virtual schema qualified types r=rohany a=rohany

Fixes #16395.

Release note (sql change): Allows for referencing static data types
under the `pg_catalog` qualification like `pg_catalog.int`.

49530: sql: support max/min aggregates on collated strings r=rohany a=rohany

Fixes #45846.
Fixes #46685.

This PR allows for performing the max/min aggregations on collated
strings. Currently, our aggregates would not support container types
like `AnyCollatedString`. This PR extends the aggregates infrastructure
in DistSQL that caused the limitation to allow for container types,
which unblocks #48370.

Release note (sql change): Support the max/min aggregations on collated
strings.

49567: cloud: bump version to 20.1.1 r=dt a=dt

Release note: none.

49574: roachtest: get bigger machines for alterpk-tpcc-250 r=yuzefovich a=yuzefovich

The test has been failing for a while now because we're operating very
close to memory limit. Usually, 3.3.2.6 expensive check query ends up
crashing the node, sometimes it hits SQL memory limit. I've been staring
at it for a while, but there is a discrepancy between the memory usage
reported in runtime stats in logs and the usage that shows up in heap
profiles (for example, I could see 8GB in the former and 3GB in the
latter), and I couldn't figure out where that gaps goes. I don't think
spending any more time on this issue is worthwhile, so this commit bumps
the machine type from cpu-16 to cpu-32 which doubles available RAM from
14.4 to 28.8.

Fixes: #48428.

Release note: None

Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
@craig craig bot closed this as completed in fbe54be May 27, 2020
jbowens pushed a commit to jbowens/cockroach that referenced this issue Jun 1, 2020
Fixes cockroachdb#16395.

Release note (sql change): Allows for referencing static data types
under the `pg_catalog` qualification like `pg_catalog.int`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-name-resolution SQL name resolution rules and CTEs. A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-intermediate Intermediate complexity, needs a contributor with 3-6 months of past contribution experience.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants