Re: [SQL] I am writing a MS SQL server conversion utility and am having an issue with timestamp

2005-01-15 Thread Michael Fuhr
On Fri, Jan 14, 2005 at 04:15:02PM -0500, Joel Fradkin wrote: > Any one have a good idea for dealing with a timestamp where only time is > available on some of the source records? TIMESTAMP values contain a date and time. If you have only times then they'll have to go in a TIME column or you'll

Re: [SQL] SQL design question: null vs. boolean values

2005-01-15 Thread Andrew Sullivan
On Sat, Jan 15, 2005 at 06:40:18AM -0800, j.random.programmer wrote: > field_foo char(1) check (field_foo in 'y', 'n') > > The second choice always implies that NULL means > unknown, > whereas for the first choice, unknown is coded as 'u'. NULL actually means "unknown". SQL uses 3-valued logic:

Re: [SQL] SQL design question: null vs. boolean values

2005-01-15 Thread Richard Huxton
j.random.programmer wrote: Hi all: I was wondering if anyone had recommendations for the following scenarios: (A) I have three radio boxes in the user form field_foo []yes []no []unknown These are mutually exclusive and user input is always required. So in the database, should I have someth

[SQL] SQL design question: null vs. boolean values

2005-01-15 Thread j.random.programmer
Hi all: I was wondering if anyone had recommendations for the following scenarios: (A) I have three radio boxes in the user form field_foo []yes []no []unknown These are mutually exclusive and user input is always required. So in the database, should I have something like: field_foo ch

[SQL] Split pg_dump script

2005-01-15 Thread Markus Schaber
Hello, The attached dump_split.sh script maybe helpful to some of you. It is called with a database name and a base file name. It first dumps out the schema and metadata of the database in a plain SQL file. After this, it dumps out the data, each table into its own file, compressed with bzip2. T

Re: [SQL] return value of the trigger function

2005-01-15 Thread Bruno Wolff III
On Mon, Jan 10, 2005 at 15:15:33 +0100, Jarek Pude?ko <[EMAIL PROTECTED]> wrote: > Hi > > I have big problem with a trigger function. > Defs: > > CREATE TABLE foo (id int2, name varchar(20)); > > foo.id cannot be serial or autoint because it will not be unique. > > Now I need a trigger that r

Re: [SQL] SQL Query Performance tips

2005-01-15 Thread PFC
If I understand well a person has all the free weapons which have a level <= to his own level, and of course all the weapons he bought. 1) get da weapons One query can only use one index. Bad for you ! Let's split the free and non-free weapons. 1a) free weapons S