3
votes
2answers
220 views

Unique constraint with soft deleted rows excluded

We have a table with a unique constraint on it, for feedback left from one user, for another, in relation to a sale. ALTER TABLE feedback ADD CONSTRAINT unique_user_subject_and_sale UNIQUE (user_id, ...
2
votes
2answers
66 views

Disadvantages of table with too many columns

I have some data that I need to put in a PostgreSQL database. These data are related to schools. So there are a LOT of attributes relating to the school, mostly small integers, floats or small texts. ...
0
votes
0answers
62 views

Database scheme with cycle. Right or no? [closed]

Description I am working on a multisite project on Django, this functionality involves Site custom fields and User custom fields, as the usual is done, User must depends on the site, however I have a ...
0
votes
2answers
45 views

How to model database where different users/roles are in a project table, while all of them have to belong to user table?

I am trying to model a database for my current project and I came across a new problem. I have a Project which is supervised by Supervisor, Coordinator and Company. So Project table has Supervisor.id ...
2
votes
2answers
42 views

PostgreSQL partitioning with joined table - partition constraint not used in query plan

I have a large table in PostgreSQL 9.2 that I've partitioned as described in the manual. Well... almost! My real partition key is not in the partitioned table itself, but in a joined table, like this ...
0
votes
2answers
18 views

trigger or calculated columns or update or view

I have two csv files file1.csv and file2.csv I load those files in two tables in a database 'table1' and 'table2'. table1 contains two columns, those columns use table2 columns to calculate ...
0
votes
2answers
79 views

currency exchange database schema [closed]

I'm trying to create a database schema for currency exchange. I want to have information about various currencies every 30 seconds. This is the schema I had in mind. Column SQL ...
1
vote
2answers
49 views

PostgreSQL internals composite column cardinality

EDIT This is not a question about space, but about uniqueness of index, which affects the query plan. In terms of cardinality, which index scenario is higher: A Table: ( Col1 smallint, Col2 ...
0
votes
1answer
76 views

Should I place EAV values in a datatype table?

I am designing a database for entities like stores, products, customers, suppliers and warehouses. The database will be used as an online transactional system in different physical stores. In my case ...
2
votes
3answers
503 views

Get table and column “owning” a sequence

I can run the following line: ALTER SEQUENCE seqName OWNED BY table.id; How can I get the 'owner' set by OWNED BY for a sequence (in this case: table.id)?
1
vote
1answer
37 views

Login system using physical postgres users not “logical” users

I'm currently building an application that has to conform with SOX auditing requirements. One of these, is that all inserts, updates and deletes (but delete you can ignore), need to leave a trail that ...
0
votes
1answer
58 views

Filter 2-dimensional array

I have this array: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0,11:0,12:0,13:0,14:0,15:0,16:0 17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0, ...
1
vote
1answer
69 views

Is it a good idea to use mongodb , inmemory db and postgres together? [closed]

Our application deals with both report and transactions (OLAP and OLTP). The application needs to display the generated report in form of charts and tables. And other part of application deals with ...
2
votes
4answers
74 views

Dynamic input to database

I'm working on an app that lets a user create projects custom to the users needs, the project is basically a form that can be submitted by another user. I want to allow the user to dynamically create ...
0
votes
1answer
524 views

Execute triggers function of another schema on the actual chema

my problem is easy to explain with an example: I have a 'common' schema (the public one?) where I store common data between a clustered application. For every instance of my application, I have a ...

1 2 3 4 5 20
15 30 50 per page