473,785 Members | 2,374 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1449
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.attr elid)
INNER JOIN pg_type T ON (T.oid=A.atttyp id)
WHERE
C.relname='sale s';

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/PRnr21dVnhLsBV0 RAgA/AJkBm28Gi8IP5fd Rcdh8JZuqu0O6Lw CfY15J
Vw5KR2iFogKVwnW WThpABp0=
=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
13576
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., head and tail are not connected. Of course, recursive function aproach to traverse the list is one way. But, depending upon the list size, it could overrun the stack pretty fast.
13
2194
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
2430
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 python have a sorted map type object is a good question. clearly many people like have a sorted map, and sorting the keys every time seems rather wasteful, as does keeping a separate sorted list of the keys.
0
1151
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 the error: Compiler Error Message: CS1595: 'ASP.List_ascx' is defined in multiple places; using definition from 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\wms\14c775ea\f2e196aa\rkmoy7hl.dll'
1
1086
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> <head> <title>Untitled</title> <style type="text/css"> * {margin: 0px; padding: 0px; border: 0px; border: 1px solid
5
3509
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 last entry. I have even witnessed it in break mode and following it step by step with Shift + F8, where it reports - for example - that the listcount is 14, when if fact it is 15 and has index values of 0 to 14. I made a quick fix, but I don't like...
10
1830
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 need to create a herd of them. I want to simulate motion of individual gazelles, but I don't want to have to go through and manually update the position for every gazelle (there could be upwards of 50). I was planning to create an array of these...
8
37254
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 .Contains() or something similar? In my case, I have a set of controls a user selects. If the user selects the same control twice, I don't want it added again to my collection, and I don't want to handle the exception, and I think .Contains() is too...
1
5602
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 in the middle as it involves copying to maintain the memory layout, can be expensive to append to the end if it involves reallocating memory, never releases memory once allocated without user intervention. Has random access and therefore random...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10096
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.