Questions tagged [postgres]
PostgreSQL, A.K.A Postgres, is an open source object-relational database management system (ORDBMS).
152 questions
173
votes
21
answers
164k
views
Stored Procedures a bad practice at one of worlds largest IT software consulting firms?
I'm working at a project in one of the world's top 3 IT consulting firms, and was told by a DBA that company best practice's state stored procedures are not a "best practice". This is so contrary to ...
134
votes
10
answers
72k
views
Storing a re-orderable list in a database
I'm working on a wishlist system, where users can add items to their various wishlists, and I plan to allow users to re-order the items later on. I am not really sure about the best way to go about ...
41
votes
3
answers
48k
views
Is there any reason to use varchar over text columns in a database?
Is varchar just a remnant from before text came around, or are there use cases where you would want to use a varchar? (Or char for that matter..)
(I use Postgres and MySQL (MyISAM) daily, so those ...
19
votes
2
answers
83k
views
How to get real time notifications, when a database change (insert, update, delete) occurs?
I'm creating a dashboard which should monitor a database table. I have only database access (no application layer). The table is rather large (10 million rows), however not changing rapidly (100 ...
14
votes
5
answers
8k
views
How can I efficiently diff a CSV file against a database?
I have an inventory of products stored in Postgres. I need to be able to take a CSV file and get a list of changes—the things in the CSV file that are different to what is in the database. The CSV ...
14
votes
6
answers
5k
views
What are the best practices around retiring obsolete database columns? [closed]
I'm designing an application which will in an early stage collect data A, B, and C from clients, but later on will instead collect data A, B, and D.
A, B, C, and D are very related and right now ...
12
votes
3
answers
6k
views
Storing hours a merchant is open in postgres
In postgres, I need to store the hours a merchant is open each week. Essentially, the information you'd see posted on a sign in the merchant's door:
Mondays: Closed
Tuesday-Friday: 9am-1pm, 2pm-6pm
...
11
votes
9
answers
28k
views
Is there a large bank using Mysql or PostgreSQL? [closed]
I always thought the largest scale of banks use Oracle. However, there is no proof they really use Oracle instead of Mysql or PostgreSQL, nobody knows the secret.
Any idea what they really use? Can ...
10
votes
5
answers
3k
views
Do I really need triggers for relational database, for example, PostgreSQL?
I know that triggers can be used to validate stored data to keep database consistent. However, why not perform validation of data on the application side before storing them into the database?
For ...
8
votes
2
answers
2k
views
Making the switch from MySQL to PostgreSQL?
I've spent the last year becoming really comfortable with MySQL, but due to its increasing trendiness and my desire to homogenize my web-apps with Heroku, I'd like to start using PostgreSQL for my web ...
7
votes
3
answers
573
views
Do common relational database systems work 'out of the box'? [closed]
I'm quite new to software development and whenever I come across small projects which involve storing (relational) data I always ask myself if something like a micro-blog (or any other project with ...
7
votes
4
answers
4k
views
DB Enumerations vs App Enumerations vs Lookup tables
We started a project recently, and during the design process, we have some arguments among team members. We have to deal with enumerations so we ended up with three choices.
Have the enumerations as ...
7
votes
1
answer
10k
views
Best way to store quite large JSON objects?
I'm building an app where I need access to quite large reports about different publicly accessible URLs, JSON objects about 200kb to 500kB in size. Each user would generate hundreds of these reports ...
7
votes
4
answers
12k
views
What is the "correct" way to store functions in a database?
Note: Yes, I know that storing functions in databases should be punishable by law.
We are developing a financial web application using PostgreSQL, Sinatra and AngularJS. As you may have guessed, a ...
7
votes
2
answers
2k
views
Specifying a bi-directional unique constraint on a join table in Postgres [closed]
Problem description
I have a situation where I want to enforce that a relationship can only be defined once and I want to solve it on database (Postgres) level.
The following situation I consider ...