Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thank you. It's a bit wordy but probably worth settling for this instead of hoping for a function that doesn't exist. Commented Mar 7, 2015 at 2:32
  • @Fawn: You can create your own function for ease of use. Plus, I added another solution. Commented Mar 9, 2015 at 0:04
  • 3
    i hate that there isn't a core method of doing this. Commented Jun 8, 2017 at 17:26
  • @EvanCarroll: It did get a bit simpler with pg 9.6 though. Consider the update. Commented Jun 9, 2017 at 2:39