News for hackers. Stuff that matters.
Re:PostgreSQL Schema Design by ComputerGuru on Sunday March 29, 2020 @02:37PM (#22721366)
It is perfectly fine to have a one-to-one mapping between schema and database, thereby treating them as interchangeable. So far as I know, by convention the schema will be the “database name” and the database name would just be “public”.
Re:PostgreSQL Schema Design by edoceo on Sunday March 29, 2020 @03:19PM (#22721779)
You have it backwards. Database is named "foo" and the default schema in PG is called "public". PG uses a schema search path. When you select from table you're really selecting from public.table. Cross schema queries like SELECT public.client.id, billing.ledger.amount FROM public.client JOIN billing.leger ON ....
Re:PostgreSQL Schema Design by ComputerGuru on Sunday March 29, 2020 @04:38PM (#22722494)
Sorry, yes. Thanks for the correction!