List of tables in a DB

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
piopio1
Posts: 32
Joined: Thu 10 Jan 2013 23:13

List of tables in a DB

Post by piopio1 » Fri 28 Feb 2014 15:40

Hello,

How can I get the list of tables in a PostgreSQL DB with PgDAC ?

Many thanks
Pio Pio

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: List of tables in a DB

Post by AlexP » Mon 03 Mar 2014 11:06

Hello,

There is a demo sample of retrieving the table list.

Code: Select all

var
  TableList: TStringList;
  i: integer;
begin
  TableList := TStringList.Create;
  try
    PgConnection1.GetTableNames(TableList);
    for i := 0 to TableList.Count - 1 do
      ShowMessage(TableList[i]);
  finally
    TableList.Free;
  end;
end;

Post Reply