psql on bash on Windows

1. Windows 10 supports Subsystem for Linux.
2. psql has some issues with non-English locales under Windows, see Notes for Windows Users.

So I installed WSL, then choose Ubuntu, started Bash and executed:

pasha_golub@PASHA:~$ sudo apt install postgresql-client

Cool. Now I have native Linux psql and, of course, I want to try Pavel Stehule’s Postgres pager!


PostgresDAC meets Lazarus

First of all, Lazarus is the class libraries for Free Pascal that emulate Delphi. Free Pascal is a GPL’ed compiler that runs on Linux, Win32, OS/2, 68K and more.

I knew it before and frankly speaking always thought that Lazarus is some kind of not a serious thing. However several days ago I found the first issue of Blaise Pascal Magazine in Russian with article of Zeljan about it. “You never know till you try”, I thought, and decided to give Lazarus a chance.

Since I’m a developer of PostgresDAC component suite my first thought was to use it under Lazarus. Well, I spent two days working and suddenly… Now I’m able to create “Hello world!” bagatelle. Anyway “that’s one small step for man, one giant leap for mankind”. 🙂 I think soon we will add official support for Lazarus in PostgresDAC.

Postgresdac under Lazarus
Postgresdac under Lazarus

Opening URL under Wine

note This article available in Russian.

Imagine the following situation. Our product can detect if it is running under WineHQ already. And, indeed, our product has many places from which we must open URL’s:

  • information about the product,
  • checking for updates,
  • online help,
  • technical support page
  • and so on.

Trying to call ShellExecute head-on, passing the URL as parameter, and … Nothing happens!

The thing is that Wine, honestly emulating everything, wants to start a web browser not installed in the system, but installed under the Wine. There are no any browsers installed yet. Therefore, nothing happens.

Of course, you can install the browser, but why not open the required documents in their native system applications? This raises the question of interaction of the Wine and the operating system.

There are a number of commands available in Wine.

We are interested in winebrowser command, which opens the URL in the native operating system application. And taking into account that URL can refer to the file, we have really serious mechanism in our hands.

winebrowser httр://


winebrowser irc://

winebrowser file://c:\\windows\\win.ini

On a KDE system the first two might open in Konqueror, the third in Konversation, and the last in KWrite.

As a result, applying the function GetWineAvail (), described earlier, our code might look like this:

//Delphi Code

procedure OpenUrl(url: string);
  S: string;
  if GetWineAvail() then 
    S := 'winebrowser ' + url
    S := url;
  ShellExecute(0, 'open', PChar(S), nil, nil, SW_SHOW);


or like this:

//C Code
void OpenUrl(char * url);
    char s[255];
    if (GetWineAvail())
        strcpy(s, "winebrowser ");
        strcat(s, url);
        strcpy(s, url);
    ShellExecute(NULL"open", s, NULLNULL, SW_SHOW);


PgMDD-1.2.8: Wine out of the box


As was mentioned PgMDD entered beta-testing stage. Details have been promised. Voilà.

Crux of the matter

PgMDD-1.2.8 supports WineHQ out of the box. What mean supports?

  • PgMDD always knows if it was launched under Wine or in pure Windows environment
  • PgMDD offers several ways to bypass imperfect Wine functionality
  • PgMDD disables the functionality which current Wine configuration cannot provide

Lets go on each item.

Continue reading “PgMDD-1.2.8: Wine out of the box”

On Wine or not on Wine?

note This article available in Russian.

In the life of every Windows developer there comes a point when you want to know if your application is running under WineHQ or not. Why? Because the world is not perfect. And you for sure will help Wine to crunch your application correctly. Of course if you’re interested in support of millions of guys with red eyes (Mac, Linux etc.). 😉

There is an elegant way to find this out. Below is the Pascal\Delphi code, however any sane developer would be able to translate it into preferred language:

function GetWineAvail: boolean;
var H: cardinal;
 Result := False;
 H := LoadLibrary('ntdll.dll');
   Result := Assigned(GetProcAddress(H, 'wine_get_version'));

if GetWineAvail() then 
 ShowMessage('Launched under Wine')
 ShowMessage('Pure Windows');

Сode speaks for itself.

PgMDD meets UDD

Before we get started:

warning For guys not from the neighbourhood PgMDDMicroOLAP Database Designer for PostgreSQL and UDDUltimate Debian Database.

The day begins as usual, from the Postgres Planet reading. Nothing presaged troubles. 🙂 I was reading the Big Shots post and became curious of the UDD schema.

Official schema documentation plunged me into despair. 🙂 But God bless MicroOLAP (and me of course)! We have the world wide best entity-relationship designer ever.

Thus I made Reverse Engineering and exported model to graphic.
Enjoy it.

Very freaking detailed tutorial from kishkin

Howdy, postgresmen!

There was some guy, Sherlok, who couldn’t start DB Designer in Wine properly. And I have no idea what he did wrong as my HOWTO is very simple. Yet it’s short… but not anymore! 😉 kishkin rewrote that tutorial with the screenshots, and there are LOTS OF THEM!

Here is photo, kishkin receving free license for Database Designer for PostgreSQL. Lot’s of friends came for the party. 🙂