Blog Archives

MERGE in PostgreSQL

Found cool trick how today implement Orable MERGE in PostgreSQL: Oracle statement:   MERGE INTO acme_obj_value d USING ( SELECT object_id         FROM   acme_state_tmp       ) s ON (d.object_id = s.object_id)   WHEN matched

Tagged with: , ,
Posted in Coding, PostgreSQL

Delphi: Warnigs → Errors


Want to force your dev team to address Compiler Warnings rather than ignoring them? Elevate Warnings to Errors: 1) Go to Project Options 2) Under Delphi Compiler, select Hints and Warnings 3) Expand the Output warnings item 4) For each

Tagged with: , ,
Posted in Coding, Delphi

Get PostgreSQL sources using SVN

As you probably know PostgreSQL sources are managed by Git version control system. Which is great, but for me as SVN user it would be much better to get access to the sources using familiar tools, e.g. TortoiseSVN. Mainly because

Tagged with: , , , ,
Posted in Coding, PostgreSQL

Number into words convertion in PostgreSQL

I was playing with some unit tests for PostgresDAC recently. And one test case was to check TPSQLDataset.Locate routine which allows partial-string and case-sensitive matching options. So I want to have some test result set with integer and text columns.

Tagged with: , ,
Posted in Coding, PostgresDAC

How to move data from one schema to another in Postgres?

I saw a question today : I have PostpreSQL 9.1. In my database there are 2 schemas: public and test. How can I quickly move all objects and data from public to test? Opps. I’m stuck with this issue for

Tagged with: ,
Posted in PostgreSQL

Factorial using CTE in PostgreSQL

Not so long ago I used Common Table Expressions for Fibonacci Numbers calculation. Today I had a conversation with one client about SQL in general and about PosgreSQL dialect in particular. We talked about SQL’s Turing completeness also. Well my

Tagged with: , , , , ,
Posted in Coding, PostgreSQL

Why you cannot create table and PK constraint with the same name

Very interesting message appeared on the list today: When I do this CREATE TABLE “T1” ( “T1_ID” bigint NOT NULL, CONSTRAINT “T1” PRIMARY KEY (“T1_ID” ) ); I get the following message: NOTICE: CREATE TABLE / PRIMARY KEY will

Tagged with: , , , ,
Posted in PostgreSQL
Map of wandering

Get every new post delivered to your Inbox.

Join 456 other followers