フィードアグリゲーター

Luca Ferrari: PL/Proxy on PostgreSQL 12 ?

planet postgresql - 2019-08-27(火) 09:00:00

I spent some more time on the PL/Proxy code base in order to make it compiling against upcoming PostgreSQL 12.

PL/Proxy on PostgreSQL 12 ?

In my yesterday blog post I reported some stupid thougth about compiling PL/Proxy against PostgreSQL 12.
I was too stupid to hit the removal of HeapTupleGetOid (as of commit 578b229718e8f15fa779e20f086c4b6bb3776106 ), and after having read the commit comment with more accuracy, I found how to fix the code (at least I hope so!).

Essentially, wherever I found usage of HeapTupleGetOid I placed a preprocessor macro to extract the Form_pg_ structure and use the normal column oid instead, something like:

#if PG_VERSION_NUM < 12000 Oid namespaceId = HeapTupleGetOid(tup); #else Form_pg_namespace form = (Form_pg_namespace) GETSTRUCT(tup); Oid namespaceId = form->oid; #endif


I strongly advise to not use this in production, at least until someone of the PL/Proxy authors have a look at the code! However the tests pass on PostgreSQL 12beta2 on Linux.

You can find the pull request that also includes my previous pull request to make PL/Proxy work against PostgreSQL11 and FreeBSD.
I hope it can help pushing a new release of this tool.

カテゴリー: postgresql

Webslesson: Developed To-Do List in PHP using Ajax

phpdeveloper.org - 2019-08-27(火) 06:30:02

Developed To-Do List in PHP using Ajax - 1Developed To-Do List in PHP using Ajax - 2Developed To-Do List in PHP using Ajax - 3This one more post on making single page application using PHP PDO with Ajax. Here we will make a simple but very useful Ajax based To-do List Application using PHP, jQuery, ...

カテゴリー: php

php|architect: Symfony 4, Legacy Code, the Future of PHP, and Karl Hughes

phpdeveloper.org - 2019-08-27(火) 04:00:02

In Episode 23 Eric, John, and Oscar go through the August 2019 issue. Topics Getting started with Symfony 4 Managing legacy codebases PHP++ and the future of PHP Karl Hughes talks about running the Chicago PHP User Group. Writing better object-oriented code The post Symfony 4, Legacy Code, t...

カテゴリー: php

PHP &ndash; Code Wall: PHP Date & Strtotime Cheat Sheet with PDF

phpdeveloper.org - 2019-08-27(火) 02:00:02

If you’ve been developing some projects that are data-rich like me, you will of seen yourself using the Date function and the Date function mixed with strtotime, Date &amp; strtotime are very powerful tools, enabling you to set date criteria very swiftly, no matter the scenario. It’s ...

カテゴリー: php

Luca Ferrari: PL/Proxy on PostgreSQL 11 and FreeBSD 12

planet postgresql - 2019-08-26(月) 09:00:00

PL/Proxy is a procedural language implementation that makes really easy to do database proxying, and sharding as a consequence. Unluckily getting it to run on PostgreSQL 11 and FreeBSD 12 is not for free.

PL/Proxy on PostgreSQL 11 and FreeBSD 12

PL/Proxy is a project that allows database proxying, that is a way to connect to remote databases, and as a consequence allows for /sharding/ implementations.
The idea behind PL/Proxy is as simple as elegant: define a minimalistic language to access remote (database) objects and, more in particular, execute queries.

Unluckily, the latest stable release of PL/Proxy is 2.8 and is dated October 2017, that means PostgreSQL 10! There are a couple of Pull Requests to make it working against PostgreSQL 11, but hey have not been merged and the project code seems in pause.

Today I created a cumulative pull request that does a little adjustments to allow the compilation on FreeBSD 12 against PostgreSQL 11.

