Additional PostgreSQL-specific functions

187 views
Skip to first unread message

Joey Wilhelm

unread,
Nov 17, 2017, 3:02:45 PM11/17/17
to django-d...@googlegroups.com
Greetings,

Yesterday I opened a ticket[1] for a "RegexpReplace" method for PostgreSQL. After some talk and encouragement over in IRC, I have additionally created a "SubstrFrom" function for PostgreSQL, which allows you to use a regex match in order to extract your substring.

So at this point, I have a couple of questions.

1) Are these things which would likely get integrated into core?
2) If so, should I put them into separate tickets or would I be able to combine them into a single?
3) Should they be added to the PostgreSQL specific library? Oracle does have both of these pieces of functionality, but I believe it is the only popular engine aside from PostgreSQL which does.

I have the code for both of these implemented in my local project, along with tests, so I would love to contribute them if possible.

Thank you!


Matthew Pava

unread,
Nov 17, 2017, 3:13:28 PM11/17/17
to django-d...@googlegroups.com

I wonder if we should put that in this ticket:

https://code.djangoproject.com/ticket/28643

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CADBkHd%2Be3GodbKvDFXq0dAgwzs4n%3DFgLGHTYsbhuiQWDOcB64Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Joey Wilhelm

unread,
Nov 17, 2017, 3:23:36 PM11/17/17
to django-d...@googlegroups.com
I did come upon that ticket, but I wasn't sure this necessarily belonged as part of it, given that these are not methods which are widely available across different engines. That said, I would gladly add them there. I'm just eager to spin up a PR or two. :-)

On Fri, Nov 17, 2017 at 1:12 PM, Matthew Pava <Matthe...@iss.com> wrote:

I wonder if we should put that in this ticket:

https://code.djangoproject.com/ticket/28643

 

 

From: django-developers@googlegroups.com [mailto:django-developers@googlegroups.com] On Behalf Of Joey Wilhelm
Sent: Friday, November 17, 2017 2:02 PM
To: django-developers@googlegroups.com
Subject: Additional PostgreSQL-specific functions

 

Greetings,

 

Yesterday I opened a ticket[1] for a "RegexpReplace" method for PostgreSQL. After some talk and encouragement over in IRC, I have additionally created a "SubstrFrom" function for PostgreSQL, which allows you to use a regex match in order to extract your substring.

 

So at this point, I have a couple of questions.

 

1) Are these things which would likely get integrated into core?

2) If so, should I put them into separate tickets or would I be able to combine them into a single?

3) Should they be added to the PostgreSQL specific library? Oracle does have both of these pieces of functionality, but I believe it is the only popular engine aside from PostgreSQL which does.

 

I have the code for both of these implemented in my local project, along with tests, so I would love to contribute them if possible.

 

Thank you!

 

 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.

To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.

Joey Wilhelm

unread,
Nov 30, 2017, 1:22:32 PM11/30/17
to django-d...@googlegroups.com
Ping!

Is there any chance of getting some additional guidance on these? I'd love to get these contributed, if they are welcome!

-Joey Wilhelm

Josh Smeaton

unread,
Dec 3, 2017, 4:58:51 PM12/3/17
to Django developers (Contributions to Django itself)
Hey Joey,

I think you can create a new ticket for this function. If there is a way to approximate or implement this function in all 4 supported backends then that would be preferred. If it can only really be implemented in postgres, then document in the ticket why, and you can add the new function to contrib.postgres. Hope that helps?


On Friday, 1 December 2017 05:22:32 UTC+11, Joey Wilhelm wrote:
Ping!

Is there any chance of getting some additional guidance on these? I'd love to get these contributed, if they are welcome!

-Joey Wilhelm
On Fri, Nov 17, 2017 at 1:22 PM, Joey Wilhelm <tarka...@gmail.com> wrote:
I did come upon that ticket, but I wasn't sure this necessarily belonged as part of it, given that these are not methods which are widely available across different engines. That said, I would gladly add them there. I'm just eager to spin up a PR or two. :-)
On Fri, Nov 17, 2017 at 1:12 PM, Matthew Pava <Matthe...@iss.com> wrote:

I wonder if we should put that in this ticket:

https://code.djangoproject.com/ticket/28643

 

 

From: django-d...@googlegroups.com [mailto:django-d...@googlegroups.com] On Behalf Of Joey Wilhelm
Sent: Friday, November 17, 2017 2:02 PM
To: django-d...@googlegroups.com
Subject: Additional PostgreSQL-specific functions

 

Greetings,

 

Yesterday I opened a ticket[1] for a "RegexpReplace" method for PostgreSQL. After some talk and encouragement over in IRC, I have additionally created a "SubstrFrom" function for PostgreSQL, which allows you to use a regex match in order to extract your substring.

 

So at this point, I have a couple of questions.

 

1) Are these things which would likely get integrated into core?

2) If so, should I put them into separate tickets or would I be able to combine them into a single?

3) Should they be added to the PostgreSQL specific library? Oracle does have both of these pieces of functionality, but I believe it is the only popular engine aside from PostgreSQL which does.

 

I have the code for both of these implemented in my local project, along with tests, so I would love to contribute them if possible.

 

Thank you!

 

 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.

To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.

Joe Tennies

unread,
Dec 4, 2017, 9:21:39 AM12/4/17
to django-d...@googlegroups.com
As a note, MariaDB also has regex_replace support (since 2013), but I don't believe MySql does yet. People have implemented it via User Defined Functions.

SQLite can support it if using the icu_replace extension module.

What is the current Django best practice for optionally available functionality? I know there's comments in GeoDjango about needing the extensions for the database, but is this something that should be done for specific functions? Would a good log message and exception be okay?

To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Joe Tennies
ten...@gmail.com
Reply all
Reply to author
Forward
0 new messages