Hubert 'depesz' Lubaczewski: Waiting for PostgreSQL 12 – Generated columns

planet postgresql - 2019-04-18(木) 04:16:03
On 30th of March 2019, Peter Eisentraut committed patch: Generated columns   This is an SQL-standard feature that allows creating columns that are computed from expressions rather than assigned, similar to a view or materialized view but on a column basis.   This implements one kind of generated column: stored (computed on write). Another kind, … Continue reading "Waiting for PostgreSQL 12 – Generated columns"
カテゴリー: postgresql

From Zend Framework To The Laminas Project

planet PHP - 2019-04-18(木) 01:58:00

Ten years ago this month, I was involved in a couple of huge changes for Zend Framework.

First, I helped spearhead integration of the JavaScript library Dojo Toolkit into Zend Framework, and finalized the work that month. I'd worked closely with the two developers who had been leading that project at the time, and one thing that came up during our discussions was that they had helped create an open source foundation for the project, to ensure its continuity and longevity, and to ensure the project can outlive the ups and downs of any commercial company. This idea intrigued me, and has stuck in the back of my mind ever since.

The other thing that happened that month was that I was promoted to Project Lead of Zend Framework. I've held that position ever since.

Today, I get to announce another change: Zend Framework is transitioning to an open source project under the Linux Foundation!

How Zend Framework Becomes Laminas

As I noted, I've been thinking about this for 10 years now, and actually doing research and trying to figure out a way to make it happen for almost two years. When my employer announced some restructuring of the Zend portfolio last fall, moving the project to a foundation was foremost on my mind.

So, imagine my surprise when an old PHP friend, John Mertic, reached out to me and offered the assistance of the Linux Foundation!

I had no idea that this was even a possibility. But, as it turns out, the mission of the foundation is to help create sustainable open source communities, and the primary way they do that is to help create foundations for projects. The beauty is that they take care of the business stuff that developers like myself don't have expertise in: legal issues, taxes, bookkeeping, and even help with things like marketing. They do this so that those of us working on open source projects can focus on our communities and our code. It's an absolutely perfect scenario for the project.

Over the last few months, I've worked with Rogue Wave (my employer) and the Linux Foundation to work out the logistics of this transition, including coming up with some initial budgets, helping flesh out a governance model, and identifying potential founding members. I've also worked with the Zend Framework community review team to come up with a name for the project, and work out some of the technical details for migrating both the project and its users.

So, please say a warm hello to the Laminas Project.

What we announced today is just a beginning. The project is not yet operational. We're still working on tooling for migrating the project and its users, and, more importantly, recruiting more founding members. If your company is interested, please fill out our form, and we'll get back to you to discuss the details.


As a parting note, I need to acknowledge a number of people who helped me through the last few months:

  • My wife, Jen, who has been my chief sounding board, and helped me keep my sanity while I juggle meetings, emails, and growing task lists. Love you!
  • Enrico Zimuel, who has been my co-worker, confidante, and friend for years, and continued to help even when he left Rogue Wave last month. I'm excited for this new chapter!
  • The various folks in the Zend Professional Services team, for letting me bounce ideas off of them and occasionally voice my frustrations. You all know who you are!
  • The entire Zend Framework community review team: Rob, Gary, Marco, Frank, James, Evan, Adam, Aleksei, Andreas, Ben, Geert, Ryan, Michał, Michael, and Mike (yes, those last three are all different people!). In particular, Michał has been putting in crazy hours working on migration tooling, and Frank just this morning sent over changes for the Laminas website for me to incorporate!
  • John Mertic and Michael Dolan of the Linux Foundation for holding my hand through this entire process and helping make it happen. We still have work to do, but even getting this far feels like a huge accomplishment, and I couldn't have done it without your support.

If all goes to plan, I'm hoping we'll be announcing the project is operational in the next few months; keep an eye on the ZF and Laminas websites and twitter handles for updates!

From Zend Framework To The Laminas Project was originally published 17 April 2019 on https://mwop.net by .
カテゴリー: php

The Zend Blog: Zend Framework transitions to the Linux Foundation

phpdeveloper.org - 2019-04-18(木) 00:30:02

Since its inception, Zend Technologies, and later Rogue Wave Software, has been single-handedly leading and sponsoring the Zend Framework project. Over the years, Zend Framework has seen wide adoption across the PHP ecosystem, with an emphasis on the Enterprise market. It has formed the basis of num...

カテゴリー: php

JoliCode blog - les derniers articles: Find Segfaults in PHP like a boss

phpdeveloper.org - 2019-04-18(木) 00:30:02

A bit of history

