Thread: [GENERAL] database folder name and tables filenames

[GENERAL] database folder name and tables filenames

From
Mimiko
Date:
Hello.

Is there a way to change postgres behavior to name database folders by the database name? And table files in them by
table'sname? And not using OIDs. 


Re: [GENERAL] database folder name and tables filenames

From
Adrian Klaver
Date:
On 02/14/2017 07:19 AM, Mimiko wrote:
> Hello.
>
> Is there a way to change postgres behavior to name database folders by
> the database name? And table files in them by table's name? And not
> using OIDs.

No.

Is there a particular problem you are trying to solve?


>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: [GENERAL] database folder name and tables filenames

From
Tom Lane
Date:
Mimiko <vbvbrj@gmail.com> writes:
> Is there a way to change postgres behavior to name database folders by the database name? And table files in them by
table'sname? And not using OIDs. 

It used to work like that, decades ago, and it caused enormous problems
during table/database renames.  We're not going back.

            regards, tom lane


Re: [GENERAL] database folder name and tables filenames

From
Adrian Klaver
Date:
On 02/14/2017 07:19 AM, Mimiko wrote:
> Hello.
>
> Is there a way to change postgres behavior to name database folders by
> the database name? And table files in them by table's name? And not
> using OIDs.

For more information see:

https://www.postgresql.org/docs/9.6/static/storage-file-layout.html

>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: [GENERAL] database folder name and tables filenames

From
Mimiko
Date:
On 14.02.2017 17:30, Adrian Klaver wrote:
>> Is there a way to change postgres behavior to name database folders by
>> the database name? And table files in them by table's name? And not
>> using OIDs.
>
> No.
>
> Is there a particular problem you are trying to solve?

No, there is not a problem. Its a convenience to visually view databases and tables with theirs name and know what the
sizethey occupy with using  
queries of pg_catalog, like there is in mysql.


On 14.02.2017 17:34, Tom Lane wrote:
 > It used to work like that, decades ago, and it caused enormous problems
 > during table/database renames.  We're not going back.

So this is the culprit. Isn't there any option to use names? Even when compiling?


--
Mimiko desu.


Re: [GENERAL] database folder name and tables filenames

From
Pavel Stehule
Date:


2017-02-14 18:47 GMT+01:00 Mimiko <vbvbrj@gmail.com>:
On 14.02.2017 17:30, Adrian Klaver wrote:
Is there a way to change postgres behavior to name database folders by
the database name? And table files in them by table's name? And not
using OIDs.

No.

Is there a particular problem you are trying to solve?

No, there is not a problem. Its a convenience to visually view databases and tables with theirs name and know what the size they occupy with using queries of pg_catalog, like there is in mysql.

There are a databases where you can see only one file or few files without any relation to tables.
 



On 14.02.2017 17:34, Tom Lane wrote:
> It used to work like that, decades ago, and it caused enormous problems
> during table/database renames.  We're not going back.

So this is the culprit. Isn't there any option to use names? Even when compiling?

It is not possible.

Regards

Pavel



--
Mimiko desu.



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] database folder name and tables filenames

From
Tom Lane
Date:
Mimiko <vbvbrj@gmail.com> writes:
> On 14.02.2017 17:30, Adrian Klaver wrote:
>> Is there a particular problem you are trying to solve?

> No, there is not a problem. Its a convenience to visually view databases and tables with theirs name and know what
thesize they occupy with using  
> queries of pg_catalog, like there is in mysql.

Don't really see why you need the underlying files to be named differently
for that purpose.  Typically people write something like
    select relname, pg_relation_size(oid) from pg_class where ...

If you really want to do it from outside the database, the
contrib/oid2name program might help you.

            regards, tom lane


Re: [GENERAL] database folder name and tables filenames

From
Adrian Klaver
Date:
On 02/14/2017 09:47 AM, Mimiko wrote:
> On 14.02.2017 17:30, Adrian Klaver wrote:
>>> Is there a way to change postgres behavior to name database folders by
>>> the database name? And table files in them by table's name? And not
>>> using OIDs.
>>
>> No.
>>
>> Is there a particular problem you are trying to solve?
>
> No, there is not a problem. Its a convenience to visually view databases
> and tables with theirs name and know what the size they occupy with
> using queries of pg_catalog, like there is in mysql.

Take look at:

https://www.postgresql.org/docs/9.6/static/functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT

So as example:

test=# select pg_size_pretty(pg_database_size('test'));
 pg_size_pretty
----------------
 8464 kB
(1 row)


>
>
> On 14.02.2017 17:34, Tom Lane wrote:
>> It used to work like that, decades ago, and it caused enormous problems
>> during table/database renames.  We're not going back.
>
> So this is the culprit. Isn't there any option to use names? Even when
> compiling?
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com