Re: [GENERAL] Return types of a function

2006-02-11 Thread Andreas Kretschmer
Nalin Bakshi [EMAIL PROTECTED] schrieb: Hi! I have postgres installed in my machine and have a simple task to do. Step1) Fetch all the tables in the Database with name staerting with AA Step2) On each table you get fire a simple SQL query: select * from tablename; Step3) Right

[GENERAL] Adding pl/perl support

2006-02-11 Thread Craig
Hi I am quite new to PostgreSQL on freebsd (or anything other than windows). I installed PostgreSQL without perl support, but I would now like to add it. I have found posts about running ./configure --with-perl. I have done that, but now I am not sure of the correct way to add this

Re: [GENERAL] Adding pl/perl support

2006-02-11 Thread Andreas Kretschmer
Craig [EMAIL PROTECTED] schrieb: I installed PostgreSQL 8.1.0 from source. Any help will be much appreciated Try: createlang plperl your_db HTH, Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect.

Re: [GENERAL] Adding pl/perl support

2006-02-11 Thread Craig
Hi Andreas I explained the situation badly. I had originally installed from source WITHOUT perl support. I would now like to add it, please can you explain how I would do that without completely re-installing PostgreSQL? I had already tried the creatlang command Thanks Craig - Original

Re: [GENERAL]

2006-02-11 Thread Pandurangan R S
try using CACHE 1 (which is default) in the sequence defintion. http://www.postgresql.org/docs/8.1/static/sql-createsequence.html On 2/10/06, Jean-Christophe Roux [EMAIL PROTECTED] wrote: Hello, I have a table with and id field (primary key) which default value is the result of a sequence

Re: [GENERAL] Sequence skipping values

2006-02-11 Thread Jean-Christophe Roux
Hi Michael,I'm running PostgreSQL 7.4.5 on a shared wehosting, which means among other things that I have limited control over the database settings and capabilities, For instance, I cannot install languages and therefore I cannot write triggers.Yes you are right, I did not show one rule on

Re: [GENERAL] Adding pl/perl support

2006-02-11 Thread Jim Buttafuoco
just go to the src/pl/plperl directory and do a make make install, then the createlang command -- Original Message --- From: Craig [EMAIL PROTECTED] To: Andreas Kretschmer [EMAIL PROTECTED], pgsql-general@postgresql.org Sent: Sat, 11 Feb 2006 14:45:51 +0200 Subject: Re:

Re: [GENERAL] Last modification time

2006-02-11 Thread Doug McNaught
Johan Vromans [EMAIL PROTECTED] writes: Greetings, For a big application, I want to generate reports from the database and keep these on-line as long as they reflect the actual contents of the database. I only want to regenerate the reports when needed, i.e., when the database contents have

Re: [GENERAL] Last modification time

2006-02-11 Thread Karsten Hilbert
Use LISTEN/NOTIFY and a trigger. Karsten -- DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert: GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl ---(end of broadcast)--- TIP 5: don't forget to increase your free space map

[GENERAL] Storing a kazillion small blobs in postgresql. Smart?

2006-02-11 Thread Stefan Arentz
Hi there, I'm looking at the design for an application where i have to store potentially many gigabytes worth of small blobs of varying sizes (8K - 64K) in a database. I've always been told that it is smarter to store references to files in the database, and I think that is true in a lot of

Re: [GENERAL] Storing a kazillion small blobs in postgresql. Smart?

2006-02-11 Thread Steve Atkins
On Feb 11, 2006, at 9:41 AM, Stefan Arentz wrote: Hi there, I'm looking at the design for an application where i have to store potentially many gigabytes worth of small blobs of varying sizes (8K - 64K) in a database. I've always been told that it is smarter to store references to files

Re: [GENERAL] Storing a kazillion small blobs in postgresql. Smart?

2006-02-11 Thread Leonel Nunez
Stefan Arentz wrote: Hi there, I'm looking at the design for an application where i have to store potentially many gigabytes worth of small blobs of varying sizes (8K - 64K) in a database. I've always been told that it is smarter to store references to files in the database, and I think that

Re: [GENERAL] Sequence skipping values

2006-02-11 Thread Michael Fuhr
On Sat, Feb 11, 2006 at 06:06:21AM -0800, Jean-Christophe Roux wrote: Yes you are right, I did not show one rule on table topics: CREATE OR REPLACE RULE topics_last_administrator_id AS ON INSERT TO topics DO UPDATE topics SET last_administrator_id = new.administrator_id WHERE

Re: [GENERAL] Last modification time

2006-02-11 Thread Johan Vromans
Doug McNaught [EMAIL PROTECTED] writes: I would put an AFTER trigger on all the tables concerned that inserts a row into an audit table. [...] Audit tables are useful for other things too, if you can afford them. I think auditing is much too heavy for something simple as finding the last

