[SQL] Database diagram

2004-01-19 Thread Ganesan Kanavathy
I have a postgres database with many tables. How do I create database diagram? Are there any free tools available to create database diagram from pgsql database? Regards, Ganesan ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Trigger to identify which column(s) updated

2004-01-19 Thread V i s h a l Kashyap @ [Sai Hertz And Control Systems]
Dear Jack , for each column in new: if (new.column(1) != old.column(1)) ... ...and then some snippet of code to determine the primary key column of new (or old) Check the following link http://gborg.postgresql.org/project/tablelog/projdisplay.php Hope this helps -- Regards, V

Re: [SQL] How can I get the last element out of GROUP BY sets?

2004-01-19 Thread Robert Creager
When grilled further on (Mon, 19 Jan 2004 00:44:30 -0500), Tom Lane <[EMAIL PROTECTED]> confessed: > Robert Creager <[EMAIL PROTECTED]> writes: > > ... one piece of data I need is the last value for each GROUP BY > > period. Alas, I cannot figure out how to do this. > > SELECT DISTINCT ON (rathe

Re: [SQL] name of a column returned from a table function

2004-01-19 Thread Tom Lane
"Iain" <[EMAIL PROTECTED]> writes: > I've written a little table function that simply returns all the dates in a > month. No problems so far. Now I want to outer join this list to another > table, but I dont know what to call the column returned by the > function. Same as the name of the function,

Re: [SQL] Initially Deffered - FK

2004-01-19 Thread Denis
Hi Stephan, Thanks for your reply. Will have to work on its workaround... Denis - Original Message - From: "Stephan Szabo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, January 19, 2004 4:03 PM Subject: Re: [SQL] Initially Deffered - FK > > On Fri

[SQL] name of a column returned from a table function

2004-01-19 Thread Iain
(B (B (BDB Version 7,4. (B  (BI had a look through the docs, but the (Binformation on table functions (those returning SETOF something) seems to have (Bgone missing from the 7.4 docs. I found something under 7.3, but it didn't (Banswer my question, which is... (B  (BI've written a lit

Re: [SQL] Initially Deffered - FK

2004-01-19 Thread Stephan Szabo
On Fri, 16 Jan 2004 [EMAIL PROTECTED] wrote: > Thanks for your reply. > > But, you will agree that result should be same JUST BEFORE and JUST AFTER > commit ( assuming no one is working on the database and i am the only user > connected.) If you use the definition we're using now, then no, the a

Re: [SQL] How can I get the last element out of GROUP BY sets?

2004-01-19 Thread Christoph Haller
> > I'm trying to produce summary data from a table (using PGSQL 7.4.1): > > CREATE TABLE readings( "when" timestamp, value integer ); > > The summary will be based on various time periods. I've been using date_trunc( > 'hour', "when" ) and GROUP BY for the min/max/average readings with no prob