Number of Reversed Inode

0x0 what is inode From https://en.wikipedia.org/wiki/Inode The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object’s data From https://www.redhat.com/sysadmin/inodes-linux-filesystem By definition, an inode is an index node. It serves as a unique identifier for a specific piece of metadata on a given filesystem. Each piece of metadata describes what we think of as a file....

August 3, 2024 · 2 min · Theme PaperMod

Build PostgreSQL From Source

Download through git See official docs for detail. Below is a simple example: export user=dev export src_dir=postgresql export build_dir=/home/${user}/build export data_dir=/home/${user}/data export superuser=postgres export defaultdb=test ${build_dir}/bin/pg_ctl -D ${data_dir} stop rm -rf ${build_dir} rm -rf ${data} cd ~ #start from home/${user} git clone https://git.postgresql.org/git/postgresql.git cd ${src_dir} git clean -xdf # may be too dangerous # delete for add some configures accordingly ./configure \ --prefix=${build_dir} \ --enable-cassert \ --with-tcl \ --with-perl \ --with-python \ --enable-debug \ --without-icu \ --with-openssl \ CC=/usr/bin/gcc \ CFLAGS='-O0 -pipe -Wall -g3' make -j8 && make install make -C contrib install ${build_dir}/bin/initdb --username=${superuser} --pgdata=${data_dir} ${build_dir}/bin/pg_ctl -D ${data_dir} -l ${data_dir}/logfile start ${build_dir}/bin/psql -U${superuser} postgres -c "create database ${defaultdb};" echo "----------------- all finished -----------------------" echo "use ************** " echo "[ ${build_dir}/bin/psql -U${superuser} ${defaultdb} ] " echo "to connect postgresql" cd ....

April 16, 2024 · 1 min · Theme PaperMod

Column Schema Change

In PostgreSQL, the adding and dropping a column is an instant ddl(This name seems only to be used in mysql, but I like it). In this article, I try to explain the implement of that. The reference: https://www.postgresql.org/docs/current/sql-altertable.html Basic Concepts instant ddl For a table with $n$ tuples, if a ddl post can be performed in time $O(1)$ ,we call this ddl instant. So to implement an instant ddl, the data organization must remain unchanged....

April 7, 2024 · 1 min · Theme PaperMod

SSL in PG

Overview In application level, ”PostgreSQL“ has native supports for using SSL connections. This requires that OpenSSL is installed on both client and server systems and that support in PostgreSQL is enabled at build time. With SSL, we can: Encrypted data on Internet transmission Allow client to authorize the server(PostgreSQL), which can protect the client from connecting to the attacker’s server Allow server to authorize the client, which can stop the attacker from connecting to the database even if password leak....

February 12, 2024 · 3 min · Theme PaperMod

pg_squeence_type

sequence type background From official documents: 9.17. Sequence Manipulation Functions CREATE SEQUENCE Sequence objects are special single-row tables created with CREATE SEQUENCE. Sequence objects are commonly used to generate unique identifiers for rows of a table. The sequence functions, provide simple, multiuser-safe methods for obtaining successive sequence values from sequence objects. Main function There is no much concerns about these functions nextval Advances the sequence object to its next value and returns that value setval...

February 12, 2024 · 2 min · Theme PaperMod