Re: [SQL] increment int value in subset of rows?

2003-11-24 Thread Matthew Lunnon
You could write a function to do it.   Matthew   - Original Message - From: george young To: [EMAIL PROTECTED] Sent: Monday, November 24, 2003 1:59 AM Subject: [SQL] increment int value in subset of rows? [postgresql 7.4, SuSE x86 linux]I have a table "rtest" wit

[SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread vijaykumar M
Hi All, Is their any way to read the bytea contents by using pgsql script. Thanks & regards Vijay _ BharatMatrimony.com. http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 India's premium matrimonial website. --

Re: [SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread Christoph Haller
> > Hi All, > Is their any way to read the bytea contents by using pgsql script. > > Thanks & regards > Vijay > > _ > Not sure if that's what you are asking for but you can do e.g. $PGSQLD/bin/psql -d -f ./query2.txt > ./quer

Re: [SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread vijaykumar M
Hi Christoph, Thanks for ur reply. Let me explain my problem..., In one of my table.. we used bytea datatype for one field.. actaully i want to know the original stored contents (not in byte's) from that field by using pgsql scripts. Thanks in advance.. With regards Vijay From: Chr

Re: [SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread Christoph Haller
> > Hi Christoph, > Thanks for ur reply. > Let me explain my problem..., In one of my table.. we used bytea > datatype for one field.. actaully i want to know the original stored > contents (not in byte's) from that field by using pgsql scripts. > > Thanks in advance.. > > With regar

Re: [SQL] increment int value in subset of rows?

2003-11-24 Thread george young
On Mon, 24 Nov 2003 09:21:39 - "Matthew Lunnon" <[EMAIL PROTECTED]> threw this fish to the penguins: > You could write a function to do it. > > Matthew That would save me the external interaction, but still amount to ~1000 sql queries -- I'm hoping to find something O(0), i.e. a few queries

[SQL] Maintaining an order for a group of records

2003-11-24 Thread Bruno De Fraine
Hello group, I'm looking for a neat way to accomplish the following with PostgreSQL. In a table, I have a group of records for which I want to store an order. The order has nothing to do with the data of the records; on the contrary, the order of the records might change without the (other) dat

Re: [SQL] increment int value in subset of rows?

2003-11-24 Thread Matthew Lunnon
Ok so what about using a constraint to enforce you uniqueness and then either inside a transaction or after locking the table drop the constraint, do the update and then re-add the constraint. I am not sure how fast this would be since I guess that adding the constraint may take some time! Y

Re: [SQL] increment int value in subset of rows?

2003-11-24 Thread Chester Kustarz
here is a work-a-round: # create table t (a int, primary key (a)); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 't_pkey' for table 't' CREATE # insert into t values (1); # insert into t values (1); ERROR: Cannot insert a duplicate key into unique index t_pkey # insert into t val

Re: [SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread vijaykumar M
Hi Christoph, Yes, U catched my problem, i want to know the original stored contents (not in byte form). With thanks and regards Vijay From: Christoph Haller <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] (vijaykumar M) CC: [EMAIL PROTECTED] Subject: Re: [SQL] how to read bytea contents by using