Wrong object type: 7 ERROR: cannot SELECT from a sequence

Hello,

In CRDB v2.0-alpha SEQUENCE has been implemented, which is a great thing, but SELECT on sequences does not work as in PostgreSQL.

In PostgreSQL psql I can:
SELECT min_value, increment_by FROM “build_ctl”.“agency_id_seq”;
min_value | increment_by
-----------±-------------
1 | 1
(1 row)
– OR
SELECT * FROM “build_ctl”.“agency_id_seq”;
sequence_name | last_value | start_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called
---------------±-----------±------------±-------------±--------------------±----------±------------±--------±----------±----------
agency_id_seq | 20 | 1 | 1 | 9223372036854775807 | 1 | 1 | 30 | f | t

Whereas in CRDB v2.0-alpha I get:
SELECT min_value, increment_by FROM “build_ctl”.“agency_id_seq”;
pq: cannot SELECT from a sequence
– OR
SELECT * FROM “build_ctl”.“agency_id_seq”;
pq: cannot SELECT from a sequence

Will this be implemented in a future release? Any idea on doing this in another way?

Thank you!

Vlad

I responded on Quote_ident & CREATE FUNCTION. Let’s continue the discussion on the linked GitHub issue https://github.com/cockroachdb/cockroach/issues/19337 if you don’t mind!

OK @jordan! So, should I add other compatibility issues with PostgreSQL that prevent me from running Symfony/Doctrine on CRDB to this ticket -19337- on GitHub?

Yes, that would be great. Thank you.

1 Like