Notes from Postgresql demo/chat at last nights ADUG Melbourne meeting.
Had a bit of a demo/talk about Postgresql and then a bit on current hot
topic of memory (safety)
Postgresql seems to be the premiere open source DBMS.
It has many datatypes that can be used, as well as options to compose
additional types.
Its Gui Interface, pgadmin 4 is very full featured.
It is moderately fat.
One downside compared with Firebird is no embedded mode.
I Originally started looking at it, because it comes with encryption as
standard, and also it has been on my list of databases to look at for a
long time.
Firedac comes with drivers to drive Postgresql.
Postgresql has odbc compatibility.
There are a number of commercial providers of database drivers for
delhpi for Postgresql.
https://www.postgresql.org/download/products/2-drivers-and-interfaces/
Zeoslib also has support for Postgresql.
Version 15 of Postgresql (The one I installed) has changed handling of
numbers followed by a non numeric value. Previous versions it assumed it
was a word following the number, now it doesnât like them, and needs the
space.
Firedac on the versions of Delphi I tested (10.1, 11.2) has a bug/issue where
it generates code that ends in something like 1234566ORDER BY OID:
'SELECT OID, ENUMLABEL â +
'FROM PG_CATALOG.PG_ENUM â +
'WHERE ENUMTYPID = â + sId +
âORDER BY OIDâ); â Needs a space in front of ORDER
It (presumably) used to work with older versions of Postgresql, but now
invokes an exception.
Copying and altering the offending source file, compiling it to a dcu
and including this in the build got it to work ok.
This was found by inspecting a trace from Wireshark.
Which was in itself quite interesting.
(Conveniently encryption not currently/default enabled)
Input query was a simple âselect * from table;â
That query was there in the trace, but there is SO MUCH stuff that
Firedac wraps around it.
Also while testing, I found Firedac didnât handle fields of type TEXT
well. I rarely use text/blob fields, and much less likely arrays of
them. I was able to use cast to work around the issue at least in the
short term.
Also on Delphi 10.1 it could not handle a field of type TSVECTOR though
this field type appeared to be recognized in Delphi 11.2.
PostgreSQL.pdf (37.1 KB)
(Memory section to follow)