Re: [GENERAL] Establishing a primary key

2007-06-22 Thread Charles Simard
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bob Pawley > Sent: 22 juin 2007 14:15 > To: Postgresql > Subject: [GENERAL] Establishing a primary key > > > I have numerous entries in a column of table 1, some of which are duplicated. > > I need to transfe

Re: [GENERAL] Count

2008-01-23 Thread Charles Simard
l); select id_test, (case when c1 is null then 0 else 1 end)+(case when c2 is null then 0 else 1 end)+(case when c3 is null then 0 else 1 end)+(case when c4 is null then 0 else 1 end) as total from test; id_test | total -+--- 1 | 2 2 | 3

Re: [GENERAL] cast problem 8.3.1

2008-03-20 Thread Charles Simard
|> |> postgres error log: |> ERROR: operator does not exist: text = integer |> HINT: No operator matches the given name and argument type(s). You |> might need to add explicit type casts. |> STATEMENT: update T_MON_DEVICE_STATUS set device_ip = $1 :: inet |> , status = $2 :: integer

Re: [GENERAL] Converting mysql "on update" to postgres "rule"

2008-03-25 Thread Charles Simard
|> I've tried multiple iterations of how to accomplish this and keep getting stuck. With the one above, postgres yells and says: |> ERROR: infinite recursion detected in rules for relation "visit" |> |> Any ideas? Look at http://www.postgresql.org/docs/8.3/interactive/plpgsql-trigger.html --

FW: [GENERAL] finding firstname + lastname groups

2008-06-19 Thread Charles Simard
; Thanks! Use string concatenation : http://www.postgresql.org/docs/8.3/interactive/functions-string.html#FUNCTIO NS-STRING-SQL select firstname || ' ' || lastname as name, count(firstname || lastname) from people having count(firstname || lastname) > 1; Regards, C

Re: [GENERAL] regexp help

2008-07-09 Thread Charles Simard
o make changes to your subscription: |> http://www.postgresql.org/mailpref/pgsql-general |> SELECT substring(addressline1 from '(^[^0-9]+)') from addresses Cordialement, Charles Simard -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Hi there, new here and have question

2008-07-11 Thread Charles Simard
ind 'setof' but have no idea on how to use it |> |> Any suggestion everyone? |> |> Thank you, |> Regards, |> Hendra I believe you are looking for this: http://www.postgresql.org/docs/8.3/interactive/xfunc-sql.html#AEN40331 Good day, Charles Simard -- Sent via pg