Re: [GENERAL] newbie how to access the information scheme

2015-02-25 Thread frank ernest
Thanks -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] newbie how to access the information scheme

2015-02-24 Thread Tomas Vondra
On 24.2.2015 19:58, John McKown wrote: > I normally do the command (in psql) > > \d+ > > But if you want an actual SQL statement, the above invokes: > > SELECT n.nspname as "Schema", > c.relname as "Name", > CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' > THEN 'materiali

Re: [GENERAL] newbie how to access the information scheme

2015-02-24 Thread John McKown
I normally do the command (in psql) \d+ But if you want an actual SQL statement, the above invokes: SELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WH

[GENERAL] newbie how to access the information scheme

2015-02-24 Thread frank ernest
Hello, I'd like to see all the tables in my data base, but can't figure out how to access th information scheme. Thanks -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] newbie question

2011-06-06 Thread Craig Ringer
On 06/07/2011 04:17 AM, Heine Ferreira wrote: Hi Does Postgresql utilize hyperthreading and multiple cores on the relevant processors on windows? Sort-of. PostgreSQL runs many processes, one per query. Each process has a single thread. This means that one query can use at most one CPU core,

Re: [GENERAL] newbie question

2011-06-06 Thread Dann Corbit
: [GENERAL] newbie question Hi Does Postgresql utilize hyperthreading and multiple cores on the relevant processors on windows? Thanks H.F.

Re: [GENERAL] newbie question

2011-06-06 Thread Chris Curvey
On Mon, Jun 6, 2011 at 4:17 PM, Heine Ferreira wrote: > Hi > > Does Postgresql utilize hyperthreading and multiple cores on the relevant > processors on windows? > > Thanks > > H.F. > > It certainly looks like it on my machine! As far as my Linux box can tell, the "hyperthreaded" CPUs just appear

[GENERAL] newbie question

2011-06-06 Thread Heine Ferreira
Hi Does Postgresql utilize hyperthreading and multiple cores on the relevant processors on windows? Thanks H.F.

Re: [GENERAL] newbie question - delete before insert

2010-11-20 Thread Sim Zacks
How do people implement insert or upate ( otherwise known as upsert ) behaviour in postgres i.e. insert a row if it's key does not exist in the database else update the existing row? I tried using an insert rule to delete any existing rows first then insert however this leads to infinitely r

Re: [GENERAL] newbie question - delete before insert

2010-11-20 Thread Ashish Karalkar
On 11/20/2010 02:43 PM, Thomas Kellerer wrote: > Grant Mckenzie wrote on 20.11.2010 07:00: >> How do people implement insert or upate ( otherwise known as upsert ) >> behaviour in postgres i.e. insert a row if it's key does not exist in >> the database else update the existing row? >> > > You can s

Re: [GENERAL] newbie question - delete before insert

2010-11-20 Thread Thomas Kellerer
Grant Mckenzie wrote on 20.11.2010 07:00: How do people implement insert or upate ( otherwise known as upsert ) behaviour in postgres i.e. insert a row if it's key does not exist in the database else update the existing row? You can simply send the UPDATE, if nothing was updated, it's safe to

[GENERAL] newbie question - delete before insert

2010-11-19 Thread Grant Mckenzie
Hi, a question that I imagine is a faq but have not been able to find much help. How do people implement insert or upate ( otherwise known as upsert ) behaviour in postgres i.e. insert a row if it's key does not exist in the database else update the existing row? I tried using an insert rule t

Re: [GENERAL] Newbie cannot create tablespace

2009-11-09 Thread Scott Marlowe
On Mon, Nov 9, 2009 at 3:12 PM, Richard Sickler wrote: > Hi List, > > I'm trying to create a tablespace using the following command copied > from pg_dumpall, > > CREATE TABLESPACE test OWNER postgres LOCATION 'd:/prodb'; > > I receive the following message > > ERROR:  directory "d:/proddb" is not

[GENERAL] Newbie cannot create tablespace

2009-11-09 Thread Richard Sickler
Hi List, I'm trying to create a tablespace using the following command copied from pg_dumpall, CREATE TABLESPACE test OWNER postgres LOCATION 'd:/prodb'; I receive the following message ERROR: directory "d:/proddb" is not empty a \db yields List of tablespaces Name| Owner |