Sometimes, a segfault happens, but you don't know where, and your PHP installation does not have tools to find it. Or sometime, you think PHP is hanging, but you don't know where. You may use xdebug, but you don't want to click so many times on the "next call" button.

To ad...

カテゴリー: php

Toptal Engineering Blog: Laravel Zero Downtime Deployment

phpdeveloper.org - 2019-04-18(木) 00:30:02

Updating live applications used to be a tedious and somewhat risky affair, but with the emergence of modern development frameworks and tools, updates and deployment are becoming straightforward.

In this article, Toptal Java Developer Elene Latsoshvili explains how you can update a Laravel app wit...

カテゴリー: php

Arkadiusz Kondas Posts: The right way to call assertion in PHPUnit

phpdeveloper.org - 2019-04-18(木) 00:30:02

During the preparation of TDD workshops, I began to think about how to write assertions. It turns out that there are several possibilities, but is there the only correct one?

カテゴリー: php

GeekyBoy.com: Zend Framework becomes Laminas project

phpdeveloper.org - 2019-04-18(木) 00:30:02

Today it was announced that Zend Framework is being rebranded as Laminas project. Along with the rebrand comes some other important changes as well. Yes, this includes Expressive and Apigility, so continue reading.

Some History

Zend Framework is one of the largest and oldest PH...

カテゴリー: php

Zend Framework becomes Laminas project

planet PHP - 2019-04-17(水) 23:16:00

Today it was announced that Zend Framework is being rebranded as Laminas project. (drawn from the meaning “a thin layer”) Along with the rebrand comes some other important changes as well. Yes, this includes Expressive and Apigility, so continue reading.

Some History

Zend Framework is one of the largest and oldest PHP frameworks and has become a staple for enterprise development around the world. As of April 2019, it has over 400 million lifetime downloads of all packages associated with the project, which has seen a 4-fold increase in just the last 2 years alone. Despite this amazing track record, up to now the project has been supported and guided single-handedly by Zend Technologies, and later Rogue Wave Software.

Awesome Changes

Therefore, to continue this growth and receive the best support possible, the Zend Framework team is announcing that all projects under that umbrella will rebrand to a newly formed “Laminas” project“, which aims to continue their mission as an open source project hosted by the Linux Foundation. The transition will enable more companies to provide support for the projects they’ve come to depend on and help it continue to grow. As part of this transition, it is important for them to differentiate the open source project from the Zend commercial brand. Therefore, the new name “Laminas” project was created.

As part of this move, the Expressive microframework, Apigility api framework, as well as the MVC framework will all be part of the Laminas project.

I will try to add more details as they become available to us all, and will likely also do a Twitch stream and YouTube video with Beachcasts once I am able to speak about these changes in a way that makes sense to others.

Support Laminas Project

For more information, please see the new site dedicated to the Laminas project, and if you would like to become a member and/or support the project at the Linux Foundation (their blog post), please join and become a member.

カテゴリー: php

Ibrar Ahmed: PostgreSQL CommitFest 2019-03 Ends

planet postgresql - 2019-04-17(水) 19:17:27

PostgreSQL has a very unique way to review the code submitted by developers. Most open source software uses Github pull requests to accommodate users’ code. PostgreSQL has a Github page but doesn’t  manage pull requests using Github. Many years ago, PostgreSQL introduced CommitFest to manage its patches, where postgres opens for a three to four month “festival” to accept patches. The CommitFest is set up to keep track of patches’ statuses. In practice, CommitFest is mainly an admin page used to manage patches. Volunteers and community committers review the submitted code, after which committers are able commit those patches that have been approved. There have been almost 22 CommitFest events since 2014.

The process

When a patch is submitted, a volunteer can choose to review it. A review can be done by more than one person. At any point, a patch will be in one of the following statuses:

  • Committed
  • Moved to next CF (CommitFest)
  • Needs Review
  • Ready for Committer
  • Rejected
  • Returned with Feedback
  • Waiting on Author
  • Withdrawn

Needs review indicates that the patch is waiting for a reviewer to analyze it. Once a reviewer has confirmed that the patch in question is good to be committed, a community committer will pick up the patch, review it and commit it if all is well, otherwise, they reject it or return it with feedback.

Patch categories

Patches are categorized in various ways including:

  • Bug Fixes
  • Clients
  • Code Comments
  • Documentation
  • Miscellaneous
  • Monitoring & Control
  • Performance
  • Procedural Languages
  • Refactoring
  • Replication & Recovery
  • SQL Commands
  • Server Features
  • System Administration

A complete history of a patch, along with a discussion on email, is maintained with each revision which makes it very simple to track the complete process from submission of a patch to its eventual conclusion.

Here are some graphs that show various stats for the past CommitFests.



