Re: [SQL] INSERT INTO

2007-03-16 Thread Josh Williams
From: "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]> > I have 2 tables. TABLE1 and TABLE2. > > TABLE1 has about 400 records with details (client code, name, surname, > address, date of birth) of my clients. > TABLE2 is filled with some of the client details and other extra details > (client cod

Re: [SQL] log file permissions?

2007-03-16 Thread Tom Lane
Gerardo Herzig <[EMAIL PROTECTED]> writes: > Hi dudes. I have my pg log file rotation configured so i have a > psql_`today`.log. The thing is, can i configure postgres so the file > permissions (today is 600) could by 640, so developers could login and > tailf the logfile (without using the post

Re: [SQL] log file permissions?

2007-03-16 Thread Steve Crawford
Gerardo Herzig wrote: > Hi dudes. I have my pg log file rotation configured so i have a > psql_`today`.log. The thing is, can i configure postgres so the file > permissions (today is 600) could by 640, so developers could login and > tailf the logfile (without using the postgres superuser, course)?

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Tom Lane
"Travis Whitton" <[EMAIL PROTECTED]> writes: > One last question, using the "weather report" example, is it going to > improve performance for the DISTINCT ON query to add an index to the > location and time columns? A two-column index matching the ORDER BY that you use might help, or then again m

[SQL] log file permissions?

2007-03-16 Thread Gerardo Herzig
Hi dudes. I have my pg log file rotation configured so i have a psql_`today`.log. The thing is, can i configure postgres so the file permissions (today is 600) could by 640, so developers could login and tailf the logfile (without using the postgres superuser, course)? Thanks! Gerardo --

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Travis Whitton
One last question, using the "weather report" example, is it going to improve performance for the DISTINCT ON query to add an index to the location and time columns? Thanks a lot, Travis On 3/16/07, Tom Lane <[EMAIL PROTECTED]> wrote: "Travis Whitton" <[EMAIL PROTECTED]> writes: > Given the fo

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Tom Lane
"Travis Whitton" <[EMAIL PROTECTED]> writes: > Given the following test table, I want to grab only the newest record and > disregard any older duplicates based on name. Is this the most efficient way > to do it? No, it's gonna be pretty awful. The best way I know of involves DISTINCT ON (see the

[SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Travis Whitton
Given the following test table, I want to grab only the newest record and disregard any older duplicates based on name. Is this the most efficient way to do it? Will the indicies even make a difference? The table below demonstrates a simple proof of concept. My final table will have millions of re

Re: [SQL] INSERT INTO

2007-03-16 Thread Alvaro Herrera
Shavonne Marietta Wijesinghe wrote: > Thanks alot What happens if you try to insert a string with $$ on it? -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---(end of broa

Re: [SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
Thanks alot ^_^ Shavonne Wijesinghe http://www.studioform.it - Original Message - From: "Richard Broersma Jr" <[EMAIL PROTECTED]> To: "Richard Broersma Jr" <[EMAIL PROTECTED]>; "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]>; Sent: Friday, March 16, 2007 2:08 PM Subj

Re: [SQL] INSERT INTO

2007-03-16 Thread Richard Broersma Jr
> INSERT INTO TABLE2 (TE_INDI) VALUES ($SANT'ANGELO LODIGIANO$); My mistake, a single $ will not work you need two like $$: INSERT INTO TABLE2 (TE_INDI) VALUES ($$SANT'ANGELO LODIGIANO$$); Regards, Richard Broersma Jr. ---(end of broadcast)--- T

Re: [SQL] INSERT INTO

2007-03-16 Thread Richard Broersma Jr
> When i have a string that has a ' inside of it the record is not inserted in > to TABLE2. I know > that writing it twice will fix it but how can i ask my ASP code to do it.. > > INSERT INTO TABLE2 (TE_INDI) VALUES ('SANT'ANGELO LODIGIANO'); If you are using PostgreSQL >= 8.0 you can use dollar

Re: [SQL] INSERT INTO

2007-03-16 Thread Guillaume Lelarge
Shavonne Marietta Wijesinghe a ecrit le 16/03/2007 11:31: i took a look at the link Guillaume gave me. But it also explains on PHP i'm using ASP :( Yes, that's why I said that it didn't answer your question. Sorry if this wasn't clear. After a bit of googling, I found the replace function.

Re: [SQL] Joins on many-to-many relations.

2007-03-16 Thread Wiebe Cazemier
On Wednesday 14 March 2007 22:59, Wiebe Cazemier wrote: > My question was mainly general; > if there is a better way than using subselects to join two tables which > are only connected to eachother through a join-table (containing only > references to the two tables in question). Subselects are us

Re: [SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
i took a look at the link Guillaume gave me. But it also explains on PHP i'm using ASP :( - Original Message - From: "Guillaume Lelarge" <[EMAIL PROTECTED]> To: "Bart Degryse" <[EMAIL PROTECTED]> Cc: ; "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]> Sent: Friday, March 16, 2007 10

Fw: [SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
thanks.. i will take a look at the link Shavonne Wijesinghe http://www.studioform.it Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque destinate esclusivamente alle persone o alla Società sopra indicati. La diffusione, distr

Re: [SQL] INSERT INTO

2007-03-16 Thread Guillaume Lelarge
Bart Degryse a ecrit le 16/03/2007 10:03: I don't use ASP but in PHP I would do something in the line of $valuetoinsert = "SANT'ANGELO LODIGIANO"; $query = "INSERT INTO TABLE2 (TE_INDI) VALUES ('" . str_replace("'", "''", $valuetoinsert) . "')"; I'm sure ASP has also a string replacement fun

Re: [SQL] INSERT INTO

2007-03-16 Thread Bart Degryse
I don't use ASP but in PHP I would do something in the line of $valuetoinsert = "SANT'ANGELO LODIGIANO"; $query = "INSERT INTO TABLE2 (TE_INDI) VALUES ('" . str_replace("'", "''", $valuetoinsert) . "')"; I'm sure ASP has also a string replacement function >>> "Shavonne Marietta Wijesinghe" <[

[SQL] INSERT INTO

2007-03-16 Thread Shavonne Marietta Wijesinghe
Hello I have 2 tables. TABLE1 and TABLE2. TABLE1 has about 400 records with details (client code, name, surname, address, date of birth) of my clients. TABLE2 is filled with some of the client details and other extra details (client code, address, telephone, etc) So in my ASP page i have a sel