Re: [GENERAL] [Newbie] UPDATE based on other table content

2009-10-29 Thread Daniel Chiaramello
Thom Brown a écrit : ... 2009/10/29 Daniel Chiaramello : Never mind, I found how finally: UPDATE product SET qty = qty+s_count FROM ( SELECT intermediate.product_id, count(*) AS s_count FROM intermediate, orders WHERE

Re: [GENERAL] [Newbie] UPDATE based on other table content

2009-10-29 Thread Thom Brown
2009/10/29 Daniel Chiaramello : > Never mind, I found how finally: > > UPDATE >   product > SET >   qty = qty+s_count > FROM ( >       SELECT >           intermediate.product_id, >           count(*) AS s_count >       FROM >           intermediate, >           orders >       WHERE >           orde

Re: [GENERAL] [Newbie] UPDATE based on other table content

2009-10-29 Thread Daniel Chiaramello
Never mind, I found how finally: UPDATE product SET qty = qty+s_count FROM ( SELECT intermediate.product_id, count(*) AS s_count FROM intermediate, orders WHERE orders.intermediate_id=intermediate.id GROUP BY

[GENERAL] [Newbie] UPDATE based on other table content

2009-10-29 Thread Daniel Chiaramello
Hello. I have a very basic question, relative to the following "problem". I have the following tables: product id qty intermediate id product_id orders intermediate_id I want to update the "qty" field of the "product" table by incrementing it each time there is an order in th

Re: [GENERAL] newbie table design question

2009-06-02 Thread Merlin Moncure
2009/6/1 Andrew Smith : > 2009/6/2 björn lundin >> >> > CREATE TABLE "DataImport" >> > ( >> >   "DataImportID" serial NOT NULL PRIMARY KEY, >> >   "Time" timestamp without time zone NOT NULL, >> >   "ID_ABC" integer NOT NULL, >> >   "ID_DEF" integer NOT NULL, >> >   "ID_HIJ" integer NOT NULL, >> >

Re: [GENERAL] newbie table design question

2009-06-02 Thread Grzegorz Jaśkiewicz
On Tue, Jun 2, 2009 at 2:27 PM, Merlin Moncure wrote: > _IF_ arrays fit your requirements, they are an extremely compact and > efficient way to store your data.  The requirements are exact..you > can't update or extract a single piece of data out of a block > efficiently.  While indexing techniqu

Re: [GENERAL] newbie table design question

2009-06-02 Thread Merlin Moncure
On Mon, Jun 1, 2009 at 8:41 AM, Sam Mason wrote: > On Mon, Jun 01, 2009 at 06:53:30AM -0500, Chris Spotts wrote: >> I just finished doing something very close to this - not quite once per >> minute, but close.  I started off with an array of integers and after about >> a month of it, I'm having to

Re: [GENERAL] newbie table design question

2009-06-01 Thread Andrew Smith
2009/6/2 björn lundin > > > CREATE TABLE "DataImport" > > ( > > "DataImportID" serial NOT NULL PRIMARY KEY, > > "Time" timestamp without time zone NOT NULL, > > "ID_ABC" integer NOT NULL, > > "ID_DEF" integer NOT NULL, > > "ID_HIJ" integer NOT NULL, > > etc > > ); > > Perhaps you want

Re: [GENERAL] newbie table design question

2009-06-01 Thread Scott Marlowe
2009/6/1 björn lundin : > >> CREATE TABLE "DataImport" >> ( >>   "DataImportID" serial NOT NULL PRIMARY KEY, >>   "Time" timestamp without time zone NOT NULL, >>   "ID_ABC" integer NOT NULL, >>   "ID_DEF" integer NOT NULL, >>   "ID_HIJ" integer NOT NULL, >>   etc >> ); > > Perhaps you want to not u

Re: [GENERAL] newbie table design question

2009-06-01 Thread björn lundin
> CREATE TABLE "DataImport" > ( >   "DataImportID" serial NOT NULL PRIMARY KEY, >   "Time" timestamp without time zone NOT NULL, >   "ID_ABC" integer NOT NULL, >   "ID_DEF" integer NOT NULL, >   "ID_HIJ" integer NOT NULL, >   etc > ); Perhaps you want to not use the "" around the table and column

Re: [GENERAL] newbie table design question

2009-06-01 Thread Grzegorz Jaśkiewicz
one word, horizontal structure. you are trying to sort 1500 colums, instead of creating 1500 rows per entry... -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] newbie table design question

2009-06-01 Thread Sam Mason
On Mon, Jun 01, 2009 at 06:53:30AM -0500, Chris Spotts wrote: > I just finished doing something very close to this - not quite once per > minute, but close. I started off with an array of integers and after about > a month of it, I'm having to redesign my way out of it. I've had to go the other w

Re: [GENERAL] newbie table design question

2009-06-01 Thread Chris Spotts
gsql-general-ow...@postgresql.org] On Behalf Of Sam Mason Sent: Monday, June 01, 2009 5:00 AM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] newbie table design question On Sun, May 31, 2009 at 11:54:09PM +0800, Andrew Smith wrote: > I'm a beginner when it comes to Postgresql, and have

Re: [GENERAL] newbie table design question

2009-06-01 Thread Sam Mason
On Sun, May 31, 2009 at 11:54:09PM +0800, Andrew Smith wrote: > I'm a beginner when it comes to Postgresql, and have a table design question > about a project I'm currently working on. I have 1500 data items that need > to be copied every minute from an external system into my database. The > ite

Re: [GENERAL] newbie table design question

2009-05-31 Thread Andrew Smith
On Mon, Jun 1, 2009 at 1:25 AM, Tom Lane wrote: > Andrew Smith writes: > > I'm a beginner when it comes to Postgresql, and have a table design > question > > about a project I'm currently working on. I have 1500 data items that > need > > to be copied every minute from an external system into m

Re: [GENERAL] newbie table design question

2009-05-31 Thread Tom Lane
Andrew Smith writes: > I'm a beginner when it comes to Postgresql, and have a table design question > about a project I'm currently working on. I have 1500 data items that need > to be copied every minute from an external system into my database. The > items have a timestamp, an identifier and a

[GENERAL] newbie table design question

2009-05-31 Thread Andrew Smith
Hi all, I'm a beginner when it comes to Postgresql, and have a table design question about a project I'm currently working on. I have 1500 data items that need to be copied every minute from an external system into my database. The items have a timestamp, an identifier and a value. For example:

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Tom Lane wrote: > Carl Sopchak writes: > > Here's what's around the error message in the log: > > > > SPI Proc: 3154128080 total in 398 blocks; 13664 free (178 chunks); > > 3154114416 used > > Hmm, so apparently some internal leak within the plpgsql engine. I'd be >

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Tom Lane
Carl Sopchak writes: > Here's what's around the error message in the log: > SPI Proc: 3154128080 total in 398 blocks; 13664 free (178 chunks); > 3154114416 used Hmm, so apparently some internal leak within the plpgsql engine. I'd be willing to look into this if you can provide a self-conta

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Tom Lane wrote: > Carl Sopchak writes: > > On Sunday, March 08, 2009, Gregory Stark wrote: > >> What do you mean you're running out of memory? > > > > "ERROR: Out of Memory" is what I meant when I said I was running out of > > memory! :-) This is returned by psql, but

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Alvaro Herrera wrote: > Carl Sopchak wrote: > > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now > > I'm running out of memory. I have 2Gb physical and 8Gb swap (after > > adding 4Gb). > > Do you have AFTER triggers on the involved tables? They ar

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Thomas Kellerer
Carl Sopchak wrote on 08.03.2009 17:37: or a way to run a function outside an implicit transaction No sensible DBMS will let you do _anything_ outside a transaction Thomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Tom Lane
Carl Sopchak writes: > On Sunday, March 08, 2009, Gregory Stark wrote: >> What do you mean you're running out of memory? > "ERROR: Out of Memory" is what I meant when I said I was running out of > memory! :-) This is returned by psql, but it is the postmaster process that > is hitting the wal

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
On Sunday, March 08, 2009, Gregory Stark wrote: > Carl Sopchak writes: > > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now > > I'm running out of memory. I have 2Gb physical and 8Gb swap (after > > adding 4Gb). > > What do you mean you're running out of memory? For most pa

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Alvaro Herrera
Carl Sopchak wrote: > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now I'm > running out of memory. I have 2Gb physical and 8Gb swap (after adding 4Gb). Do you have AFTER triggers on the involved tables? They are recorded on memory and we have no mechanism to spill to dis

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Gregory Stark
Carl Sopchak writes: > Well, the upgrade to 8.3 seemed to rid me of the command limit, but now I'm > running out of memory. I have 2Gb physical and 8Gb swap (after adding 4Gb). What do you mean you're running out of memory? For most part of Postgres that's only a problem if you've configured i

Re: [GENERAL] Newbie questions relating to transactions

2009-03-08 Thread Carl Sopchak
Well, the upgrade to 8.3 seemed to rid me of the command limit, but now I'm running out of memory. I have 2Gb physical and 8Gb swap (after adding 4Gb). Is there a way for me to run this outside of one huge transaction? This really shouldn't be using more than a few hundred megs of RAM (assumin

Re: [GENERAL] Newbie questions relating to transactions

2009-03-07 Thread Tom Lane
Carl Sopchak writes: > I have written a PL/pgSQL function that performs these calculations by > reading > the needed data, calculating, and saving the results. When run over a > smaller set of data, it works fine. But when I tried to run it over this > larger set of data, I got the error mes

[GENERAL] Newbie questions relating to transactions

2009-03-07 Thread Carl Sopchak
Hi, I'm new to pgsql (but not databases in general) and I've run into a roadblock that I'm having difficulty figuring out how to get around. Any help would be greatly appreciated! I'm using the database to store the results of calculations over data in some tables. There are a lot of data re

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-14 Thread Devrim GÜNDÜZ
On Tue, 2008-08-12 at 17:25 +0200, Daneel wrote: > > When I run > service postgresql initdb > I get > "se: [FAILED]". > However, /var/lib/pqsql/data is created and user postgres owns it. > > But then I run > service postgresql start > and the very same error occurs.. Anything in /var/lib/pgs

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-14 Thread Scott Marlowe
On Thu, Aug 14, 2008 at 4:18 AM, Daneel <[EMAIL PROTECTED]> wrote: > Martin Marques wrote: >> >> Daneel escribió: >>> >>> Daneel wrote: While going through http://wiki.postgresql.org/wiki/Detailed_installation_guides and typing service postgresql start as root I got >>

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-14 Thread Daneel
Scott Marlowe wrote: On Tue, Aug 12, 2008 at 9:25 AM, Daneel <[EMAIL PROTECTED]> wrote: While going through http://wiki.postgresql.org/wiki/Detailed_installation_guides and typing service postgresql start as root I got "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initializ

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-14 Thread Daneel
Martin Marques wrote: Daneel escribió: Daneel wrote: While going through http://wiki.postgresql.org/wiki/Detailed_installation_guides and typing service postgresql start as root I got "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first." When I r

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-14 Thread Daneel
Scott Marlowe wrote: PLEASE DON'T WRITE TO THIS LIST WITH A FAKE EMAIL ADDRESS. It's been discussed before, but it's rude and counterproductive. Just set up a filter / account that drops everything coming in, but don't stick the rest of us with your broken email behaviour I'm sorry, just foll

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-13 Thread Martin Marques
Daneel escribió: Daneel wrote: While going through http://wiki.postgresql.org/wiki/Detailed_installation_guides and typing service postgresql start as root I got "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first." When I run service postgresql i

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-13 Thread Scott Marlowe
PLEASE DON'T WRITE TO THIS LIST WITH A FAKE EMAIL ADDRESS. It's been discussed before, but it's rude and counterproductive. Just set up a filter / account that drops everything coming in, but don't stick the rest of us with your broken email behaviour On Tue, Aug 12, 2008 at 9:25 AM, Daneel <[EM

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-13 Thread Scott Marlowe
On Tue, Aug 12, 2008 at 9:25 AM, Daneel <[EMAIL PROTECTED]> wrote: > While going through > http://wiki.postgresql.org/wiki/Detailed_installation_guides > and typing > service postgresql start > as root I got > "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to > initialize the clus

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-13 Thread Martin Marques
Daneel escribió: While going through http://wiki.postgresql.org/wiki/Detailed_installation_guides and typing service postgresql start as root I got "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first." When I run service postgresql initdb I get "se

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-13 Thread Tom Lane
Daneel <[EMAIL PROTECTED]> writes: > When I run > service postgresql initdb > I get > "se: [FAILED]". > However, /var/lib/pqsql/data is created and user postgres owns it. Is there anything in /var/lib/pgsql/pgstartup.log ? How about the main /var/log/messages file? re

[GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-13 Thread Daneel
While going through http://wiki.postgresql.org/wiki/Detailed_installation_guides and typing service postgresql start as root I got "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first." When I run service postgresql initdb I get "se: [FAILED]". H

Re: [GENERAL] Newbie [CentOS 5.2] service postgresql initdb

2008-08-13 Thread Daneel
Daneel wrote: While going through http://wiki.postgresql.org/wiki/Detailed_installation_guides and typing service postgresql start as root I got "/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first." When I run service postgresql initdb I get "se:

Re: [GENERAL] newbie: update timestamp trigger?

2007-10-23 Thread Scott Marlowe
On 10/23/07, ahnf <[EMAIL PROTECTED]> wrote: > Whenever a row is updated in a table with a timestamp column. How do I write > a trigger to set that timestamp column to now() or the current timestamp? You should be able to take a virtual chainsaw to the example on this page and do it: http://www.

Re: [GENERAL] newbie: update timestamp trigger?

2007-10-23 Thread Rodrigo De León
On 10/23/07, ahnf <[EMAIL PROTECTED]> wrote: > Whenever a row is updated in a table with a timestamp column. How do I write > a trigger to set that timestamp column to now() or the current timestamp? Straight from the horse's mouth: http://www.postgresql.org/docs/8.2/static/plpgsql-trigger.html#P

[GENERAL] newbie: update timestamp trigger?

2007-10-23 Thread ahnf
Whenever a row is updated in a table with a timestamp column. How do I write a trigger to set that timestamp column to now() or the current timestamp? thanks ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] newbie question

2007-10-17 Thread Joris Dobbelsteen
>-Original Message- >From: Russell Aspinwall [mailto:[EMAIL PROTECTED] >Sent: woensdag 17 oktober 2007 11:37 >To: Joris Dobbelsteen >Subject: Re: [GENERAL] newbie question > >Joris Dobbelsteen wrote: >>> -Original Message- >>> From: [EMAIL

Re: [GENERAL] newbie question

2007-10-17 Thread Joris Dobbelsteen
>-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of >Russell Aspinwall >Sent: woensdag 17 oktober 2007 9:34 >To: pgsql-general@postgresql.org >Subject: [GENERAL] newbie question > >Hi, > >[snip] For example, if you had a

[GENERAL] newbie question

2007-10-17 Thread Russell Aspinwall
Hi, In the mid 1990's I used the Progress Database which had a great feature where the it was possible to set the software version in the configuration file. For example, if you had a built a database and application using version 3 and then upgraded the version 7, it was possible to set the

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread John D. Burger
SELECT min(x) FROM ( SELECT min(datecol1) AS x FROM table1 UNION ALL SELECT min(datecol2) AS x FROM table2 UNION ALL SELECT min(datecol3) AS x FROM table3 ) ss; Exercise for newbie: which of the AS clauses are redundant? Um, all of them? Yah, but only if you do this: SELECT min(*) FROM (

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread Lorenzo Thurman
Tom Lane wrote: "Dann Corbit" <[EMAIL PROTECTED]> writes: [EMAIL PROTECTED] On Behalf Of Lorenzo Thurman I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? Just do a union and return

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread Lorenzo Thurman
Lorenzo Thurman wrote: I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? TIA I think I have it, but if anyone has any comments, I'd appreciate it: select min(old) as oldest from (se

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread Lorenzo Thurman
Brent Wood wrote: Lorenzo Thurman wrote: I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? You could write a custom function doing the same sort of thing, or (perhaps more portable) u

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-09 Thread Brent Wood
Lorenzo Thurman wrote: I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? You could write a custom function doing the same sort of thing, or (perhaps more portable) use generic sqls & v

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-09 Thread Merlin Moncure
On 4/9/07, Tom Lane <[EMAIL PROTECTED]> wrote: "Dann Corbit" <[EMAIL PROTECTED]> writes: >> [EMAIL PROTECTED] On Behalf Of Lorenzo Thurman >> I have three tables using date fields. I want to retrieve the oldest >> date contained in the tables. Can someone show me an example of a query >> that wou

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-09 Thread Tom Lane
"Dann Corbit" <[EMAIL PROTECTED]> writes: >> [EMAIL PROTECTED] On Behalf Of Lorenzo Thurman >> I have three tables using date fields. I want to retrieve the oldest >> date contained in the tables. Can someone show me an example of a query >> that would do that? > Just do a union and return the min

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-09 Thread Dann Corbit
Just do a union and return the min > -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Lorenzo Thurman > Sent: Monday, April 09, 2007 7:32 AM > To: pgsql-general@postgresql.org > Subject: [GENERAL] NEWBIE: How do I g

[GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-09 Thread Lorenzo Thurman
I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? TIA ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Newbie questions (pg_global, tablespace, pg_temp, ...)

2007-01-17 Thread Alexi Gen
Hello, I'm new to postgreSQL (not databases) and trying to find my way arouund. Have a couple of questions: (a) In which dir is the pg_global stored? Is it "C:\Program Files\PostgreSQL\8.2\data\global"? (b) Why is the pg_tablespace.spclocation column=null for pg_default & pg_global? (c) When

Re: [GENERAL] Newbie questions (pg_global, tablespace, pg_temp, ...)

2007-01-17 Thread Martijn van Oosterhout
On Wed, Jan 17, 2007 at 07:02:13PM +0530, Alexi Gen wrote: > Hello, > > I'm new to postgreSQL (not databases) and trying to find my way arouund. > Have a couple of questions: > > (a) In which dir is the pg_global stored? > Is it "C:\Program Files\PostgreSQL\8.2\data\global"? Yes. > (b) Why is t

[GENERAL] Newbie questions (pg_global, tablespace, pg_temp, ...)

2007-01-17 Thread Alexi Gen
Hello, I'm new to postgreSQL (not databases) and trying to find my way arouund. Have a couple of questions: (a) In which dir is the pg_global stored? Is it "C:\Program Files\PostgreSQL\8.2\data\global"? (b) Why is the pg_tablespace.spclocation column=null for pg_default & pg_global? (c) When

Re: [GENERAL] Newbie Constraint ?

2007-01-09 Thread Bruno Wolff III
On Mon, Jan 08, 2007 at 14:55:29 -0600, Jeanna Geier <[EMAIL PROTECTED]> wrote: > > Not quite sure what the: CONSTRAINT "Relationship182" is exactly... can > anyone help me with this one? Haven't seen this one yet... It is the name of that particular constraint. You would use that if you wer

Re: [GENERAL] Newbie Constraint ?

2007-01-08 Thread Bricklen Anderson
Jeanna Geier wrote: Hello List! OK, so I'm new to SQL and Postgres and am working on taking over this DB work, and ran across a command that I'm not sure of and am wondering if you can help me with... Probably a basic SQL question, but thought more than one person on here would be able to poin

Re: [GENERAL] Newbie Constraint ?

2007-01-08 Thread Jeanna Geier
Hello List! OK, so I'm new to SQL and Postgres and am working on taking over this DB work, and ran across a command that I'm not sure of and am wondering if you can help me with... Probably a basic SQL question, but thought more than one person on here would be able to point me in the right dire

Re: [GENERAL] Newbie needs help with ERROR: could not write to file

2006-10-18 Thread Shane Ambler
Ron Johnson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/18/06 20:41, andrew plata wrote: I am trying to following the instructions at URL below to try to create a database called web_database required for phpPgAdmin. When I try to do this I get the following error: template1=# c

Re: [GENERAL] Newbie needs help with ERROR: could not write to file

2006-10-18 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/18/06 20:41, andrew plata wrote: > I am trying to following the instructions at URL below to try to create a > database called web_database required for phpPgAdmin. When I try to do this > I get the following error: > > template1=# create databa

Re: [GENERAL] Newbie needs help with ERROR: could not write to file

2006-10-18 Thread Chris
andrew plata wrote: I am trying to following the instructions at URL below to try to create a database called web_database required for phpPgAdmin. When I try to do this I get the following error: template1=# create database web_database owner web_user; ERROR: could not write to file "base/16

[GENERAL] Newbie needs help with ERROR: could not write to file "base/16390/2682": No space left on device

2006-10-18 Thread andrew plata
I am trying to following the instructions at URL below to try to create a database called web_database required for phpPgAdmin. When I try to do this I get the following error:template1=# create database web_database owner web_user; ERROR:  could not write to file "base/16390/2682": No space left o

Re: [GENERAL] Newbie question about importing text files...

2006-10-11 Thread Scott Marlowe
On Tue, 2006-10-10 at 04:16, Ron Johnson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 10/09/06 22:43, Jonathan Greenberg wrote: > > So I've been looking at the documentation for COPY, and I'm curious about a > > number of features which do not appear to be included, and whether

Re: [GENERAL] Newbie question about importing text files...

2006-10-10 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/09/06 22:43, Jonathan Greenberg wrote: > So I've been looking at the documentation for COPY, and I'm curious about a > number of features which do not appear to be included, and whether these > functions are found someplace else: > > 1) How do I

Re: [GENERAL] Newbie question about importing text files...

2006-10-10 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/10/06 01:44, Merlin Moncure wrote: > On 10/10/06, Jonathan Greenberg <[EMAIL PROTECTED]> wrote: >> So I've been looking at the documentation for COPY, and I'm curious >> about a >> number of features which do not appear to be included, and whethe

Re: [GENERAL] Newbie question about importing text files...

2006-10-09 Thread Merlin Moncure
On 10/10/06, Jonathan Greenberg <[EMAIL PROTECTED]> wrote: So I've been looking at the documentation for COPY, and I'm curious about a number of features which do not appear to be included, and whether these functions are found someplace else: 1) How do I skip an arbitrary # of "header" lines

[GENERAL] Newbie question about importing text files...

2006-10-09 Thread Jonathan Greenberg
So I've been looking at the documentation for COPY, and I'm curious about a number of features which do not appear to be included, and whether these functions are found someplace else: 1) How do I skip an arbitrary # of "header" lines (e.g. > 1 header line) to begin reading in data? 2) Is it possi

Re: [GENERAL] Newbie "Copy From" not working

2006-08-17 Thread Walter Vaughan
Michael Fuhr wrote: On Thu, Aug 17, 2006 at 03:27:26PM -0400, Walter Vaughan wrote: ERROR: missing data for column "processed_timestamp" The table you posted has 42 columns; at least one line in the file doesn't have that many fields. Yes, we didn't have the right number of columns... We

Re: [GENERAL] Newbie "Copy From" not working

2006-08-17 Thread Michael Fuhr
On Thu, Aug 17, 2006 at 03:27:26PM -0400, Walter Vaughan wrote: > Admin_=# COPY DATA_IMPORT_CUSTOMER FROM '/tmp/sold.pg' delimiter '|' null > ''; > ERROR: missing data for column "processed_timestamp" > CONTEXT: COPY data_import_customer, line 1: "(xxx) xxx-||Mary|Smith|76 > Crest Street||J

Re: [GENERAL] Newbie "Copy From" not working

2006-08-17 Thread Terry Lee Tucker
On Thursday 17 August 2006 03:27 pm, Walter Vaughan <[EMAIL PROTECTED]> thus communicated: > The problem is I need to load a field that is allowed to be null with > nothing and it work The above statement is not the problem you are having. We dumped and loaded a 4 gig Progress database with

[GENERAL] Newbie "Copy From" not working

2006-08-17 Thread Walter Vaughan
For the past few months we have been experimenting with using MySQL with Apache OFBiz. However, we are not sure that we can live with the performance. We have a large dataset that we wanted to import into PostgreSQL, but it seems to fail no matter what we do. We tried ever nuance we could to ge

Re: [GENERAL] newbie here

2006-07-27 Thread Chris
Thiago Germano Beier wrote: Hi all, I'm using postgresql version 8.1 on FREEBSD 6.x some info - bash-2.05b# pkg_info | grep post postgresql-client-8.1.4 PostgreSQL database (client) postgresql-docs-8.1.4 The PostgreSQL documentation set postgresql-relay-1.3.1 Multiplex multiple Postgre

[GENERAL] newbie here

2006-07-27 Thread Thiago Germano Beier
Hi all, I'm using postgresql version 8.1 on FREEBSD 6.x   some info - bash-2.05b# pkg_info | grep postpostgresql-client-8.1.4 PostgreSQL database (client)postgresql-docs-8.1.4 The PostgreSQL documentation setpostgresql-relay-1.3.1 Multiplex multiple PostgreSQL databases to one relaypost

Re: [GENERAL] Newbie help please....

2006-07-17 Thread Harald Armin Massa
Sue,you can walk an easier road to get your Excel Table filled with PostgreSQL data:there is an ODBC.Driver for PostgreSQL, you can google it or find it within the standard PostgreSQL for Windows Installer. After installing the ODBC driver, PostgreSQL is a normal data soure to Excel; you can put yo

Re: [GENERAL] Newbie help please....

2006-07-17 Thread Richard Broersma Jr
> I am relatively new to PostgreSQL, having only been exposed to it with > a recent DSpace implementation (in the last 8 months or so). I have created > a new database in PostgreSQL and have written a SQL query against the > database. The database resides on a Sunfire V440 Solaris 9 machine.

[GENERAL] Newbie help please....

2006-07-17 Thread Sue Walker-Thornton
Hi, I am relatively new to PostgreSQL, having only been exposed to it with a recent DSpace implementation (in the last 8 months or so).  I have created a new database in PostgreSQL and have written a SQL query against the database.  The database resides on a Sunfire V440 Solaris 9 machin

Re: [GENERAL] newbie : setting access for users in a web enviroment

2005-12-25 Thread Bruno Wolff III
On Sat, Dec 24, 2005 at 08:41:49 -0400, robert mena <[EMAIL PROTECTED]> wrote: > > If I'd need to define a user with SELECT privileges to all tables in > my test database, how could I do that? You can't. You can write a script that will give them access to all of the tables that currently exist

Re: [GENERAL] newbie : setting access for users in a web enviroment

2005-12-24 Thread robert mena
Hi, thanks for the reply. I've already read the docs. I am using 8.0.5 btw. One of the things I am confused is how can I give the privileges to the database without having to know the specific tables. The grant command when applied to a database simply mentions CREATE so the user can create ta

Re: [GENERAL] newbie : setting access for users in a web enviroment

2005-12-23 Thread Peter Eisentraut
Am Freitag, 23. Dezember 2005 22:06 schrieb robert mena: > GRANT CREATE,REFERENCES ON DATABASE test TO testadm; > > \z > Access privileges for database "test" > Schema | Name | Type | Access privileges > +--+--+--- > > How can I specify that the user testadm can per

Re: [GENERAL] newbie : setting access for users in a web enviroment

2005-12-23 Thread Qingqing Zhou
"robert mena" <[EMAIL PROTECTED]> wrote > > How can I specify that the user testadm can perform those actions to this > database? Use GRANT command (the opposite is REVOKE). I suppose you are using 8.1: http://www.postgresql.org/docs/8.1/static/sql-grant.html Regards, Qingqing -

[GENERAL] newbie : setting access for users in a web enviroment

2005-12-23 Thread robert mena
Hi, I am new to postgres but coming from a MySQL enviroment. I am confused with the necessary steps to create users and restrict them to access/delete/insert/update data and create/delete/alter tables in a specific database. I've created a database test and a user testadm createdb test create

Re: [GENERAL] Newbie Question: FAQ for database optimization?

2005-12-22 Thread David Fetter
On Tue, Dec 20, 2005 at 10:21:54PM +0100, Alexander Scholz wrote: > Hi, > > is there a newbie's FAQ / book / link for "howto optimize databases with > PostgreSQL"? > > Background: Customer has the Windows* (sorry ) Postgres 8.1.0 > standard installation "out of the box". A table has 2.5 mio reco

  1   2   3   >