In postgresql, what's the difference a “database” and a “relation”? ('error relation x does not exist', 'error database x already exists')

前端 未结 2 2031
轻奢々
轻奢々 2020-12-29 08:21

I see the juxtaposition of these two errors and, given the dearth of Google search results, had to ask. What is the difference and what do I need to be doing here?



        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 08:47

    a relation is a table (or something that looks like one, eg a view), that is, it is a collection of rows, all with the same fields, and given some name to reference them by.

    A database is a collection of relations and other entities (like triggers, functions and rules) that are kept together in some logical grouping.

提交回复
热议问题