My pull request is inspired and borrows changes from other two pull requests:

  • pr-31 and credits to Laurenz Albe;
  • pr-33 that has been merged into mine, and credits to Christoph Berg.
    Then I added a compiler flag to adjust headers on FreeBSD 12, as well as dropped an old Bison syntax since this should be safe enough on modern PostgreSQL (at least 9.6 and higher. Some bit here and there to make all tests to pass against PostgreSQL 11, and everything seems right now.
    **It is important to warn that my version is not production ready because it should be reviewed by at least one PL/Proxy developer
    .
And what about PostgreSQL 12?

Well,...

カテゴリー: postgresql

Pavel Stehule: Vertical (column) cursor in pspg

planet postgresql - 2019-08-25(日) 02:57:00
Today I released new version of pspg. There is only one change - vertical cursor support (press Alt-v). This feature can helps orientation in some larger tables now. I would to use vertical cursor for resorting rows (by cursor column) support in next version.



カテゴリー: postgresql

Akra's DevNotes: A first look at Slim 4

phpdeveloper.org - 2019-08-24(土) 05:30:01

With Slim 4 we have continued the tradition of allowing you to use the framework in the way that best fits you and your project. You can create a Slim application entirely in a single file suitable for prototyping through to a few files for a simple web hook or serverless action all the way to fully...

カテゴリー: php

Laravel News: New Email Validation Rule Options in Laravel 5.8.33

phpdeveloper.org - 2019-08-24(土) 02:30:02
The Laravel team released v5.8.33 this week with new capabilities added to the email validation rule, along with the latest changes and fixes for the Laravel v5.8 release. The post New Email Validation Rule Options in Laravel 5.8.33 appeared first...
カテゴリー: php

Johann Oskarsson: Loading a Huge Textfile into PostgreSQL 11 on Windows 10

planet postgresql - 2019-08-24(土) 00:41:47

On Windows and as of 11.5, PostgreSQL has a bug when trying to copy from a huge file. According to stack overflow, this does not manifest on earlier releases like PostgreSQL 10.

For example, given a table

create table pwned( passwd sha1 not null, count int4 not null );

and when trying to copy from the pwned password list which is about 24GB uncompressed,

copy pwned( passwd, count ) from 'c:\src\postgres\pwned\pwned-passwords-sha1-ordered-by-hash-v5.txt' with ( format text, delimiter ':' );

fails and the message follows.

ERROR: could not stat file "c:\src\postgres\pwned\pwned-passwords-sha1-ordered-by-hash-v5.txt": Unknown error

To work around this, we can pipe the file through a command;

copy pwned( passwd, count ) from program 'cmd /c "type c:\src\postgres\pwned\pwned-passwords-sha1-ordered-by-hash-v5.txt"' with ( format text, delimiter ':' );

which results in

COPY 555278657

and we can happily create an index and query the table.

The trick here is that we run cmd in sigle command mode with the /c flag, and tell it to type out the file we want to copy from.

Bug Report

Unfortunately, I am unsure how to report a bug related exclusively to Windows builds, so I have not tried to report the bug through appropriate channels.

Contact

The author can be reached at johann@myrkraverk.com.

カテゴリー: postgresql

Hans-Juergen Schoenig: PostgreSQL Row Level Security, views and a lot of magic

planet postgresql - 2019-08-23(金) 21:00:22

Row Level Security (RLS) is one of the key features in PostgreSQL. It can be used to dramatically improve security and help to protect data in all cases. However, there are a couple of corner cases which most people are not aware of. So if you are running PostgreSQL and you happen to use RLS in a high-security environment, this might be the most important piece of text about database security you have ever read.

Row-Level-Security in PostgreSQL: Corner cases

To prepare for my examples let me create some simple data first. The following code is executed as superuser:

CREATE USER bob NOSUPERUSER; CREATE USER alice NOSUPERUSER; CREATE TABLE t_service (service_type text, service text); INSERT INTO t_service VALUES ('open_source', 'PostgreSQL consulting'), ('open_source', 'PostgreSQL training'), ('open_source', 'PostgreSQL 24x7 support'), ('closed_source', 'Oracle tuning'), ('closed_source', 'Oracle license management'), ('closed_source', 'IBM DB2 training'); GRANT ALL ON SCHEMA PUBLIC TO bob, alice; GRANT ALL ON TABLE t_service TO bob, alice;

For the sake of simplicity there are only three users: postgres, bob, and alice. The t_service table contains six different services. Some are related to PostgreSQL and some to Oracle. The goal is to ensure that bob is only allowed to see Open Source stuff while alice is mostly an Oracle girl.

While hacking up the example, we want to see who we are and which chunks of code are executed as which user at all times. Therefore I have written a simple debug function which just throws out a message and returns true:

CREATE FUNCTION debug_me(text) RETURNS boolean AS $$ BEGIN RAISE NOTICE 'called as session_user=%, current_user=% for "%" ', session_user, current_user, $1; RETURN true; END; $$ LANGUAGE 'plpgsql'; GRANT ALL ON FUNCTION debug_me TO bob, alice;

Now that the infrastructure is in place, RLS can be enabled for this table:

ALTER TABLE t_service ENABLE ROW LEVEL SECU[...]
カテゴリー: postgresql

Webslesson: Laravel 5.8 Tutorial - Datatables Individual Column Searching using Ajax

phpdeveloper.org - 2019-08-23(金) 06:30:02

This is one more post on Laravel 5.8 with Datatables and in this post we will cover How can we implement Laravel Datatables Individual Column Searching using Ajax. In some of our previous post, we have already covered topic like how to add custom search filter in Laravel Datatables and How to make D...

カテゴリー: php

PHP: Hypertext Preprocessor: PHP 7.4.0beta4 released!

phpdeveloper.org - 2019-08-23(金) 05:00:02

The PHP team is glad to announce the third and last beta release of PHP 7.4: PHP 7.4.0beta4. This continues the PHP 7.4 release cycle, the rough outline of which is specified in the PHP Wiki. For source downloads of PHP 7.4.0beta4 please visit the download page. Please carefully test this version an...

カテゴリー: php

Kristi Anderson: Managing High Availability in PostgreSQL – Part III: Patroni

planet postgresql - 2019-08-23(金) 01:34:27

In our previous blog posts, we discussed the capabilities and functioning of PostgreSQL Automatic Failover (PAF) by Cluster Labs and Replication Manager (repmgr) by 2ndQuadrant. In the final post of this series, we will review the last solution, Patroni by Zalando, and compare all three at the end so you can determine which high availability framework is best for your PostgreSQL hosting deployment.

Patroni for PostgreSQL

Patroni originated as a fork of Governor, a project from Compose. It is an open-source tool suite, written in Python, for managing high availability of PostgreSQL clusters. Instead of building its own consistency protocol, Patroni smartly leverages the consistency model provided by a Distributed Configuration Store (DCS). It also supports other DCS solutions like Zookeeper, etcd, Consul and Kubernetes.

Patroni ensures the end-to-end setup of PostgreSQL HA clusters, including streaming replication. It supports various ways for creating a standby node, and works like a template that can be customized to your needs.

This feature-rich tool exposes its functionality via REST APIs and also via a command line utility called patronictl. It supports integration with HAProxy by using its health check APIs to handle load balancing.

Patroni also supports event notification with the help of callbacks, which are scripts triggered by certain actions. It enables users to perform any maintenance actions by providing pause/resume functionality. The Watchdog support feature makes the framework even more robust.

How it Works

Initially, PostgreSQL and Patroni binaries needs to be installed. Once this is done, you will also need to setup a HA DCS configuration. All the necessary configurations to bootstrap the cluster needs to be specified in the yaml configuration file and Patroni will use this file for initializat

[...]
カテゴリー: postgresql

Laravel News: Talks and Photos from Laracon US 2019

phpdeveloper.org - 2019-08-23(金) 01:30:01
Some Laracon US 2019 videos are now available on YouTube for your viewing pleasure (seriously, these are some fantastic talks). Along with videos, the community now has access to thousands of photos of the event as well! The post Talks and Photos ...
カテゴリー: php

PHP 7.4.0beta4 released!

php.net - 2019-08-22(木) 23:51:16
カテゴリー: php

Shawn Wang: The performance test on the AES modes

planet postgresql - 2019-08-22(木) 21:20:25

After introducing the difference between the AES modes, in this document, I will put the results about the AES modes performance.
The following tests just use one core CPU.

AES-NI:The Advanced Encryption Standard Instruction Set (or Intel Advanced Encryption Standard New Instructions, AES-NI for short) is an extension of the x86 instruction set architecture for Intel and AMD microprocessors, presented by Intel in March 2008. [1] The purpose of this instruction set is to improve the speed at which applications use the Advanced Encryption Standard (AES) to perform encryption and decryption.

OpenSSL: OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. There is much Standard encryption algorithm in OpenSSL. We will use OpenSSL to test the AES modes performance.

How to get the performance resultsYou can refer to the official document:https://www.openssl.org/docs/manmaster/man1/speed.html.

Here we will use the following command to do the performance test.
With AES-NI enabled:
openssl speed -elapsed -evp aes-128-cbc
With disabled AES-NI
OPENSSL_ia32cap=”~0x200000200000000″ openssl speed -elapsed -evp aes-128-cbc

Performance test server configuration
  • CPU : i5 8400 (has the AES-NI)
  • Memory : 16G DDR4
  • Disk : Inter SSD 1T
  • OS : CentOS Linux release 7.6.1810 (Core)
  • OpenSSL :  OpenSSL 1.0.2k

The tests for each input data size was performed for 3 seconds, for the ciphers that we were interested in.

Five modes with 128-bits key, AES-NI enabled and disabled, encryption(the first row means OpenSSL will use ase-ecb with 128-bits key to encrypted 1371968.28k data in 3 seconds):

mode AES-NI enabled 16 bytes 64 bytes 256 bytes [...]
カテゴリー: postgresql

第 164 回理事会議事録 (2019-8)

www.postgresql.jp news - 2019-08-22(木) 19:15:53
第 164 回理事会議事録 (2019-8) anzai 2019/08/22 (木) - 19:15
カテゴリー: postgresql

ページ