Created
November 29, 2018 06:51
-
-
Save warpgate3/c1309f54e0564827f44d07bace610f15 to your computer and use it in GitHub Desktop.
functional index to_char on the postgresql (to_char, immutable issue)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION my_to_char(some_time timestamp) | |
| RETURNS text | |
| AS | |
| $BODY$ | |
| select to_char($1, 'yyyy-mm-dd'); | |
| $BODY$ | |
| LANGUAGE sql | |
| IMMUTABLE; | |
| CREATE INDEX fc_op_vist_idx_function_med_dt ON table (my_to_char(MED_DT, 'YYYY-MM')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment