Re: [SQL] Make a column case insensitive

2004-08-08 Thread Tom Lane
=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= <[EMAIL PROTECTED]> writes: > When I use UTF-8 encoding for my database. upper and lower() functions > break (no longer process accented chars correctly). This is fixed for 8.0. regards, tom lane -

Re: [SQL] Make a column case insensitive

2004-08-08 Thread Pierre-Frédéric Caillaud
When I use UTF-8 encoding for my database. upper and lower() functions break (no longer process accented chars correctly). This is with the correct encoding [EMAIL PROTECTED] I think, for CTYPES et al. ---(end of broadcast)--- TIP 9: the planne

Re: [SQL] Make a column case insensitive

2004-08-08 Thread Jan Wieck
On 8/6/2004 11:29 AM, Gordon Ross wrote: Is it possible to make a column case insensitive, without having to pepper your SELECTs with lots of lower() function calls (and forgetting to do it at times !) (I'm on 7.4.3) With a little bit of legwork you can create an itext data type. It would just us

Re: [SQL] surrogate key or not?

2004-08-08 Thread Josh Berkus
Kenneth, > but why would anyone want to change the value of an autogenerated serial row? But if you're using a real key, it may need to change. The only reason *not* do do it that way is performance issues with CASCADE. -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] UNIQUE constraint

2004-08-08 Thread Michael Glaesemann
On Aug 7, 2004, at 3:25 AM, Sascha Ziemann wrote: CREATE TABLE example ( a integer, b integer, c integer, UNIQUE (a, c) ); But it is not clean to me. Does the above example mean that the list of pairs must be unique Yes. Does the following table fullfill the UNIQUE clause of the ex

Re: [SQL] Make a column case insensitive

2004-08-08 Thread Thomas Wegner
I create every time i need this, a copy of this field filled out by a trigger on insert and update that holds the upper (or lower for you) value of the orginal field like this: create table "users" ( "email" varchar(255), ... "u_email" varchar(255) ... ); CREATE OR REPLACE FUNCTION "public"."

[SQL] select

2004-08-08 Thread Knut P Lehre
I have a table with fields: id A B C D E F where id is an int4 primary key. In this table there is information like: 1 a1 b1 xxx xxx 2 a1 b1 xxx xxx xxx xxx 3 a2 b2 xxx

[SQL] UNIQUE constraint

2004-08-08 Thread Sascha Ziemann
Hi, I have a question about the UNIQUE constraint. The documentation describes this example: CREATE TABLE example ( a integer, b integer, c integer, UNIQUE (a, c) ); But it is not clean to me. Does the above example mean that the list of pairs must be unique or is it only a sho

Re: [SQL] Make a column case insensitive

2004-08-08 Thread Rod Taylor
On Fri, 2004-08-06 at 11:29, Gordon Ross wrote: > Is it possible to make a column case insensitive, without having to pepper your > SELECTs with lots of lower() function calls (and forgetting to do it at times !) You could make yourself a set returning function to do this job -- but that is proba