Re: [SQL] Please help to wite the constraint.

2005-11-21 Thread Samer Abukhait
I can't understand why you are doing this big cycle.. but certainly when constraints can't help you.. you can use triggers to enforce integrity.. On 11/20/05, Grigory O. Ptashko <[EMAIL PROTECTED]> wrote: > Hello, everybody! > > I don't whether it is possible to do the following but anyway I can't

Re: [SQL] max() unexpected type conversion

2005-11-21 Thread Hélder M . Vieira
This is true of just about everything, not only max() -- there are *no* functions yielding varchar in recent PG releases Thanks for the information. I added an explicit cast to the max() output and it works fine. Anyway, for those using VB, this is potentially hazardous. Knowing that the underl

Re: [SQL] tid_le comparison for tuple id (ctid) values?

2005-11-21 Thread george young
On Mon, 21 Nov 2005 16:19:28 -0500 Tom Lane <[EMAIL PROTECTED]> threw this fish to the penguins: > george young writes: > >update steps set x=x||'X' from steps s where steps.key1=s.key1 and > > steps.key2=s.key2 and step.ctid > > But this fails because there is no less-than operator (or fun

Re: [SQL] unplanned sub-select error?

2005-11-21 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > I have a query: > insert into mtr_reg_v_wt (ropnum, inum, pnum, rquant, value, status, > ddate, fr_proj, to_proj) values (28985,1,1014,1,(select cost from > prd_part where pnum = 1014),'work','2005-Nov-15',50,75); > That used to work fine under 7.1.3 bu

[SQL] unplanned sub-select error?

2005-11-21 Thread Kyle Bateman
I have a query: insert into mtr_reg_v_wt (ropnum, inum, pnum, rquant, value, status, ddate, fr_proj, to_proj) values (28985,1,1014,1,(select cost from prd_part where pnum = 1014),'work','2005-Nov-15',50,75); That used to work fine under 7.1.3 but now gives the error: ERROR: cannot handle un

Re: [SQL] idea for a geographically distributed database: how best to implement?

2005-11-21 Thread Bath, David
On Thu, 17 Nov 2005 19:44, Andy Ballingall wrote: > I've got a database for a website which is a variant of the 'show stuff near > to me' sort of thing. > > Rather than host this database on a single server, I have a scheme in mind > to break the database up geographically so that each one can run

Re: [SQL] tid_le comparison for tuple id (ctid) values?

2005-11-21 Thread Tom Lane
george young writes: >update steps set x=x||'X' from steps s where steps.key1=s.key1 and > steps.key2=s.key2 and step.ctid But this fails because there is no less-than operator (or function) on > type "tid". Probably a good thing, too, since if there was it wouldn't have anything reliable to

[SQL] tid_le comparison for tuple id (ctid) values?

2005-11-21 Thread george young
[PostgreSQL 8.1.0 on i686-pc-linux-gnu] I would like to suggest that there be a less-than (or greater-than) operator for the 'tid' type. I used to use oid's for finding and distinguishing duplicate data. Now that oid's are not included by default (and I do not quarrel with that change), I though

Re: [SQL] max() unexpected type conversion

2005-11-21 Thread Tom Lane
"=?iso-8859-1?Q?H=E9lder_M._Vieira?=" <[EMAIL PROTECTED]> writes: > If max() operates on a 'varchar' type column, the result appears with 'text' > type. > Should I expect this behaviour in the current and later versions ? This is true of just about everything, not only max() -- there are *no* fun

[SQL] max() unexpected type conversion

2005-11-21 Thread Hélder M . Vieira
Hello. I'm having some trouble with an unexpected conversion performed by the max() function. If max() operates on a 'varchar' type column, the result appears with 'text' type. Should I expect this behaviour in the current and later versions ? I mention this because I'm using ODBC in VB, and