Re: [GENERAL] how can i view deleted records?

2006-04-29 Thread Steve Atkins
On Apr 29, 2006, at 4:18 PM, Robby Russell wrote: On Apr 29, 2006, at 12:49 PM, Dan Black wrote: Hello, everybody! How can I view deleted records in table? SELECT * FROM recycle_bin; ;-) Just kidding... once you delete your records... they are gone. That's not true. Delete

Re: [GENERAL] how can i view deleted records?

2006-04-29 Thread Robby Russell
On Apr 29, 2006, at 12:49 PM, Dan Black wrote: Hello, everybody! How can I view deleted records in table? SELECT * FROM recycle_bin; ;-) Just kidding... once you delete your records... they are gone. You could restore your database... assuming that you have a backup. -Robby Robb

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-29 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > The general problem seems to be that a transaction has no way to promise > never to touch a specific table. Maybe some kind of "negative lock" > would help here - you'd do "exclude table foo from transaction" at the > start of your transaction, whi

Re: [GENERAL] Select / sub select? query... help...

2006-04-29 Thread Kenneth Downs
Jim Fitzgerald wrote: Hello - Probably would be better to ask, "how do I store this data?" Then the query writes itself. Put people in one table, put aliases in another. CREATE TABLE people ( person_id int ,first varchar(20) ,last varchar(20) ) CREATE TABLE aliases ( person_id in

Re: [GENERAL] Select / sub select? query... help...

2006-04-29 Thread John Sidney-Woollett
Not sure if I have this the right way round, but one option is a self-join select p2.first, p2.last, p1.first, p1.last from people p1, people p2 where p1.person_id = p2.alias and p2.isalias = true; Another is to use a sub-select as a column result (haven't checked the SQL for mistakes) select

[GENERAL] Select / sub select? query... help...

2006-04-29 Thread Jim Fitzgerald
Hello - I'm trying to figure out how to write a particular query and need some assistance. I imagine this is extremely simple. I have the table defined below with five records. This table keeps track of peoples names. Each person has a unique ID number ("person_id"). The table can also k

[GENERAL] how can i view deleted records?

2006-04-29 Thread Dan Black
Hello, everybody! How can I view deleted records in table? -- Verba volent, scripta manent Dan Black ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Help with unpredictable use of indexes on large tables...

2006-04-29 Thread Tom Lane
"John D. Burger" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Also I'd suggest trying >> select year from [table] group by year >> which is capable of using a hash aggregation approach; that will likely >> beat either of these plans. > Just out of curiosity, why doesn't the planner consider th

Re: [GENERAL] file I/O in plpgsql

2006-04-29 Thread Terry Lee Tucker
On Saturday 29 April 2006 10:23 am, Terry Lee Tucker <[EMAIL PROTECTED]> thus communicated: --> You cannot do that with plpgsql. You can use Perl in "trusted" mode and pass --> the query results to the Perl function which can write the output to a ffile. --> Correcting typeo: s/trusted/untruste

Re: [GENERAL] file I/O in plpgsql

2006-04-29 Thread Florian G. Pflug
Jessica M Salmon wrote: I'm trying to write out query results to a text file from within a plpgsql function, but having trouble. Can anyone tell me if this is possible? I'm trying to perform \o filename, then select, but it squawks about no destination for the select results. Any pointers? This i

Re: [GENERAL] file I/O in plpgsql

2006-04-29 Thread Terry Lee Tucker
On Friday 28 April 2006 03:47 pm, Jessica M Salmon <[EMAIL PROTECTED]> thus communicated: --> --> I'm trying to write out query results to a text file from within a plpgsql --> function, but having trouble. Can anyone tell me if this is possible? I'm --> trying to perform \o filename, then selec

Re: [GENERAL] file I/O in plpgsql

2006-04-29 Thread Andreas Kretschmer
Jessica M Salmon <[EMAIL PROTECTED]> schrieb: > > I'm trying to write out query results to a text file from within a plpgsql > function, but having trouble. Can anyone tell me if this is possible? I'm IIRC no, you don't have access to the file system. PLPGSQL is a *trusted* language. You have ac

Re: [GENERAL] configure: error

2006-04-29 Thread Florian G. Pflug
[EMAIL PROTECTED] wrote: I am trying to install PostgreSQL v.8.3.1. I have unpacked the gz and tar file. Next, I have executed the configure file. Then, I receive the following message: configure: error: no acceptable C compiler found in $PATH I think I have to get a C compiler and to install i

Re: [GENERAL] Help with unpredictable use of indexes on large tables...

2006-04-29 Thread John D. Burger
Tom Lane wrote: Also I'd suggest trying select year from [table] group by year which is capable of using a hash aggregation approach; that will likely beat either of these plans. Just out of curiosity, why doesn't the planner consider the same plan for the OP's original query: s

[GENERAL] file I/O in plpgsql

2006-04-29 Thread Jessica M Salmon
I'm trying to write out query results to a text file from within a plpgsql function, but having trouble. Can anyone tell me if this is possible? I'm trying to perform \o filename, then select, but it squawks about no destination for the select results. Any pointers? -Meghan -

[GENERAL] Repost: Problem with pg_ctl register -w

2006-04-29 Thread G. Ralph Kuntz, MD
I posted this to pgsql-admin but got no replies.   I am trying to add the -w option to the Windows NT service startup so that the service is really running before it returns (I have another service - tomcat - that depends on it).  I can add the -w, but when I try to start the postgresql serv

[GENERAL] configure: error

2006-04-29 Thread cehu120
I am trying to install PostgreSQL v.8.3.1. I have unpacked the gz and tar file. Next, I have executed the configure file. Then, I receive the following message: configure: error: no acceptable C compiler found in $PATH I think I have to get a C compiler and to install it. But, how and where can

[GENERAL] Postmaster process on port 10000

2006-04-29 Thread vka
Hi! We have a problem with our postmaster process, which normaly runs on port 5432. >From time to time it spawns another process which listens on port 1 - >which also happens to be the port for our own server. I don't find any configuration option which could cause this behaviour. Does a

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-29 Thread Florian G. Pflug
Csaba Nagy wrote: There is, I believe, a problem there; there is a scenario where data can get "dropped out from under" those old connections. This has been added to the TODO... http://www.postgresql.org/docs/faqs.TODO.html * Make CLUSTER preserve recently-dead tuples per MVCC requirements O

Re: [GENERAL] Order of triggers and sequences...

2006-04-29 Thread Terry Lee Tucker
On Saturday 29 April 2006 08:34 am, Alex Mayrhofer <[EMAIL PROTECTED]> thus communicated: --> Hi, --> --> i'm about to implement a trigger on a table with an id field populated by a --> sequence (the usual 'id SERIAL NOT NULL PRIMARY KEY'). --> --> Just a short (probably lame) question: Would a "

[GENERAL] Order of triggers and sequences...

2006-04-29 Thread Alex Mayrhofer
Hi, i'm about to implement a trigger on a table with an id field populated by a sequence (the usual 'id SERIAL NOT NULL PRIMARY KEY'). Just a short (probably lame) question: Would a "BEFORE INSERT" row level trigger already see a populated 'id' column, or would that happen after all triggers on t