New answers tagged

0 votes

How do I move all tables from one Postgres schema to another

--move all tables from schema 'b' to schema 'a': select 'ALTER TABLE ' || table_name || ' SET SCHEMA b' from information_schema.tables where table_schema = 'a'; run all altered statements set ...
user avatar
2 votes
Accepted

How to implement/architect a SQL database schema which can handle types/tables with many optional properties?

It's a pretty common idea to abstract the database layer, but in doing so you lose a lot of the relational aspect of the database system (which surprise surprise is not a good idea in a Relational ...
user avatar
  • 25.5k
3 votes

How to implement/architect a SQL database schema which can handle types/tables with many optional properties?

In general you resist adding so many attributes to the model, and normalize the model. For each attribute ask 1) is it really necessary to add to your data model, and 2) does it really belong as an ...
user avatar
0 votes

In Postgres 12, how do I set a default schema when logging in using psql?

To formalize the answer given in comments, I logged in as the "postgres" (admin) user and ran ALTER USER myuser SET SEARCH_PATH = 'my_schema';
user avatar
  • 615
1 vote

Multiple tables for many-to-many mappings or one table with multiple columns?

Your list of Pros and Cons need further refinement Table-per-mapping This does not need an id column, you can create a primary key across the other two. Pros Each row has only three two columns, each ...
user avatar
  • 6,419
0 votes

Opinion on my schema

I don't know what you mean by plan in student table. But you could add a bool or varchar column that can handle the case of actual students or potential students. Since you connected student table ...
user avatar
-2 votes

Oracle: Simple way to compare all objects of a schema in two databases?

I found this script on Github which seems to answer your question: oracle_compare_schemas.sql
user avatar
  • 1

Top 50 recent answers are included