[SQL] Update instead rules on Views

2004-11-02 Thread Markus Schaber
Hello, It seems that I have a fundamental misunderstanding how views work. See the following example: --- snip snap --- CREATE TABLE realdata (index int, data varchar, obsolete int); COPY realdata FROM STDIN; 1 hallo \N 2 test\N 3 blubb \N \. -- The obsolete row is a

Re: [SQL] 'show databases' in psql way?

2004-11-02 Thread lorid
\z will list the tables in the dbase \d tablename will list the columns in the table - Erik Wasser wrote: Hi list, how can I list the databases in a postgresish way? I know about the '-l' switch of 'psql' but is there a DBI/SQL-query way? I don't want to call an external pro

Re: [SQL] 'show databases' in psql way?

2004-11-02 Thread Achilleus Mantzios
O lorid έγραψε στις Nov 2, 2004 : > \z will list the tables in the dbase > \d tablename will list the columns in the table > or foodb=# SELECT oid,* from pg_database ; > - > Erik Wasser wrote: > > >Hi list, > > > >how can I list the databases in a postgresish way? I know

Re: [SQL] Update instead rules on Views

2004-11-02 Thread Markus Schaber
Helo, On Tue, 2 Nov 2004 13:05:07 +0100 Markus Schaber <[EMAIL PROTECTED]> wrote: > -- But to remain compatibility with old apps, we also need to manage > -- updates to the view, which are to be rewritten as follows: > CREATE RULE testview_update_rule > AS ON UPDATE TO testview DO INSTEAD >

Re: [SQL] 'show databases' in psql way?

2004-11-02 Thread Arash Zaryoun
in command line: psql template1 pgsql -l in PSQL: foodb=#> select datname from pg_database; - Arash >>> Achilleus Mantzios <[EMAIL PROTECTED]> 11/2/2004 10:21:06 AM >>> O lorid ** Nov 2, 2004 : > \z will list the tables in the dbase > \d tablename will list the columns in the table >

Re: [SQL] Update instead rules on Views

2004-11-02 Thread Markus Schaber
Hello, On Tue, 2 Nov 2004 16:20:37 +0100 Markus Schaber <[EMAIL PROTECTED]> wrote: > > -- But to remain compatibility with old apps, we also need to manage > > -- updates to the view, which are to be rewritten as follows: > > CREATE RULE testview_update_rule > > AS ON UPDATE TO testview DO INSTE

Re: [SQL] JOIN not being calculated correctly

2004-11-02 Thread Andrew Hammond
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Posting the EXPLAIN is a good, an EXPLAIN ANALYZE would be better (assuming your dataset is small enough for it to complete in this lifetime). You also need to include the following information: 1) The schema involved, including information about indexe

[SQL] vacuum analyze slows sql query

2004-11-02 Thread patrick ~
Greetings pgsql-sql, I have a very strange problem. Our production database is a fair sized db, structure wise, and quite huge data wise. We have a web/php based UI for our customer to manage the data in our application db. The customer complains that the UI is sluggish accessing certain pages a

[SQL] Insert/Update Perl Function involving two tables needing to by 'in sync'

2004-11-02 Thread Ferindo Middleton Jr
I am trying to write a Perl Function for one of the databases I'm building a web application for. This function is triggered to occur BEFORE INSERT OR UPDATE. This function is complex in that it involves fields in two different tables which need to be updated, where the updates one receives depend

Re: [SQL] 'show databases' in psql way?

2004-11-02 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To be pedantic about it, use: SELECT pg_catalog.quote_ident(datname) AS database FROM pg_catalog.pg_database ORDER BY 1; or if using version 8 or higher: SELECT pg_catalog.quote_ident(datname) AS database, pg_catalog.quote_ident(spcname) AS t