Re: [SQL] rowcount for all tables

2006-03-18 Thread Bruno Wolff III
On Fri, Mar 17, 2006 at 14:39:04 +0100, Stefan Meyer <[EMAIL PROTECTED]> wrote: > i have a beginner question and i have read the FAQs. > is there a faster ways than > > select count(*) from foo; > > to get the rowcount for the tables in my db ? There are some ways to get approximate counts

Re: [SQL] update before drop causes OID problems in transaction?

2006-03-18 Thread Jeff Frost
On Sat, 18 Mar 2006, Tom Lane wrote: IIRC you'd have to drop the underlying plpgsql function, not only the trigger object that connects the function to a table. We cache stuff with respect to the function. Tom, sorry it took me a little while to make a test case. The test case is attached.

Re: [SQL] schema inspection

2006-03-18 Thread Michael James
Pgadmin is a good GUI interface if you want that same info, but pg_catalog is a better tool -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Achilleus Mantzios Sent: Thursday, March 16, 2006 9:45 AM To: [EMAIL PROTECTED] Cc: pgsql-sql@postgresql.org Subje

Re: [SQL] group by function, make SQL cleaner?

2006-03-18 Thread Stefan Becker
this should work, # SELECT date_trunc('day',endtime),count(*) FROM eg_event where endtime >= '2006-02-01' and endtime < '2006-03-01' GROUP BY 1 ORDER BY 1; best regards, Stefan Am Donnerstag, 16. März 2006 06:18 schrieb Bryce Nesbitt: > I've got a working query: > > stage=# SELEC

Re: [SQL] connectby documentation

2006-03-18 Thread Lucius Seneca
Hi "outdated" packets is unfortunately a big issue on Debian. If you want to have up-to-date apt-packages try www.backports.org Add one of the mirrors from the list to your sources.list, then run apt-get update and then try to install again ... :-) And you'll see, that you can install newer

[SQL] how to get current recursion level in recursive trigger?

2006-03-18 Thread Андрей Долин
Hello all! How to get current recursion level in recursive trigger? Andrew Dolin. ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

[SQL] rowcount for all tables

2006-03-18 Thread Stefan Meyer
i have a beginner question and i have read the FAQs. is there a faster ways than select count(*) from foo; to get the rowcount for the tables in my db ? Stefan ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

R: Re: R: Re: R: R: Re: [SQL] schema inspection

2006-03-18 Thread [EMAIL PROTECTED]
>Well thats it if you use only *single column* Foreign keys. >In the general case the above will need extra work. Are you sure? I have tested query with 3 table with multiple FK and it works (see below) [as you can see "C" table have two FK to A and B] test=> SELECT test-> (SELECT relname FRO

R: Re: R: R: Re: [SQL] schema inspection

2006-03-18 Thread [EMAIL PROTECTED]
> >SELECT c1.relname,c2.relname from pg_constraint cons,pg_class c1, pg_class >c2 where cons.conrelid=c1.oid and cons.confrelid = c2.oid; > >for column(s) names you will have to do extra homework. Thanks! I have obtained my query! Here is: SELECT (SELECT relname FROM pg_catalog.pg_class WHE