Documentation with examples, reference manual

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
liebehenz
Posts: 3
Joined: Tue 30 Jun 2009 14:20

Documentation with examples, reference manual

Post by liebehenz » Wed 28 Oct 2009 11:40

Hello!

Has somebody an idea, where i can get an excellent documentation with examples about pg_query, pg_table, tfields and database-programming?

The documentation in delphi2009 is... uggly. No examples and else.

Currently i try -something "easy"- like "to copy one record from Database A, table B to Database B table b with same definition.
This costs much time and is very inefficient. try and error. And drives me crazy. That must be easier to go.

And I am not an beginner!

---
self.PgTable_mts.Append;

// for i := 0 to self.PgTable_mts.Fields.Count - 1 do begin
// if self.PgTable_mts.Fields.FieldName = 'be_seq' then begin
// // self.PgQuery2.SQL.Append('be_seq='+inttostr(sequence));
// end else
// self.PgTable_mts.Fields.Value := self.PgTable_tmp_mts.Fields.Value;
// end; //for
self.PgTable_mts.FieldByName('be_diag').Value := '1';

self.PgTable_mts.Post;


thank you for answering me.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 29 Oct 2009 08:11

There is no simple method to copy a record from one dataset to another. You should copy all fields values in a loop as you are doing.

If you need to copy the entire dataset to another database, you can use TPgLoader or TCRBatchMove components.

liebehenz
Posts: 3
Joined: Tue 30 Jun 2009 14:20

Post by liebehenz » Tue 03 Nov 2009 17:42

Yes.

But the greater problem was to FIND out that

Code: Select all

PgTable.ApplyUpdates;
was right and

Code: Select all

PgTable.Post 
was wrong.

Do you understood my problem? :oops:
I need some hint thought the 100 possible methods and properties.

thanks for answering me.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 04 Nov 2009 09:45

We don't have any tutorial about using data access components. You can find information about using standard components like BDE, ADO or dbExpress in the Internet. PgDAC has the same interface as standard components. So you can use this information when working with PgDAC.

You need to call the Post method anyway. If you have enabled CachedUpdates mode, you need to call ApplyUpdates after you post some records.

dschuch
Posts: 75
Joined: Thu 05 Feb 2009 15:29
Location: Dresden

Post by dschuch » Thu 05 Nov 2009 23:46

the delphi help is very good to lern the basics.

look for tdataset.

daniel

snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Post by snorkel » Mon 09 Nov 2009 19:52

They key to working with postgresql and inserting a bunch of records from one db to another is to do it like you are doing, but to get speed you need to start a transaction on the database you are inserting into and do a commit like every 1000 records, this will speed it up by a large margin.
By default Postgresql will do a autocommit on each insert you do and this can cause a big performance hit.

You may not be doing the inserts yourself, but the library is doing them for a append. Doing a post or apply updates does not commit the transaction.

Post Reply