Proper way to handle new 128 character identifier limit in Oracle >= 12.2

209 views
Skip to first unread message

Van Klaveren, Brian N.

unread,
Nov 8, 2018, 11:24:01 AM11/8/18
to sqlal...@googlegroups.com
Hi,

Oracle 12.2 now allows 128 character length identifiers:


It'd be great if sqlalchemy knew about this, but what's the proper way of handling this? Just use the existing dialect and monkey patch max_identifier_length or create a new dialect?

Thanks,
Brian


Mike Bayer

unread,
Nov 8, 2018, 11:30:19 AM11/8/18
to sqlal...@googlegroups.com
for now monkeypatch, and for the fix, we would need to look at the
server version info and modify the variable accordingly, here:

https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/dialects/oracle/base.py#L1087

Pull requests welcome on this or at least we can create an issue in
bitbucket to track this.


>
> Thanks,
> Brian
>
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
> ---
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
> To post to this group, send email to sqlal...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

Chris Stephens

unread,
May 8, 2019, 4:27:17 PM5/8/19
to sqlalchemy
I think you would actually want to query v$parameter since "compatible" can be set to a lower version than server which disables 128 lengths.

SQL> select value from v$parameter where name = 'compatible';

VALUE
----------
12.2.0

On Thursday, November 8, 2018 at 10:30:19 AM UTC-6, Mike Bayer wrote:
On Thu, Nov 8, 2018 at 11:23 AM 'Van Klaveren, Brian N.' via
sqlalchemy <sqlal...@googlegroups.com> wrote:
>
> Hi,
>
> Oracle 12.2 now allows 128 character length identifiers:
>
> https://docs.oracle.com/en/database/oracle/oracle-database/12.2/newft/new-features.html#GUID-64283AD6-0939-47B0-856E-5E9255D7246B
>
> It'd be great if sqlalchemy knew about this, but what's the proper way of handling this? Just use the existing dialect and monkey patch max_identifier_length or create a new dialect?

for now monkeypatch, and for the fix, we would need to look at the
server version info and modify the variable accordingly, here:

https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/dialects/oracle/base.py#L1087

Pull requests welcome on this or at least we can create an issue in
bitbucket to track this.


>
> Thanks,
> Brian
>
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
> ---
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sqlal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages