[SQL] About i8n

2001-06-07 Thread David BOURIAUD
Hi the list ! I principally use postgres with php, but I think that for my question, it remains the same... Is there a way to have all error messages returned by the back-end translated into french or another language ? If so, how to set it up ? Thanks by advance. -- David BOURIAUD --

[SQL] About table column names.

2001-06-07 Thread David BOURIAUD
Hi the list ! As far as I know, column names for a table can't contain any space, tabs, and other sort of "exotic" characters. Is there a way to add a description of a table column anywhere in postgres tables, or does it have to be handled manually by creating a custum table handling this kind of

Re: [SQL] About table column names.

2001-06-07 Thread Mark Stosberg
David BOURIAUD wrote: > > Hi the list ! > As far as I know, column names for a table can't contain any space, > tabs, and other sort of "exotic" characters. In fact, I know you can have at least spaces in your column names, like this: mark=> create table t ("column one" text); CREATE Just put

[SQL] dropping constraints

2001-06-07 Thread Linh Luong
Hi, Is there to drop a constraint when you add it separately with an alter statement. alter table failuretypecategory1 add constraint fk_failuretypecategory1 FOREIGN KEY (failurecategory1id) REFERENCES failurecategory1 (id) ON UPDATE CASCADE ON DELETE CASCADE; I tried drop trigger on failu

Re: [SQL] Re: About i8n

2001-06-07 Thread David BOURIAUD
"J.H.M. Dassen (Ray)" wrote: > > David BOURIAUD <[EMAIL PROTECTED]> wrote: > > Is there a way to have all error messages returned by the back-end > > translated into french or another language ? > > http://www.de.postgresql.org/devel-corner/docs/postgres/nls.html Thanks, but it doesn't help in a

Re: [SQL] dropping constraints

2001-06-07 Thread Stephan Szabo
You probably need to make sure to double quote the tgname in your drops. On Thu, 7 Jun 2001, Linh Luong wrote: > Hi, > > Is there to drop a constraint when you add it separately with an alter > statement. > > alter table failuretypecategory1 add constraint fk_failuretypecategory1 > FOREIGN K

[SQL] Getting row with id=max(id)

2001-06-07 Thread Gerald Gutierrez
I'd like to retrieve a row of a table that has the maximum ID. For example, with: id | s +--- 1 | alpha 2 | beta 3 | gamma 4 | delta I'd like to get the row with ID=4. I've tried: SELECT * FROM mytable WHERE id=(SELECT MAX(id) FROM mytable); The subquery can take a /r

[SQL] Are SQL commands "atomic" ?

2001-06-07 Thread Gerald Gutierrez
I'm using 7.1.1 right now, and have the following table: id | s +--- 1 | alpha 2 | beta 3 | gamma 4 | delta (4 rows) I'd like to switch the id of "beta" to 3 and the id of "gamma" to 2 ("flip" them). Since id is the PK, it must remain unique and so I can't just set the

[SQL] UPDATE with concatenate

2001-06-07 Thread Laurent Patureau
Hy, I try to update a table:col with take the valueof this col and concatenate it with $val. I don't want to select all value of table:col and addition $val at each one I try : UPDATE table SET col .= '$val' But it doesn't work, any suggestion ? pat ---(end of broa

Re: [SQL] Are SQL commands "atomic" ?

2001-06-07 Thread Stephan Szabo
On Thu, 7 Jun 2001, Gerald Gutierrez wrote: > > I'm using 7.1.1 right now, and have the following table: > > id | s > +--- >1 | alpha >2 | beta >3 | gamma >4 | delta > (4 rows) > > I'd like to switch the id of "beta" to 3 and the id of "gamma" to 2 ("flip" > them).

Re: [SQL] UPDATE with concatenate

2001-06-07 Thread Stephan Szabo
Maybe this? update table set col = col || '$val'; On Thu, 7 Jun 2001, Laurent Patureau wrote: > Hy, > > I try to update a table:col with take the valueof this col and concatenate > it with $val. > I don't want to select all value of table:col and addition $val at each one > > I try : > > UP

Re: [SQL] Are SQL commands "atomic" ?

2001-06-07 Thread Gerald Gutierrez
At 10:39 AM 6/7/2001 -0700, Stephan Szabo wrote: >Not exactly. It's a bug in the implementation of the unique constraint. >The unique constraint is being checked per-row rather than per-statement. Is this bug on a todo list, or should I submit a bug report? ---(end of

Re: [SQL] Getting row with id=max(id)

2001-06-07 Thread Gerald Gutierrez
At 07:31 PM 6/7/2001 +0200, Peter Eisentraut wrote: > > SELECT * FROM mytable WHERE id=(SELECT MAX(id) FROM mytable); > > SELECT * FROM mytable ORDER BY id DESC LIMIT 1; >The second is generally thought to be faster, at least if you use the >latest version of PostgreSQL. This is quite amusing ac

Re: [SQL] Getting row with id=max(id)

2001-06-07 Thread Gerald Gutierrez
>=> explain select id from mytable order by seed desc limit 1; Oops, a cut & paste mistake. That should be: explain select id from mytable order by id desc limit 1; ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.

[SQL] Forein Key Problem

2001-06-07 Thread Dennis
Is This s bug: create table A ( key varchar(20) not null primary key ); create table B ( id serial not null primary key, col1 varchar(20) not null, col2 varchar(20) not null ); alter table B create constraint fk_col1 foreign key ( col1 ) references A ( key ) on

Re: [SQL] plperl

2001-06-07 Thread Clayton Cottingham aka drfrog
Time Co-Ordinate Tue, 05 Jun 2001 19:45:55 -0400, The Organism labeled Tom Lane said: > clayton cottingham <[EMAIL PROTECTED]> writes: > > how does one execute an sql statement from inside a plperl function? > > At the moment, one doesn't. > > This is one of a number of features that have