Introducing Crunchy Data Warehouse: A next-generation Postgres-native data warehouse. Crunchy Data Warehouse Learn more

  • Using the Postgres bytea Type with Django

    Kat Batuigas

    I'm not someone who spends a lot of time or energy on digital images and photography. I'm usually set with my phone's camera app and maybe applying a filter as I upload to Instagram. But when you work at a database company like Crunchy Data , anything in your life can inspire a demo application. How about a simple image upload app built with Django 3.1 and backed by PostgreSQL 13 , that takes advantage of the PL/Python procedural language for processing? You may have seen some of our DevR...

    Read More
  • 8 min read

    Using PL/pgSQL to Calculate New Postgres Columns

    Steve Pousty

    In our last blog post on using Postgres for statistics , I covered some of the decisions on how to handle calculated columns in PostgreSQL . I chose to go with adding extra columns to the same table and inserting the calculated values into these new columns. Today’s post is going to cover how to implement this solution using PL/pgSQL . I bet your first question is going to be: Why did you choose to do this in PL/pgSQL rather than just some quick editor work? I actually started with handcrafti...

    Read More
  • 4 min read

    Waiting for PostGIS 3.1: GEOS 3.9

    Paul Ramsey

    While we talk about " PostGIS " like it's one thing, it's actually the collection of a number of specialized geospatial libraries, along with a bunch of code of its own. • PostGIS provides core functionality bindings to PostgreSQL, the types and indexes format reading and writing basic algorithms like distance and area performance tricks like caching simple geometry manipulations (add a point, dump rings, etc) algorithms that don't exist in the other libraries • bindings to PostgreSQL, the type...

    Read More
  • 7 min read

    Replacing Lines of Code with 2 Little Regexs in Postgres

    Steve Pousty

    Greetings readers, today we're going to take a semi-break from my “doing data science in SQL ” series to cover a really cool use case I just solved with regular expressions ( regex ) in Postgres . For those of you who have a bad taste in your mouth from earlier run-ins with regexs, this will be more use case focused and I will do my best to explain the search patterns I used. If you've never heard of regex, there are good resources to learn more about them but I will not be giving a t...

    Read More
  • 7 min read

    PostGIS Day 2020 Roundup

    Kat Batuigas

    Crunchy Data's second annual PostGIS Day took place a couple weeks ago on November 19th, and as a first-time attendee I was blown away by the knowledge-sharing and sense of community that I saw, even as I was tuning in remotely from my computer at home. This year's PostGIS Day was virtual, which allowed even more attendees from all over the world to participate. The talks had a live Q&A section and we set up a Discord server so attendees and speakers could all interact freely with each other....

    Read More
  • 8 min read

    Using Postgres for Statistics: Centering and Standardizing Data

    Steve Pousty

    In the last two blog posts on data science in Postgres, we got our data ready for regression analysis and had predictive variables that are on wildly different scales. Another example of data on different scales would be annual income versus age. The former is usually at least tens of thousands while age rarely gets to a hundred. If you do the regression with non-transformed variables, it becomes hard to compare the effect of the different variables. Statisticians account for this by convertin...

    Read More
  • 8 min read

    Postgres: The batteries included database

    Craig Kerstiens

    At most of the places I've worked, the primary language used was not what I gravitated to naturally. If you're going to ask for a language of choice personally, it's python. I appreciate the explicit nature, that it's often pseudocode that can execute and it has a rich ecosystem of libraries (though that’s most languages these days). But as much as anything I latched onto Django in its early days. If you're not familiar with Django it's a popular framework for web apps written in Python. What...

    Read More
  • 2 min read

    Waiting for PostGIS 3.1: Grid Generators

    Paul Ramsey

    Summarizing data against a fixed grid is a common way of preparing data for analysis. Fixed grids have some advantages over natural and administrative boundaries: • No appeal to higher authorities • Equal unit areas • Equal distances between cells • Good for passing data from the "spatial" computational realm to a "non-spatial" realm No appeal to higher authorities Equal unit areas Equal distances between cells Good for passing data from the "spatial" computational realm to a "non-spatial" realm...

    Read More
  • PostgreSQL Benchmarks: Apple ARM M1 MacBook Pro 2020

    Greg Smith

    This week Apple started delivering Macs using their own Apple Silicon chips, starting with a Mac SOC named the M1. M1 uses the ARM instruction set and claims some amazing acceleration for media workloads. I wanted to know how it would do running PostgreSQL, an app that's been running on various ARM systems for years. The results are great! The OSS community around the homebrew project already qualified their PostgreSQL package as working on M1, and with some recompiling work that all worked as e...

    Read More
  • 3 min read

    Waiting for PostGIS 3.1: Performance

    Paul Ramsey

    Open source developers sometimes have a hard time figuring out what feature to focus on to generate the greatest value for end users. As a result, they will often default to performance . Performance is the one feature that every user approves of. The software will keep on doing all the same cool stuff, only faster . For PostGIS 3.1, there have been several performance improvements that, taken together, might add up to a large performance gain for your workloads. Spatial joins have slowed down...

    Read More