Re: [GENERAL] Last modification time

2006-02-11 Thread Doug McNaught
Johan Vromans [EMAIL PROTECTED] writes: Doug McNaught [EMAIL PROTECTED] writes: I would put an AFTER trigger on all the tables concerned that inserts a row into an audit table. [...] Audit tables are useful for other things too, if you can afford them. I think auditing is much too heavy

[GENERAL] Out of memory error during updating huge table

2006-02-11 Thread Gabor Siklos
I'm trying to update a table in transaction mode with 300 million records in it, and I'm getting an out of memory error. ERROR: out of memory DETAIL: Failed on request of size 32. In transaction mode, I first delete all the records in the table and then try to use COPY to populate it again with

[GENERAL] psql -At -F export column from table to .csv

2006-02-11 Thread Nina
Hi , I think you maybe familiar with this command: psql -At -F , -c select ... query.csv My question is: is it possible to export several different columns from different tables into the same .csv file; something like: psql -At -F , -c select ... select ... select ... select ... query.csv

Re: [GENERAL] Last modification time

2006-02-11 Thread Philippe Ferreira
Yeah, LISTEN/NOTIFY is definitely a lighter-weight solution--I didn't think of that before. Hi, I'm interested too in using this method ! Can anyone give a simple example of how to use/implement it ? Or good links to clear/quick documentation about these functions ? Thank you, Philippe

Re: [GENERAL] Last modification time

2006-02-11 Thread Doug McNaught
Philippe Ferreira [EMAIL PROTECTED] writes: Yeah, LISTEN/NOTIFY is definitely a lighter-weight solution--I didn't think of that before. Hi, I'm interested too in using this method ! Can anyone give a simple example of how to use/implement it ? Or good links to clear/quick documentation

Re: [GENERAL] psql -At -F export column from table to .csv

2006-02-11 Thread Stephen Frost
* Nina ([EMAIL PROTECTED]) wrote: I think you maybe familiar with this command: psql -At -F , -c select ... query.csv My question is: is it possible to export several different columns from different tables into the same .csv file; something like: psql -At -F , -c select ... select ...

Re: [GENERAL] Last modification time

2006-02-11 Thread Johan Vromans
Doug McNaught [EMAIL PROTECTED] writes: Yeah, LISTEN/NOTIFY is definitely a lighter-weight solution--I didn't think of that before. LISTEN/NOTIFY looks like a synchronisation mechanism. You can notify a subscriber that something happened. But in my case, the report generating program runs only

[GENERAL] Each foo must have a bar

2006-02-11 Thread David Fetter
Folks, I'm trying to figure out how to enforce the following. Table foo has a primary key. Table bar has a foreign key to foo. So far so good. I'd also like to say, for each row in foo, there must be at least one row in bar. I've tried the following, but the check fails too soon. I also

Re: [GENERAL] Each foo must have a bar

2006-02-11 Thread Michael Fuhr
On Sat, Feb 11, 2006 at 12:56:36PM -0800, David Fetter wrote: I'm trying to figure out how to enforce the following. Table foo has a primary key. Table bar has a foreign key to foo. So far so good. I'd also like to say, for each row in foo, there must be at least one row in bar. Possibly

Re: [GENERAL] Out of memory error during updating huge table

2006-02-11 Thread Tom Lane
Gabor Siklos [EMAIL PROTECTED] writes: I'm trying to update a table in transaction mode with 300 million records in it, and I'm getting an out of memory error. The update per se shouldn't be a problem, but if you have AFTER ROW triggers on the table then the list of pending trigger events

Re: [GENERAL] Each foo must have a bar

2006-02-11 Thread Michael Glaesemann
On Feb 12, 2006, at 6:59 , Michael Fuhr wrote: On Sat, Feb 11, 2006 at 12:56:36PM -0800, David Fetter wrote: I'm trying to figure out how to enforce the following. Table foo has a primary key. Table bar has a foreign key to foo. So far so good. I'd also like to say, for each row in foo,

Re: [GENERAL] implicit cast of empty string to timestamp

2006-02-11 Thread James Harper
Not my application :( -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Saturday, 11 February 2006 01:59 To: James Harper Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] implicit cast of empty string to timestamp James Harper [EMAIL PROTECTED] writes:

[GENERAL] Seeking comments on schema design and data integrity

2006-02-11 Thread Tim Hart
List, I am by no means a DBA, but I'm developing a database app for our local little league. I would appreciate some comments regarding the following design. My major goal here is data integrity. I want reasonable performance, but I don't expect this database to be used as heavily as a