Groups
Groups
Sign in
Groups
Groups
sqlalchemy
Conversations
About
Send feedback
Help
How to declare ORM class with index that in postgress is created with GREATEST
11 views
Skip to first unread message
Yoav Kopfstein
unread,
Mar 13, 2023, 12:05:14 PM
3/13/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlalchemy
Hi,
I would like to declare an index in orm class with sqlalchemy 1.4
The index is created in postgres with this command:
create index index_name
on table_name (GREATEST(field_1, field_2));
how can I do it? (with __table_args__ or without )
thanks
Cameron Simpson
unread,
Mar 13, 2023, 4:25:37 PM
3/13/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
Do you have the rest of your table definiton to hand for comparison?
Have you see this example in the core docs:
https://docs.sqlalchemy.org/en/14/core/constraints.html#indexes
Cheers,
Cameron Simpson <
c...@cskk.id.au
>
Reply all
Reply to author
Forward
0 new messages