Re: [SQL] FOREIGN KEYs ... I think ...

2006-01-04 Thread nospam
> Now, what I want to do is add a FOREIGN KEY (again, I think) that when > incident_summary.status is changed (either closed, or reopened), the > associated records in incident_comments are changed to the same state ... As the other responders mentioned, from the schema you described, it doesn't l

Re: [SQL] FOREIGN KEYs ... I think ...

2006-01-04 Thread Jim Johannsen
Marc Is the "assumption" that anytime there are comments the status changes? If I'm reading between the lines correctly, there could be a large number of comments before the status changes. So no need to change status until explicitly needed. If there is a specific "comment" th

Re: [SQL] FOREIGN KEYs ... I think ...

2006-01-04 Thread Marc G. Fournier
On Wed, 4 Jan 2006, Tom Lane wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: Now, what I want to do is add a FOREIGN KEY (again, I think) that when incident_summary.status is changed (either closed, or reopened), the associated records in incident_comments are changed to the same state ..

Re: [SQL] FOREIGN KEYs ... I think ...

2006-01-04 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > Now, what I want to do is add a FOREIGN KEY (again, I think) that when > incident_summary.status is changed (either closed, or reopened), the > associated records in incident_comments are changed to the same state ... Why not just get rid of the s

[SQL] FOREIGN KEYs ... I think ...

2006-01-04 Thread Marc G. Fournier
I'm not sure if I'm looking at (for) the right thing or not, but if I am, then I'm not finding any useful examples :( I have two tables, simplified as: CREATE TABLE incident_summary ( id serial, subject text, status boolean ); CREATE TABLE incident_comments ( id serial, incident_id

[SQL] JOIN question with multiple records

2006-01-04 Thread Scott, Casey
I have 2 tables. One containing information about servers, and the other containing information about IP addresses. E.G. Server table: namemac mac2 - SERVER1 00:0d:56:ba:ad:92 SERVER2 00:0d:56

Re: [SQL] Regular Expression Matching problem...

2006-01-04 Thread Michael Fuhr
On Wed, Jan 04, 2006 at 03:50:31PM +0100, A. Kretschmer wrote: > Try this: > > test=# select '+385911234567', operator_phonenumber_pattern, '+385911234567' > ~ replace(operator_phonenumber_pattern,'','\\') from operators; >?column?| operator_phonenumber_pattern | ?column? > --

Re: [SQL] Regular Expression Matching problem...

2006-01-04 Thread A. Kretschmer
am 04.01.2006, um 15:08:45 +0100 mailte Mario Splivalo folgendes: > I have a table containing regular expresion patterns for matching phone > numbers with the mobile operators. > > For instance, my phone number is '+385911234567', and the regexp for > this mobile operator is: "^\+38591\d{7}$". >

[SQL] Regular Expression Matching problem...

2006-01-04 Thread Mario Splivalo
I have a table containing regular expresion patterns for matching phone numbers with the mobile operators. For instance, my phone number is '+385911234567', and the regexp for this mobile operator is: "^\+38591\d{7}$". Now, when I do a regexp match in a single select, it behaves as expected: oct

Re: [SQL] Loading lots of data in a SQL command

2006-01-04 Thread Richard Huxton
frank church wrote: I am load lots of data via SQL into a database and wrapping it into transactions speeds it up. However this fails a number of times. The queries results are logged so it is easy for me to find problem records. However a single failure causes the whole transaction to fail. >