[GENERAL] About table schema

2004-05-25 Thread Wei Shi
Hi, does anyone know how to get the schema information of a table. More specifically, I would like to know 1. which field(s) are primary keys? 2. the data type of each field of a table? 3. If a field is a foreign key, what field/table it is referring to. Thanks. Wei

Re: [GENERAL] About table schema

2004-05-25 Thread Janning Vygen
Am Mittwoch, 26. Mai 2004 00:36 schrieb Wei Shi: > Hi, does anyone know how to get the schema information > of a table. More specifically, I would like to know > > 1. which field(s) are primary keys? > 2. the data type of each field of a table? > 3. If a field is a foreign key, what field/table it

[GENERAL] unix_socket

2004-05-25 Thread Tom Allison
I'm trying to configure postfix to use the postgres database for lookups. Since I have a localhost based server, I was going to use unix_sockets. The postgres docs call for only a /directory. unix_socket_directory (string) Specifies the directory of the Unix-domain socket on which the ser

Re: [GENERAL] unix_socket

2004-05-25 Thread Tom Lane
Tom Allison <[EMAIL PROTECTED]> writes: > I'm trying to configure postfix to use the postgres database for lookups. > Since I have a localhost based server, I was going to use unix_sockets. > The postfix docs call for a /directory/name. >inet: for TCP connections (default). Exampl

Re: [GENERAL] unix_socket

2004-05-25 Thread Tom Allison
Tom Allison wrote: I'm trying to configure postfix to use the postgres database for lookups. Since I have a localhost based server, I was going to use unix_sockets. The postgres docs call for only a /directory. unix_socket_directory (string) Specifies the directory of the Unix-domain socket

[GENERAL] timestamps

2004-05-25 Thread Tom Allison
How would I specify a field that's to be updated to current_time everytime the row is created/altered? Is there some way to put this 'update' property into the table instead of running some query to do it? ---(end of broadcast)--- TIP 7: don't for

Re: [GENERAL] Poatgresql database on more than one disk

2004-05-25 Thread Gaetano Mendola
Barry wrote: Hi All, I am a newcommer to Postgresql, currently I am looking at moving a Pick based application across to PostgreSQL. I am using RH Linux and Postgresql 7.3.6 The test system I am using has a 2 channel raid card with a disk pack connected to each channel. The OS and Postgresql sits o

Re: [GENERAL] timestamps

2004-05-25 Thread Larry Rosenman
--On Tuesday, May 25, 2004 20:52:22 -0400 Tom Allison <[EMAIL PROTECTED]> wrote: How would I specify a field that's to be updated to current_time everytime the row is created/altered? Is there some way to put this 'update' property into the table instead of running some query to do it? You are l

Re: [GENERAL] timestamps

2004-05-25 Thread Doug McNaught
Tom Allison <[EMAIL PROTECTED]> writes: > How would I specify a field that's to be updated to current_time > everytime the row is created/altered? Create a trigger. There are some good examples in the PL/pgSQL docs. > Is there some way to put this 'update' property into the table instead > of r

Re: [GENERAL] timestamps

2004-05-25 Thread Tom Allison
Doug McNaught wrote: Tom Allison <[EMAIL PROTECTED]> writes: How would I specify a field that's to be updated to current_time everytime the row is created/altered? Create a trigger. There are some good examples in the PL/pgSQL docs. Is there some way to put this 'update' property into the table

Re: [GENERAL] About table schema

2004-05-25 Thread Wei Shi
Is there a function interface to get this information other than from "psql" comman line interface? Thanks. Wei --- Janning Vygen <[EMAIL PROTECTED]> wrote: > Am Mittwoch, 26. Mai 2004 00:36 schrieb Wei Shi: > > Hi, does anyone know how to get the schema > information > > of a table. More speci

Re: [GENERAL] About table schema

2004-05-25 Thread Mike Mascari
Wei Shi wrote: Is there a function interface to get this information other than from "psql" comman line interface? If you start psql with the '-E' switch, you'll see the queries it generates to display the meta-data associated with the '\' command you issue. You may also query the tables and vie

Re: [GENERAL] About table schema

2004-05-25 Thread Wei Shi
This is great. Thanks. Wei --- Mike Mascari <[EMAIL PROTECTED]> wrote: > Wei Shi wrote: > > Is there a function interface to get this > information > > other than from "psql" comman line interface? > > If you start psql with the '-E' switch, you'll see > the queries it > generates to display t

[GENERAL] planer don't use index. bad plan for where id = x or id in (select ...)

2004-05-25 Thread Pavel Stehule
Hello, Pg make query 1. and 2. very fast (use index), but for query 3. dont use index. I can solve its using select union, but I readed so pg 7.5 don't problem with OR operator. I use cvs pg. I used vacuum analyze first. table sp_op_product has 15K rows, sp_op_uct 37K rows; regards Pavel Ste