Now it’s time to end the 22nd CommitFest, the first such festival for 2019. This event saw 207 patches, almost 52% of which were committed to the master b

カテゴリー: postgresql

Hans-Juergen Schoenig: DECLARE CURSOR in PostgreSQL or how to reduce memory consumption

planet postgresql - 2019-04-17(水) 17:00:59

Have you ever heard about cursors in PostgreSQL or in SQL in general? If not you should definitely read this article in depth and learn how to reduce memory consumption in PostgreSQL easily. Cursors have been around for many years and are in my judgement one of the most underappreciated feature of all times. Therefore it makes sense to take a closer look at cursors and see what they can be used for.

The purpose of a cursor in PostgreSQL

Consider the following example:

test=# CREATE TABLE t_large (id int); CREATE TABLE test=# INSERT INTO t_large SELECT * FROM generate_series(1, 10000000); INSERT 0 10000000

I have created a table containing 10 million rows so that we can play with the data. Let us run a simple query now:

test=# SELECT * FROM t_large; id ---------- 1 2 3 …

The first thing you will notice is that the query does not return immediately. There is a reason for that: PostgreSQL will send the data to the client and the client will return as soon as ALL the data has been received. If you happen to select a couple thousand rows, life is good and everything will be just fine. However, what happens if you do a “SELECT * …” on a table containing 10 billion rows? Usually the client will die with an “out of memory” error and your applications will simply die. There is no way to keep such a large table in memory. Throwing ever more RAM at the problem is not feasible either (and pretty stupid too).


DECLARE CURSOR and FETCH can come to the rescue. What is the core idea? We can fetch data in small chunks and only prepare the data at the time it is fetched – not earlier. Here is how it works:

test=# BEGIN; BEGIN test=# DECLARE mycur CURSOR FOR SELECT * FROM t_large WHERE id > 0; DECLARE CURSOR test=# FETCH NEXT FROM mycur; id ---- 1 (1 row) test=# FETCH 4 FROM mycur; id ---- 2 3 4 5 (4 rows) test=# COMMIT; COMMIT

The first important thing to notice is that a cursor can only be declared inside a transaction. However,

カテゴリー: postgresql

Robins Tharakan: Another look at Replica Lag :)

planet postgresql - 2019-04-17(水) 11:59:00
The other day, I remembered an old 9.0-era mail thread (when Streaming Replication had just launched) where someone had tried to daisy-chain Postgres Replicas and see how many (s)he could muster.

If I recall correctly, the OP could squeeze only ~120 or so, mostly because the Laptop memory gave way (and not really because of an engine limitation).

I couldn't find that post, but it was intriguing to know if we could reach (at least) a thousand mark and see what kind of "Replica Lag" would that entail; thus NReplicas.

On a (very) unscientific test, my 4-Core 16G machine can spin-up a 1000 Replicas in ~8m (and tear them down in another ~2m). Now am sure this could get better, but am not complaining since this was a breeze to setup (in that it just worked without much tinkering ... besides lowering shared_buffers).

For those interested, a single UPDATE on the master, could (nearly consistently) be seen on the last Replica in less than half a second, with top showing 65% CPU idle (and 3.5 on the 1-min CPU metric) during a ~15 minute test.

So although (I hope) this isn't a real-world use-case, I still am impressed that without much tweaking, we're way under the 1 second mark, and that's right out of the box.

Am sure there's more to squeeze here, but still felt this was worthy of a small post nonetheless!
カテゴリー: postgresql

Stefan Fercot: One RPM to rule them all…

planet postgresql - 2019-04-17(水) 09:00:00

As of 15 April 2019, there is only one repository RPM per distro, and it includes repository information for all available PostgreSQL releases.

This change, announced by Devrim on the pgsql-pkg-yum mailing list, has some impacts.


The announce from Devrim may be found here.

  • Instead of having separate repo RPMs per PostgreSQL major version, we now have one single repo RPM that supports all supported PostgreSQL releases. The new packages obsolete the current ones.

  • The repo RPM version has been bumped to 42. Hopefully that will be the end of the “The repo RPM is 10-4, how can I find 10-7 repo rpm, so that I can install PostgreSQL 10.7?” type questions.

  • The “latest” suffix has been added to all repo RPMs.


Let’s see some impacts of those changes on CentOS 7.

As usual, go to https://www.postgresql.org/download/linux/redhat/ and chose the version (11), the platform (CentOS 7) and the architecture (x86_64) you want to install.

Today, you still get the link to the pgdg-centos11-11-2 rpm.

Let’s install it:

# yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm Loaded plugins: fastestmirror pgdg-centos11-11-2.noarch.rpm Examining /var/tmp/yum-root-5eSWGp/pgdg-centos11-11-2.noarch.rpm: pgdg-redhat-repo-42.0-4.noarch Marking /var/tmp/yum-root-5eSWGp/pgdg-centos11-11-2.noarch.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package pgdg-redhat-repo.noarch 0:42.0-4 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================== Package Arch Version Repository Size ======================================================================================================== Installing: pgdg-redhat-repo noarch 42.0-4 /pgdg-centos11-11-2.noarch 6.8 k Transaction Summary ======================[...]
カテゴリー: postgresql

Luca Ferrari: An article about pgenv

planet postgresql - 2019-04-17(水) 09:00:00

A few months ago I worked to improve the great pgenv tool by theory. Today, I try to spread the word in the hope this tool can grow a little more!

An article about pgenv tl;dr

I proposed a talk about pgenv, a Bash tool to manage several PostgreSQL instances on the same local machine. My talk has been rejected, and I hate to waste what I have already prepared, so I decided to transform my talk in an article, that has been quickly accepted on Haikin9 Devops Issue!

I should have written about this a couple of months ago, but I did not had time to.
My hope is that pgenv gets more and more users, so that it can grow and become someday a widely used tool. Quite frankly, I don’t see this happening while being in Bash, for both portability and flexibility, and I suspect Perl is much more the language for a more flexible implementation. However, who knows? Gathering users is also a way to gather contributors and bring therefore new ideas to this small but very useful project.

In the meantime, if you have time and will, try testing the build from git patch, that allows you to build and manage a development version of our beloved database.

カテゴリー: postgresql

Laravel News: Podcast: The Laravel Origin Story

phpdeveloper.org - 2019-04-17(水) 08:00:01
On the Build Your SaaS podcast Justin Jackson sits down with Taylor to talk about how Laravel got started and how it went from a side project into a full-time affair. Visit Laravel News for the full post. The post Podcast: The Lar...
カテゴリー: php

CoderCruise 2019

php.net - 2019-04-17(水) 03:59:25
カテゴリー: php

10 bad things about consulting, and why it might not be for you

planet PHP - 2019-04-17(水) 00:01:00

In this video I share 10 bad things about being a consultant, and why a consulting job might not be a good fit for you. Adam Culp of Beachcasts shares points from his experience to help you figure out if being a PHP consultant is the right job for you.

Or you can view this video on YouTube at: https://youtu.be/ELE0G3e7h3c

カテゴリー: php

421 Misdirected Request

planet PHP - 2019-04-17(水) 00:00:00

A server should emit 421 Misdirected Request when it receives a HTTP request that was not intended for that server.

This status was introduced with HTTP/2, but it may also be applicable to HTTP/1 servers. For example, a server might receive the following HTTP request:

GET /contact.html HTTP/1.1 Host: foo.example.org

Since HTTP/1.1 a client is required to include a Host header. A server might already know that the foo.example.org domain is not configured on that server, cand could respond with a 421 Misdirected Request response to tell the client that it connected to the wrong server:

HTTP/1.1 421 Misdirected Request Content-Type: text/html <h1>Switchboard operator error</h1>

So when can that actually happen? One example of this is that the DNS for a server was set to the wrong IP or CNAME, or simply a server configuration error.


There’s other examples where this might occur. In HTTP/2 it will be possible for a single HTTP/2 connection to be used for multiple domainnames via connection coalescing.

If a client is trying to use this feature but a server doesn’t support it, it must return 421 Misdirected Request This is actually the real reason this status got introduced.

カテゴリー: php

PHP Town Hall: Episode 63: Dollar Bills Yall - Part 2

phpdeveloper.org - 2019-04-16(火) 23:30:02

Matt Trask and Ben Edmunds are joined by Jason McCreary to discuss further discuss investing and trading.

This episode gets a bit more in the weeds on investing and trading for those interested, discussing everything from 401k to index funds to speculation. We also briefly cover Financial Indepe...

カテゴリー: php

Voices of the ElePHPant: Interview with Susan Ibach

phpdeveloper.org - 2019-04-16(火) 23:30:02


Show Notes So Your Boss Says You Need to Learn Data Science


This episode is sponsored by

The post Interview with Susan Ibach appeared first on Voices of the ElePHPant.

カテゴリー: php

Webslesson: Dynamically Add / Remove input fields in Laravel 5.8 using jQuery Ajax

phpdeveloper.org - 2019-04-16(火) 23:30:02

Hi, If you want to use Laravel 5.8 framework for your web development then here we have come with one more advance level of web development topic like How to Add or remove HTML input fields dynamically using jQuery and how to save multiple records in Laravel 5.8 by using Ajax. So, here we have share...

カテゴリー: php