472,799 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,799 software developers and data experts.

New to list, quick question.

Hello everyone.
I have been using PostgreSQL for about 3-4 years now, it's wonderful how
I can make it do things and write Perl programs to interface with it.

Since I do all of the DBA behind the scenes on our company Intranet
(Linux-Apache based), and I really prefer writing Perl programs to do my
simple admin functions. I really like those \d commands (via telnet) and
they tell me a lot of what I need for writing new programs etc, but I
would really like a way to use those through my Perl programs, but
haven't found a way to do so, has anyone done this in this manner yet?
Also, I'd like a way to query a table to find out how much space it is
using, like it's percentage for example, is there a way to do that?

Excuse me if these questions have been asked before, I tried to search
the LIST area and I also did not see anything related to this in the FAQS.

Thanks for any info you can provide me.
--
Rich Parker
http://www.fssi-ca.com
mailto:Ri********@fssi-ca.com

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
1 1414
you can retrieve any information of tables by queryng the catalog of
your database. For example, to get a description of table "sales", you
can query:

SELECT
C.relname, A.attname, T.typname
FROM
pg_class C
INNER JOIN pg_attribute A ON(C.oid=A.attrelid)
INNER JOIN pg_type T ON (T.oid=A.atttypid)
WHERE
C.relname='sales';

from perl, php, c or whatever.

Here (http://www.postgresql.org/docs/7.3/i.../catalogs.html) is
the catalog tables documentation.

About your second question, you need to install contrb/dbsize. Then you
can query
SELECT relation_size('sales');
to get the size of your sales table.

On Fri, 2003-08-15 at 12:35, Rich Parker wrote:
Hello everyone.
I have been using PostgreSQL for about 3-4 years now, it's wonderful how
I can make it do things and write Perl programs to interface with it.

Since I do all of the DBA behind the scenes on our company Intranet
(Linux-Apache based), and I really prefer writing Perl programs to do my
simple admin functions. I really like those \d commands (via telnet) and
they tell me a lot of what I need for writing new programs etc, but I
would really like a way to use those through my Perl programs, but
haven't found a way to do so, has anyone done this in this manner yet?
Also, I'd like a way to query a table to find out how much space it is
using, like it's percentage for example, is there a way to do that?

Excuse me if these questions have been asked before, I tried to search
the LIST area and I also did not see anything related to this in the FAQS.

Thanks for any info you can provide me.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQA/PRnr21dVnhLsBV0RAgA/AJkBm28Gi8IP5fdRcdh8JZuqu0O6LwCfY15J
Vw5KR2iFogKVwnWWThpABp0=
=O03K
-----END PGP SIGNATURE-----

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: RAJASEKHAR KONDABALA | last post by:
Hi, Does anybody know what the fastest way is to "search for a value in a singly-linked list from its tail" as oposed to its head? I am talking about a non-circular singly-linked list, i.e.,...
13
by: XXXXXX.working.in.my.blood | last post by:
hi all, i need help with linked lists... the problem is this, "reverse the contents of a singly linked list without using a temporary node"... solution with code will be appreciated...
4
by: Tim Henderson | last post by:
Hi The question why are there no sorted dictionaries in python, seems to pop up with unseeming regularity. That question in itself in nonsensical sense dictionaries are hash-maps, however should...
0
by: anna_parkins7 | last post by:
Hi Quick question, that will point me in the right direction. I have 2 user controls on a page, both called List.ascx but obviously in 2 different namespaces and 2 different tags.. however I get...
1
by: simplico | last post by:
I'm creating an unordered list that fits in a defined width on the left side of the page. It works fine in FF but IE is another story. Here is a watered-down version of the code: <html>...
5
by: eleksoft | last post by:
My code: If List.Listcount > 0 then For intI = 0 to List.Listcount - 1 'code Next intI End If For some reason, and not all the time, this loop only runs to the second...
10
by: datamonkey.ryan | last post by:
Howdy, a (possibly) quick question for anyone willing to listen. I have a question regarding lists and Classes; I have a class called "gazelle" with several attributes (color, position, etc.) and I...
8
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: Just a quick question really quick. Does C# have a generic class that will allow me to add only one instance of an object to the "collection" without having me do a...
1
Banfa
by: Banfa | last post by:
So the basic sequenced C++ containers are vector - holds data in a contiguous memory block that has the same memory footprint as a classical array. Expensive to insert or delete at the front or...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.