Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Jan Wieck
On Sat, Dec 30, 2017 at 10:27 AM, Stephen Frost wrote: > > The checksums included in PG are page-level and therefore there simply > isn't one to look at if the file is zero bytes. > And even if the file wasn't zero bytes you can't tell from the per page CRCs if you have all the pages you should

Re: Sv: Re: Sv: Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Stephen Frost
Greetings Andreas, * Andreas Joseph Krogh (andr...@visena.com) wrote: > Here's a simple test-case: >   > createdb test > test=# create table foo(id serial primary key, name varchar not null); > test=# CREATE TYPE BigIntTuple2 AS (f1 bigint, f2 bigint); Hah, appears we allocate a relfilenode to ty

Sv: Re: Sv: Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Andreas Joseph Krogh
På søndag 31. desember 2017 kl. 00:49:31, skrev Stephen Frost < sfr...@snowman.net >: * Andreas Joseph Krogh (andr...@visena.com) wrote: >  SELECT >    quote_ident(nsp.nspname) || '.' || quote_ident(c.relname), >    s.setting || '/base/' || db.oid || '/' || c.relfileno

RE: Change column type macaddr to macaddr[]

2017-12-30 Thread Ertan Küçükoğlu
>From: David G. Johnston [mailto:david.g.johns...@gmail.com] >Sent: Sunday, December 31, 2017 2:56 AM >To: Ertan Küçükoğlu >Cc: pgsql-gene...@postgresql.org >Subject: Re: Change column type macaddr to macaddr[] > >Maybe try: > >Using array[mac]::macaddr[] > >David J. Yes, that did the job. Tha

Re: Change column type macaddr to macaddr[]

2017-12-30 Thread David G. Johnston
On Saturday, December 30, 2017, Ertan Küçükoğlu wrote: > Hello, > > I am using PostgreSQL 9.6.6 on armv8l-unknown-linux-gnueabihf, compiled by > gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516, 32-bit > > I have a table with column name mac type macaddr. I need to change it into > array of macaddr (

Change column type macaddr to macaddr[]

2017-12-30 Thread Ertan Küçükoğlu
Hello, I am using PostgreSQL 9.6.6 on armv8l-unknown-linux-gnueabihf, compiled by gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516, 32-bit I have a table with column name mac type macaddr. I need to change it into array of macaddr ( macaddr[] ) type. Among all others I did try below: licenses=# alter

Re: Sv: Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Stephen Frost
* Andreas Joseph Krogh (andr...@visena.com) wrote: > SELECT >   quote_ident(nsp.nspname) || '.' || quote_ident(c.relname), >   s.setting || '/base/' || db.oid || '/' || c.relfilenode, >   (pg_stat_file(s.setting || '/base/' || db.oid || '/' || > c.relfilenode)).size as size > FROM >   pg_set

Sv: Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Andreas Joseph Krogh
På lørdag 30. desember 2017 kl. 23:06:52, skrev Stephen Frost < sfr...@snowman.net >: Greetings, * Melvin Davidson (melvin6...@gmail.com) wrote: > My query works as designed and has done so > for two years. It shows the filenames for schemas and tables in the > datab

Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Stephen Frost
Greetings, * Melvin Davidson (melvin6...@gmail.com) wrote: > My query works as designed and has done so > for two years. It shows the filenames for schemas and tables in the > database. I'm glad to hear that it works in your specific use-case. Unfortunately, it doesn't work in the general case an

Re: Adding an extra boolean column to "information_schema.columns" or "pg_attribute"

2017-12-30 Thread GPT
I do not have any intention to persuade anyone. The time runs faster than any committee! My question was very clear because I do not know the Pg's internal and I would like to zero the side (fatal) (if any) effect. So please, if you really know, tell me if there will be any problem in case I defi

Re: Adding an extra boolean column to "information_schema.columns" or "pg_attribute"

2017-12-30 Thread GPT
Future is always administerable especially when there are not problems in the present! The reasons I am not in favour of it: 1) Writing for second time the column names is a "repeat yourself" (that makes me really sick!), 2) The possibility of adding attributes into columns is a good feature (at

Re: Adding an extra boolean column to "information_schema.columns" or "pg_attribute"

2017-12-30 Thread Tom Lane
GPT writes: > I would like to add an extra boolean attribute to table columns, The contents of the information_schema views are specified by the SQL standard (ISO 9075). Since the entire point of having those views is to have a standard-conformant way of accessing the information in the system c

Re: Adding an extra boolean column to "information_schema.columns" or "pg_attribute"

2017-12-30 Thread PT
On Sat, 30 Dec 2017 20:33:28 +0100 GPT wrote: > Please visit the following link: > > https://stackoverflow.com/q/48028501/8895614 > > but thing may go further/deeper than it seems. Adding columns to a built-in system table is liable to cause all sorts of problems in the future: when you upgrad

Re: Adding an extra boolean column to "information_schema.columns" or "pg_attribute"

2017-12-30 Thread GPT
Please visit the following link: https://stackoverflow.com/q/48028501/8895614 but thing may go further/deeper than it seems. Krds On 12/30/17, Karsten Hilbert wrote: > On Sat, Dec 30, 2017 at 08:17:34PM +0100, GPT wrote: > >> I would like to add an extra boolean attribute to table columns, >>

Re: Adding an extra boolean column to "information_schema.columns" or "pg_attribute"

2017-12-30 Thread Karsten Hilbert
On Sat, Dec 30, 2017 at 08:17:34PM +0100, GPT wrote: > I would like to add an extra boolean attribute to table columns, > something like NULL. Unfortunately Pg does not support such a feature: > > ADD ATTRIBUTE TYPE TO COLUMN > ; ... > I have already been suggested to use VIEW or dynamic SQL bu

Adding an extra boolean column to "information_schema.columns" or "pg_attribute"

2017-12-30 Thread GPT
I would like to add an extra boolean attribute to table columns, something like NULL. Unfortunately Pg does not support such a feature: ADD ATTRIBUTE TYPE TO COLUMN ; For example: ADD ATTRIBUTE is_displayed TYPE boolean TO COLUMN world.human.feature; so that I can write: SELECT column_name F

Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Melvin Davidson
On Sat, Dec 30, 2017 at 10:27 AM, Stephen Frost wrote: > Greetings Alban, > > * Alban Hertroys (haram...@gmail.com) wrote: > > In fact, I don't see it mentioned explicitly anywhere, but are we > actually looking at a problem? > > From the discussion in the google barman group, it's clear that the

Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Stephen Frost
Greetings Alban, * Alban Hertroys (haram...@gmail.com) wrote: > In fact, I don't see it mentioned explicitly anywhere, but are we actually > looking at a problem? From the discussion in the google barman group, it's clear that the file shouldn't be zero bytes in this specific case. > I'm not co

Re: Does PostgreSQL check database integrity at startup?

2017-12-30 Thread Alban Hertroys
> On 30 Dec 2017, at 6:09, Jan Wieck wrote: > > This whole discussion left out the critical point of > > how on earth did that file end up having zero bytes? > > There is the possibility that this is due to a bug in PostgreSQL. But over > the 20+ years I've been using and hacking it, that ha