Re: [GENERAL] index row size exceeds btree maximum, 2713 - Solutions?

2005-07-19 Thread Dennis Bjorklund
On Mon, 18 Jul 2005, Jaime Casanova wrote: > I don't think you could create indexes on text fields... there are > other type of indexes for that... tsearch2 for example You can index text fields, but you can't insert values bigger then BLOCKSIZE/3 when you have an index on that column. -- /Den

Re: [GENERAL] Optimizing query

2005-08-15 Thread Dennis Bjorklund
On Mon, 15 Aug 2005, Poul Møller Hansen wrote: > I have a problem creating a usable index for the following simple query: > SELECT * FROM my.table WHERE node = '10' ORDER BY id DESC LIMIT 1 > > id is a serial, so the query is to find the latest entry to a given node > and id is the primary key.

Re: [GENERAL] atomic function

2005-08-15 Thread Dennis Bjorklund
On Mon, 15 Aug 2005, Mage wrote: > 2005-08-12 19:08:43: ERROR: duplicate key violates unique constraint > "common_adviewnum_adid_site_day_index" Between your select and your insert someone else inserted a row making the insert fail. See this example of how you can update or insert depending

Re: [GENERAL] Wikipedia help requested, especially non-English

2005-11-13 Thread Dennis Bjorklund
On Sat, 12 Nov 2005, Greg Sabino Mullane wrote: > I've been working a lot on the Wikipedia PostgreSQL page, but I'd like > to see other people jump in as well What license do the following logotype image have? http://en.wikipedia.org/wiki/Image:PostgreSQL_Logo.png It would be good if this ima

Re: [pgsql-advocacy] [GENERAL] Wikipedia help requested, especially

2005-11-13 Thread Dennis Bjorklund
On Sun, 13 Nov 2005, Robert Treat wrote: > > Wikipedia commons only allow images licensed as Public Domain or GPL. > > That's goofy... the wikipedia "commons" wont accept creative commons > licenses? Hmm, on a swedish doc page they list Public Domain and GPL, but on the english information they

Re: [GENERAL] blocking INSERTs

2005-06-07 Thread Dennis Bjorklund
On Tue, 7 Jun 2005, Joseph Shraibman wrote: > BEGIN; > SELECT ... FROM table WHERE a = 1 FOR UPDATE; > UPDATE table SET ... WHERE a = 1; > if that resturns zero then > INSERT INTO table (...) VALUES (...); > END; > > The problem is that I need to avoid race conditions. Sometimes I get > primary

Re: [GENERAL] many updates to single row in single transaction

2005-07-09 Thread Dennis Bjorklund
On 8 Jul 2005, Adam Pritchard wrote: > so I have a singleton table that keeps track of where we are in the > pseudo-sequence. The table is very simple: > > CREATE TABLE t ( next BIGINT ); > INSERT INTO t ( next ) VALUES ( 0 ); > > UPDATE t SET next = $1; -- $1 = next+1 > > The problem is that

Re: [GENERAL] psql prompt

2003-09-13 Thread Dennis Bjorklund
On Tue, 12 Aug 2003, Claudio Lapidus wrote: > The command prompt for psql defaults to the database name, but is there a > way to change it to some other string/value? http://www.postgresql.org/docs/7.3/static/app-psql.html#APP-PSQL-PROMPTING -- /Dennis ---(end of broad

Re: [GENERAL] Foreign key constraint accepted even when not same

2003-09-22 Thread Dennis Bjorklund
On Mon, 22 Sep 2003, Stephan Szabo wrote: > it says that the two types must be comparable. We basically implement the > latter, basically using the existance of a usable equality operator as the > determination of comparable. Is it possible to drop the equality operator when one have FK that nee

Re: [GENERAL] GetLastInsertID ?

2004-01-01 Thread Dennis Bjorklund
On Thu, 1 Jan 2004, Stephane Pinel wrote: > the last inserted id in the table like we do with MySQL using the > GetLastInsertID ? > > My need is to get back the new id just after inserting. Use currval() after you have inserted. http://www.postgresql.org/docs/current/static/functions-sequence.

Re: [GENERAL] PG case sensitivity

2004-09-14 Thread Dennis Bjorklund
On Tue, 14 Sep 2004, Oliver Elphick wrote: > The fault is with your program components that are insisting on upper > case rather than accepting either case. In defence of this unknown component, the sql specifications says that identifiers should be upper cased where pg do lower case. I would w

Re: [GENERAL] OID's

2004-10-23 Thread Dennis Bjorklund
On Sat, 23 Oct 2004, Mike Nolan wrote: > I personally believe that there is value in a database-generated unique > value like Oracle's ROWID. (Part of what I like about it is that since > it is a system column it simplifies some application issues, since the > app never has to worry about that co

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-07 Thread Dennis Bjorklund
Here is a cast function I wrote some years ago to convert a couple of money columns to numeric http://zigo.org/postgresql/#cast_money_to_numeric You already have a solution, but maybe it is of value to someone else. /Dennis Ken Winter skrev: Right you are, Tom! In case anyone else is fa