Search in xml using xpath in postgresql db

I have a database in Postgresql where I put some documents written in xml. I want to search twrough them using XPath, but my code is not working. The document are like this: <?xml version="1.0" standalone="yes"?> <TEI xmlns="http://www.tei-...
more »

2017-01-13 12:01 (1) Answers

Restricted PostgreSQL permissions for web app

Goal Create a database with three users and restrict their privileges (I'm just thinking out loud, so my user separation is also open to correction): Superuser - this user allows for the very initial provisioning of the database. Create the applic...
more »

2017-01-08 21:01 (1) Answers

Django inspectdb skips tables with constraints

I read a few topics on this, but none really seemed to offer a solution in inspectdb, or an alternative, that permits Django to make models for an existing database where some of the tables have constraints. So I ran python manage.py inspectdb > ...
more »

2017-01-05 05:01 (0) Answers

MySQL vs PostgreSQL JSON search features

I have been searching for a blog post or a feature matrix which compares MySQL and PostgreSQL by their JSON capabilities. I found a good feature matrix for Postgres but not for MySQL. Also there are a bunch posts like this which compare the two but a...
more »

2017-01-03 13:01 (1) Answers

rails : how can I use find_each with map?

I have a form that has nested field (habtm and accepts_nested_attributes_for). That form contains with a field "keywords", that autocompletes keywords that come from a postgresql table. All that works well. This is in params : "acte"=>{"biblio...
more »

2017-01-02 00:01 (1) Answers

Postgres: Advantages of combining columns

Background: I have three columns with the following sizes in bytes (for a total of 8): 4 (int), 2 (small int), 2 (small int). I'm creating a multicolumn (aka composite) index on these three columns (in the order specified above). I will be doing tw...
more »

2017-01-01 09:01 (1) Answers

How to deploy a multi-tenant django app to AWS?

I have an Django+Postgres app that has a multi-tenant structure and I don't have prior experience deploying this type of app to AWS. I have followed the general Elastic Beanstalk tutorial to deploy a simple app. (https://realpython.com/blog/python/de...
more »

2017-01-01 03:01 (1) Answers

Rails 5 SQL Injection

I've read about this for some time now on various SO threads, guides, etc... but all the answers are conflicting and contradictory. It seems there's many similar methods, and a lot of the answers say to use a different one. sanitize sanitize_condi...
more »

2016-12-31 19:12 (1) Answers

Computed id from string as database key

I have a XML-Interface with entries that i need to parse and then insert into a database. The entries have all the required information but i want to normalize the database and therefore try to generate objects from the base information. This is an ...
more »

2016-12-31 16:12 (1) Answers

create postgres database in Heroku deployment

I am trying to deploy an .rb file to heroku using a postgres database. However, after pushing the files to Heroku, and running it, I get an error for the database. My basic problem is that I don't know how to start a postgres database in the .rb fi...
more »

2016-12-30 01:12 (1) Answers

Scalable searching algorithm SQL

So I have a list of users stored in a postgres database and i want to search them by username on my (Java) backend and present a truncated list to the user on the front end (like facebook user search). One could of course, in SQL, use WHERE username...
more »

2016-12-26 00:12 (1) Answers