Re: Plans for partitioning of inheriting tables

2024-11-02 Thread Thiemo Kellner
My bad. I was expecting primary and unique to be mentioned here, so I did not 
read on.


**INCLUDING CONSTRAINTS*** 
**#[https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-PARMS-LIKE-OPT-CONSTRAINTS]*

/*CHECK*// constraints will be copied. No distinction is made between column 
constraints and table constraints. Not-null constraints are always copied to 
the new table./


02.11.2024 00:53:53 Adrian Klaver :

> On 11/1/24 16:10, thi...@gelassene-pferde.biz wrote:
>> Adrian Klaver  escribió:
>> On 11/1/24 13:47, Thiemo Kellner wrote:
 It looks to me basically to be a "create table A as select * from B where 
 false".
>>> 
>>> No it more capable then that.
>> Yes, I wrote basically, not exactly.
>> CREATE TABLE  LIKE  has  like_option which allows 
>> to transfer over more attributes of the table, for example defaults, 
>> constraints, indexes, etc.
>> But, to my understanding, no primary nor unique nor foreign constraint.
>> 
> 
> 
> "INCLUDING INDEXES
> 
>  Indexes, PRIMARY KEY, UNIQUE, and EXCLUDE constraints on the original 
> table will be created on the new table. Names for the new indexes and 
> constraints are chosen according to the default rules, regardless of how the 
> originals were named. (This behavior avoids possible duplicate-name failures 
> for the new indexes.)
> "
> 
> FK's are not in the the INCLUDINGs, nor triggers.
> 
> 
> -- 
> Adrian Klaver
> adrian.kla...@aklaver.com




Re: Random memory related errors on live postgres 14.13 instance on Ubuntu 22.04 LTS

2024-11-02 Thread Ian J Cottee
Dear Vijay

Many thanks for the comprehensive response.

The installed Postgres is just the current standard Ubuntu 22.04 LTS
release. The output of pg_config is below. Since the reboot we've not had
the error again (even though I'm still getting concurrency issues) and
having reached out to Linode they suggested the same as you suggested,
running a memtest86+ check on it which I will do this weekend. As the
previous errors (thankfully) are not showing now I can't really do any more
debugging but I'll report back on the results of the memtest.

Once again, many thanks for your thoughts and help, it is much appreciated.

Best regards

Ian

pg_config output:

BINDIR = /usr/lib/postgresql/14/bin
DOCDIR = /usr/share/doc/postgresql-doc-14
HTMLDIR = /usr/share/doc/postgresql-doc-14
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/14/server
LIBDIR = /usr/lib/x86_64-linux-gnu
PKGLIBDIR = /usr/lib/postgresql/14/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/14/man
SHAREDIR = /usr/share/postgresql/14
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/14/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--build=x86_64-linux-gnu' '--prefix=/usr'
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' '--sysconfdir=/etc'
'--localstatedir=/var' '--disable-option-checki
ng' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu'
'--runstatedir=/run' '--disable-maintainer-mode'
'--disable-dependency-tracking' '--with-tcl' '--with-perl'
'--with-python' '--with-pam' '--with-open
ssl' '--with-libxml' '--with-libxslt'
'--mandir=/usr/share/postgresql/14/man'
'--docdir=/usr/share/doc/postgresql-doc-14'
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/'
'--datadir=/usr/share/postgresql
/14' '--bindir=/usr/lib/postgresql/14/bin'
'--libdir=/usr/lib/x86_64-linux-gnu/'
'--libexecdir=/usr/lib/postgresql/'
'--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu
14.13-0ubuntu0.22.04.1)' '--enab
le-nls' '--enable-thread-safety' '--enable-debug' '--enable-dtrace'
'--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-gssapi'
'--with-ldap' '--with-pgport=5432'
'--with-system-tzdata=/usr/share/zoneinfo' 'AWK=
mawk' 'MKDIR_P=/bin/mkdir -p' 'PROVE=/usr/bin/prove'
'PYTHON=/usr/bin/python3' 'TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet'
'CFLAGS=-g -O2 -flto=auto -ffat-lto-objects -flto=auto
-ffat-lto-objects -fstack-protector-strong
-Wformat -Werror=format-security -fno-omit-frame-pointer'
'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects
-flto=auto -Wl,-z,relro -Wl,-z,now' '--enable-tap-tests' '--with-icu'
'--with-llvm' 'LLVM_CONFIG=/u
sr/bin/llvm-config-14' 'CLANG=/usr/bin/clang-14' '--with-lz4'
'--with-systemd' '--with-selinux' 'build_alias=x86_64-linux-gnu'
'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -flto=auto
-ffat-lto-objects -flt
o=auto -ffat-lto-objects -fstack-protector-strong -Wformat
-Werror=format-security'
CC = gcc
CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
-I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wimplicit-fallthrough=3
-Wcast-function-type -Wformat-security -fno-strict-aliasing
 -fwrapv -fexcess-precision=standard -Wno-format-truncation
-Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects
-flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat
-Werror=format-security -fno-omit
-frame-pointer
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects
-flto=auto -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-14/lib
-Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lselinux -llz4 -lxslt -lxml2 -lpam -lssl
-lcrypto -lgssapi_krb5 -lz -lreadline -lm
VERSION = PostgreSQL 14.13 (Ubuntu 14.13-0ubuntu0.22.04.1)


On Wed, 30 Oct 2024 at 11:39, Vijaykumar Jain <
vijaykumarjain.git...@gmail.com> wrote:

>
>
> On Wed, 30 Oct 2024 at 13:04, Ian J Cottee  wrote:
>
>> Hello everyone, I’ve been using postgres for over 25 years now and never
>> had any major issues which were not caused by my own stupidity. In the last
>> 24 hours however I’ve had a number of issues on one client's server which I
>> assume are a bug in postgres or a possible hardware issue (they are running
>> on a Linode) but I need some clarification and would welcome advice on how
>> to proceed. I will also forward this mail to Linode support to ask them to
>> check for any memory issues they can detect.
>>
>>
>>
>> This particular Postgres is running on Ubuntu LTS 22.04 and has the
>> following version information:
>>
>>
>>
>> ```
>>
>> PostgreSQL 14.13 (Ubuntu 14.13-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu,
>> compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
>>
>> ```
>>
>>
>> The quick summary is that over a 24 hour period I had the following
>> errors appear in the postg