[SQL] How to view the list of tables?

2005-02-15 Thread Konstantin Danilov
Hello, list! I need to view the list of tables in a database. In MySQL I can do it with the command "SHOW TABLES". What about PostgreSQL? Can I also see somehow the datatypes of tables' fields? Konstantin ---(end of broadcast)--- TIP 8: explain ana

Re: [SQL] How to view the list of tables?

2005-02-15 Thread Dick Davies
* Konstantin Danilov <[EMAIL PROTECTED]> [0222 10:22]: > > Hello, list! > I need to view the list of tables in a database. In MySQL I can do it with > the command "SHOW TABLES". What about PostgreSQL? > Can I also see somehow the datatypes of tables' fields? \dt in psjl lists tables ( \d gives

Re: [SQL] [GENERAL] How to view the list of tables?

2005-02-15 Thread Richard Huxton
Konstantin Danilov wrote: Hello, list! I need to view the list of tables in a database. In MySQL I can do it with the command "SHOW TABLES". What about PostgreSQL? Can I also see somehow the datatypes of tables' fields? Konstantin "man psql" will show you details of how to operate the psql applica

Re: [SQL] How to view the list of tables?

2005-02-15 Thread Dick Davies
* Dick Davies <[EMAIL PROTECTED]> [0241 10:41]: > * Konstantin Danilov <[EMAIL PROTECTED]> [0222 10:22]: > > > > Hello, list! > > I need to view the list of tables in a database. In MySQL I can do it with > > the command "SHOW TABLES". What about PostgreSQL? > > Can I also see somehow the datatyp

Re: [SQL] How to view the list of tables?

2005-02-15 Thread Mihail Nasedkin
Hello, Konstantin. You wrote February, 15 2005 г., 15:16:57: KD> I need to view the list of tables in a database. In MySQL I KD> can do it with the command "SHOW TABLES". What about PostgreSQL? All tables: select ... from pg_catalog.pg_class where c.relkind='r'; All tables of the public schem

Re: [SQL] Constraint doesn't see a currently insertet record

2005-02-15 Thread KÖPFERL Robert
Thanks. I managed it via a trigger. > -Original Message- > From: Michael Fuhr [mailto:[EMAIL PROTECTED] > Sent: Sonntag, 13. Februar 2005 02:57 > To: KÖPFERL Robert > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] Constraint doesn't see a currently insertet record > > > On Fri, Feb

Re: [SQL] Working with XML.

2005-02-15 Thread George Weaver
Title: Message Hi Theo,   I'm not sure if it can be done with the xml contrib module.  You may want to install and work with the xml2 contrib module, which is more recent, has more extensive capabilities, and is easier to work with.   It will give you the result you want:   jan28-05=# select

[SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-15 Thread Andreas Joseph Krogh
Hi, I have the following table, with the query below to list entries from it where start_date IS NOT NULL: CREATE TABLE onp_crm_activity_log( id serial PRIMARY KEY, start_date timestamp, start_time timestamp, end_time timestamp, title varchar NOT NULL ); SELECT start_date, start_time, end_time,

Re: [SQL] Working with XML.

2005-02-15 Thread George Weaver
Title: Message Hi Theo,   You can find the source code for xml2 it in the 8 source tree http://www.postgresql.org/download/.   If you're working with an earlier version of PostgreSQL than 8, you may have to make some modifications to the contrib code to get it to compile and link properly - I

Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-15 Thread Rosser Schwarz
while you weren't looking, Andreas Joseph Krogh wrote: > Any idea how to achieve this? ... ORDER BY coalesce(start_date, '1900-01-01') ASC , coalesce(start_time, '1900-01-01') ASC; /rls -- :wq ---(end of broadcast)--- TIP 6: Have you searc

Re: [SQL] Making NULL entries appear first when ORDER BY

2005-02-15 Thread Ragnar Hafstað
On Wed, 2005-02-16 at 00:55 +, Andreas Joseph Krogh wrote: > SELECT start_date, start_time, end_time, title > FROM onp_crm_activity_log > WHERE start_date IS NOT NULL > ORDER BY start_date ASC, start_time ASC; > > start_date | start_time | end_time | title > ---

Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-15 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Now, as you see, touples with NULL in the "start_time"-field > appear "after" the others. I would like to make all entries > where start_time IS NULL apear *before* all the others. ORDER BY start_date, CASE WHEN start_time IS NULL THEN 0 ELSE 1 E

Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-15 Thread Bruno Wolff III
> > Now, as you see, touples with NULL in the "start_time"-field appear "after" > the others. I would like to make all entries where start_time IS NULL apear > *before* all the others. Any idea how to achieve this? SELECT start_date, start_time, end_time, title FROM onp_crm_activity_log WHERE s