RE: [SQL] INSERT [IGNORE] INTO TABLE

2000-10-31 Thread K Parker
>Not a good feature for me. Me neither, but... >Check existence and then insert or update. At least once a week I seem to be responding to this exact same suggestion. Somebody _please_ tell me if I'm the only one in the whole world who worries about race conditions? What's wrong with just m

Re: [SQL] fetching rows

2000-10-30 Thread K Parker
I hate to be the bearer of bad news, but if you're using PHP and you wanted to fetch just 25 rows at a time for a single page, and then fetch more when the user clicks on a NEXT button or link, you're completely out of luck. Each http transaction is completely separate and so you can't maintai

[SQL] Re: many-to-many mapping

2000-10-16 Thread K Parker
Am I the only one who's nervous about these two tables referencing each other like this? I would have a concern that this is being imposed, perhaps, by some external format that the data arrives in, and that a decently normalized design will have a simple all-key table containing nothing but seria

[SQL] Re: Cascading Deletes

2000-09-06 Thread K Parker
> 1. re_create your table set _ID as primary key This is not going to work unless a parent is prohibited from having more than one child. From the brief sample data supplied, this is clearly not the case. Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at htt

[SQL] Re: m4 macros plus PostgreSQL anyone?

2000-07-09 Thread K Parker
No advice, just a big question: why M4? I've made great use of M4 myself for gluing a constant- and macro-defining capability to languages that don't have such (even Foxpro--no, no, please don't ask!) but in this day and age perl would be far more expressive and capable for the things you are

[SQL] Re: unique sequences

2000-06-26 Thread K Parker
> Rather, each time you wish to do an insert, > query the existing data to see what the > maximum value is existing in the database. > Add 1 to that and use this as your new value. > This is guaranteed to not have any holes in > the sequence. True, but alas it _doesn't_ guarantee uniqueness, sinc

[SQL] Re: Wildcard in date field

2000-06-23 Thread K Parker
The suggest solution works: > SELECT * FROM my_table WHERE > date_part('month', col_name::datetime) = '06' > AND date_part('year', col_name::datetime) = > '2000'; But you can also just do a comparison: where col_name >= '2000-06-01' AND col_name <= '2000-06-30' Using the correct date f