Problem I have the following table in a PostgreSQL database: creator uuid not null, post uuid not null, type text […]
Tag: postgresql
DRYing two very similar SQL conditional inserts
Problem I have two very similar SQL statements INSERT INTO user_profile (user_id, setting_id, value) SELECT id, 18, true FROM users […]
Modelling user preference system with categories
Problem I am modelling a user preference system with the following requirements a user can have attributes (foods they eat) […]
Count buffered streets that intersect buffered points using PostGIS
Problem PostgreSQL 9.5.1 with PostGIS 2.0 extension This first section creates an intersection (clip) of the streets from another polygon […]
PostgreSQL simple query with repeated function calls
Problem I have PostgreSQL 9.1.1 running in a shared hosting environment and I’m running this query: SELECT a.id, CASE WHEN […]
Generic method for database calls
Problem Background Breaking from MVC, I’ve implemented the following architecture: POST/GET ➤ PHP ➤ Database Calls ➤ XML ➤ XSLT […]
Cross-language constants
Problem I’m developing a web application that leverages multiple programming languages. The data flow resembles: Browser » PHP » PL/SQL […]
Optimize postgres function
Problem This function code works very slowly. How can I speed it up? CREATE OR REPLACE FUNCTION bill.”ReportIngredients”( _from date, […]
Creating a join table entry by looking up name
Problem I wrote a stored procedure that allows a join entity to be created by name for my fictional characters […]
Insert data to PostgreSQL
Problem Im inserting data to a PostgreSQL database using the below function. Im not very happy with the solution for […]