Waiting for 9.1 – format()

On 21st of November Robert Haas committed new patch, which adds new function:

Add new SQL function, format(text).

Currently, three conversion format specifiers are supported: %s for a
string, %L for an SQL literal, and %I for an SQL identifier.  The latter
two are deliberately designed not to overlap with what sprintf() already
supports, in case we want to add more of sprintf()'s functionality here
later.
 
Patch by Pavel Stehule, heavily revised by me.  Reviewed by Jeff Janes
and, in earlier versions, by Itagaki Takahiro and Tom Lane.

Continue reading Waiting for 9.1 – format()

Waiting for 9.1 – Removed autocast footgun

On 8th of November, Tom Lane committed patch, which doesn't provide any new features, but removes one of the more annoying footguns in PostgreSQL:

Prevent invoking I/O conversion casts via functional/attribute notation.
 
PG 8.4 added a built-in feature for casting pretty much any data type to
string types (text, varchar, etc).  We allowed this to work in any of the
historically-allowed syntaxes: CAST(x AS text), x::text, text(x), or
x.text.  However, multiple complaints have shown that it's too easy to
invoke such casts unintentionally in the latter two styles, particularly
field selection.  To cure the problem with the narrowest possible change
of behavior, disallow use of I/O conversion casts from composite types to
string types via functional/attribute syntax.  The new functionality is
still available via cast syntax.
 
In passing, document the equivalence of functional and attribute syntax
in a more visible place.

Continue reading Waiting for 9.1 – Removed autocast footgun

Understanding postgresql.conf : checkpoint_completion_target

Starting new blog series – explanation of various configuration parameters.

I will of course follow no schedule or order – if I'd had to – it would be my job, and in this way – it's fun.

First configuration parameter to write about is checkpoint_completion_target.

Continue reading Understanding postgresql.conf : checkpoint_completion_target

What would Roy Merritt do?

Some time ago, I was listening to This week in tech and I heard Leo Laporte raving about book Daemon by Daniel Suarez. Did some research, got the book, read it. Relatively soon I heard that there is second part – Freedom ™ (polish comment: czemu polski tłumacz wywalił to “tm" z tytułu?!). Of couse I read it too. Well – it's more like devoured it as I found it simply amazing, and read it all in one go.

Today, I got information from alerts that somebody wrote about it on blog. Went to read, and was astounded to read this sentence:

Turns out it’s only half the story because there is apparently a sequel. I don’t think I’m going to read the next book.

(this is about Daemon).

Well, I did comment there, but just in case, and for Google purposes let me put my answer in here:

Freedom ™ is not a sequel in common meaning of the word. Personally, I think about them as of single text with single story, that was just printed (for whatever reason) as two separate volumes.

Personally I found Freedom ™ much more enjoyable, as it takes the ideas presented in Daemon much further. Daemon is short-time extrapolation “what-if", with common gadgets, and todays technology (well, after some tweaking). Freedom ™ shows what it can lead to – it's social and political consequences.

So, if you haven't yet read these books – go get them. And if you, for some unknown reason, read just the Daemon – get also this “sequel".

Just one warning – if you read Daemon long ago, and now you'll get Freedom ™ – reread Daemon first, as Freedom ™ is literally next part of the same book – with no re-introduction, reminding of events, people, items – nothing like this.

If you don't understand the tile – well – get the books 🙂