In recent post I've posted part of my library, that deals with PostgreSQL data in binary format. Today, googling for some hints for implementing binary timestamps in double format I've found a reliable library, libpqtypes, which is doing exactly the same as mine (actually more), except it's purpose is PostgreSQL only.
Don't know if it's terrible news or not, as I could adapt my code while using this library and win a lot of time. This is one of the reasons why extensive googling is required before each project.
Showing posts with label PostgreSQL. Show all posts
Showing posts with label PostgreSQL. Show all posts
2009-05-21
PostgreSQL binary timestamp functions
While writing libpq wrapper I've run into problems with binary timestamps, which required a lot of debugging and headaches. To avoid your own migraine, feel free to use my code below. Note, however, this code is not perfect, as it's uses long long for timestamps. This will work if your machine is 32bit and your server was compiled with `--enable-integer-datetimes` (highly recommended). If not, You're welcome to patch this code and post it here, so other people will thank you.
2009-04-29
Fastest way to create database in PostgreSQL
This will create database and it's associated role from Linux shell:
su postgres createuser -SDRPE user createdb -E UTF8 -O user database
Subscribe to:
Posts (Atom)