Re: [GENERAL] delete from ... where not in

2007-02-18 Thread Chris
Tom Lane wrote: Chris <[EMAIL PROTECTED]> writes: I have a problem with a delete query I'm not sure how to fix. Try increasing work_mem --- you want EXPLAIN to show that it's using a hashed subplan. .. and there I was thinking I'd found a bug (bugger!) ;) Thanks for the tip :) -- Postgresq

Re: [GENERAL] Write errors in postgres log

2007-02-18 Thread Tom Lane
"CAJ CAJ" <[EMAIL PROTECTED]> writes: > We have 2 servers running postgres database 8.0.3 serving a web application. You do realize we are up to 8.0.12 in that branch? You're missing nearly two years worth of bug fixes. > ERROR: xlog flush request 2/66B19020 is not satisfied --- flushed only to

Re: [GENERAL] delete from ... where not in

2007-02-18 Thread Tom Lane
Chris <[EMAIL PROTECTED]> writes: > I have a problem with a delete query I'm not sure how to fix. Try increasing work_mem --- you want EXPLAIN to show that it's using a hashed subplan. regards, tom lane ---(end of broadcast)

Re: [GENERAL] Database performance comparison paper.

2007-02-18 Thread Tom Allison
Leif B. Kristensen wrote: On Friday 16. February 2007 07:10, Tom Lane wrote: Perhaps this paper can be described as "comparing an F-15 to a 747 on the basis of required runway length". There ought to be a proper name for this kind of pseudo-technical Gonzo journalism. The Internet is full of

[GENERAL] delete from ... where not in

2007-02-18 Thread Chris
Hi all, I have a problem with a delete query I'm not sure how to fix. I've tried this in 8.1.4 & 8.2.3 and get the same behaviour in both. This is how I've been able to reproduce it: create table t1(id serial primary key, email text); insert into t1(email) select 'email' || n || '@address.c

[GENERAL] Write errors in postgres log

2007-02-18 Thread CAJ CAJ
Hello, We have 2 servers running postgres database 8.0.3 serving a web application. Recently, we started having problems with the web application and diagnosis lead to the following errors repeated in the postgres log files on both the servers. == CONTEXT:

Re: [GENERAL] invalid regular expression: invalid backreference number

2007-02-18 Thread Tom Lane
Jeff Ross <[EMAIL PROTECTED]> writes: > To debug this I've extracted the code into its own function: > CREATE FUNCTION gen_password() RETURNS text AS $$ > DECLARE > password text; > chars := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; > BEGIN You forgot to give a type fo

Re: [GENERAL] invalid regular expression: invalid backreference number

2007-02-18 Thread Stephan Szabo
On Sun, 18 Feb 2007, Jeff Ross wrote: > Tom Lane wrote: > > > > Since ceil() produces float8 which does not implicitly cast to int, > > this call has probably never done what you thought --- AFAICS it will > > cast all the arguments to text and invoke substring(text,text,text) > > which treats its

Re: [GENERAL] invalid regular expression: invalid backreference number

2007-02-18 Thread Jeff Ross
Tom Lane wrote: Thanks for the reply, Tom. Jeff Ross <[EMAIL PROTECTED]> writes: This used to work before my upgrade to 8.2.1. Which version were you using before? 8.1.x The error the function now throws is: ERROR: invalid regular expression: invalid backreference nu

Re: [GENERAL] Inequality operators are not deduced.

2007-02-18 Thread ITAGAKI Takahiro
Tom Lane <[EMAIL PROTECTED]> wrote: > ITAGAKI Takahiro <[EMAIL PROTECTED]> writes: > > I found that the planner can deduce equality operators, > > but cannot deduce inequality ones. > > Are there any plans to improve handling of them? > > Not particularly; it doesn't seem like something that com

Re: [GENERAL] How would you handle updating an item and related stuff all at once?

2007-02-18 Thread Chris
It seems to me the easiest thing to do is delete all the relations for the account and create all new ones with the data submitted from the form. This seems wasteful, but the alternative would be a pain. Or is this really the best way? I do it the same way.. I'm open to suggestions about b

Re: [GENERAL] indexes across multiple tables

2007-02-18 Thread Chris
Toby Tremayne wrote: Hi all, I'm just experimenting with tsearch2 - I have it all working fine but I was wondering if there's a way to create indexes containing vector columns from multiple tables? Or if not, how do people usually manage this kind of issue? Postgres doesn't support multi-t

Re: [GENERAL] complex referential integrity constraints

2007-02-18 Thread elein
On Fri, Feb 16, 2007 at 09:58:56AM -0500, Robert Haas wrote: > So, I have the following problem. > > Suppose you have two kinds of animals, sheep and wolves. Since they > have very similar properties, you create a single table to hold both > kinds of animals, and an animal_type table to specify t

Re: [GENERAL] Database performance comparison paper.

2007-02-18 Thread Guido Neitzer
Am 15.02.2007 um 13:05 schrieb Alexander Elgert: Nice, but it would be interesting which storage engine was used for mysql - ok, default is MyIsam. They used MyISAM as it is described late in the paper. cug ---(end of broadcast)--- TIP 4: Have

Re: [GENERAL] complex referential integrity constraints

2007-02-18 Thread Tom Lane
"Robert Haas" <[EMAIL PROTECTED]> writes: > ... The problem with this is that I have a very unsettled feeling about the > foreign key constraints on this table. The victim_id constraint is > fine, but the attacker_id constraint is really inadequate, because the > attacker CAN NEVER BE A SHEEP. I

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Tom Lane
Karsten Hilbert <[EMAIL PROTECTED]> writes: >> So I figured it would make sense to add a functional index >> on date_trunc('day', dob) to the patients table. Which >> worked (appeared to, at least) with PG 7.4. For the record, this was changed just before 8.0 release: http://archives.postgresql.or

Re: [GENERAL] open source - content management system - that uses PostGreSQL

2007-02-18 Thread Joshua D. Drake
John DeSoi wrote: > > On Feb 16, 2007, at 4:13 PM, Andrew Kirkness wrote: > >> I am currently setting up a website and have PostGreSQL database I'm >> using for the backend. I'm researching an open source Content >> Management System that uses PostGreSQL. Do you have any recommendations? > > Dru

Re: [GENERAL] encoding problem at restore

2007-02-18 Thread Michael Fuhr
On Sat, Feb 17, 2007 at 03:12:44AM -0800, Bob Hunter wrote: > ERROR: invalid byte sequence for encoding "UTF8": > 0xe02031 > HINT: This error can also happen if the byte sequence > does not match the encoding expected by the server, > which is controlled by "client_encoding". > CONTEXT: COPY , l

Re: [GENERAL] open source - content management system - that uses PostGreSQL

2007-02-18 Thread John DeSoi
On Feb 16, 2007, at 4:13 PM, Andrew Kirkness wrote: I am currently setting up a website and have PostGreSQL database I'm using for the backend. I'm researching an open source Content Management System that uses PostGreSQL. Do you have any recommendations? Drupal is excellent and supports

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Karsten Hilbert
On Sun, Feb 18, 2007 at 09:19:43PM +0900, Michael Glaesemann wrote: > >What I don't understand, however, is exactly *why* date_trunc is > >not immutable ? > > I believe it's because the result of date_trunc depends on the time > zone setting for the session. ... > So, given the same argumen

Re: [GENERAL] Anticipatory privileges

2007-02-18 Thread John DeSoi
On Feb 17, 2007, at 12:12 PM, John D. Burger wrote: A better approach is to write a plpgsql function that assembles and EXECUTEs the required GRANT commands. Okay, thanks - guess it's time to learn some real plpgsql control structures. You can find some help here: http://pgedit.com/tip/

[GENERAL] complex referential integrity constraints

2007-02-18 Thread Robert Haas
So, I have the following problem. Suppose you have two kinds of animals, sheep and wolves. Since they have very similar properties, you create a single table to hold both kinds of animals, and an animal_type table to specify the type of each animal: CREATE TABLE animal_type ( id

Re: [GENERAL] Setting up functions in psql.

2007-02-18 Thread tonylaq
On Feb 16, 12:06 am, [EMAIL PROTECTED] (Paul Lambert) wrote: > Tom Lane wrote: > > Paul Lambert <[EMAIL PROTECTED]> writes: > >> What I am confused about is: Why does the creation of a function fail if > >> a table it uses does not exist when the function itself is creating the > >> table further u

[GENERAL] What about TSearch2

2007-02-18 Thread Rafael Comino Mateos
Hi from Spain, I have a problem with TSearch2, I have a table with more than a million registers (a table of books, for example), I made a tsearch2 index for one of my fields (the title of the books, for example), I make queries from that table, over the tsearch2 index. Then some of my q

[GENERAL] encoding problem at restore

2007-02-18 Thread Bob Hunter
Hello, I have just updated to postgres8.1 and have the following problem. The first line of the "PostgreSQL database dump" says: SET client_encoding = 'SQL_ASCII'; which is correct. However, the restore says: ERROR: invalid byte sequence for encoding "UTF8": 0xe02031 HINT: This error can als

Re: [GENERAL] Database performance comparison paper.

2007-02-18 Thread Alexander Elgert
Richard Huxton schrieb: Shelby Cain wrote: Excerpt from the document: === 2. What is compared here - "Apples and Oranges" The setups are as standard as can be. The only principle guiding the installation of all the software is simplicity. No op

Re: [GENERAL] Database performance comparison paper.

2007-02-18 Thread Alexander Elgert
Marc Evans schrieb: Some people may find this interesting reading. http://us.devloop.org.uk/ Nice, but it would be interesting which storage engine was used for mysql - ok, default is MyIsam. Does mysql (in the latest version) still use a single write-thread for writing? In mysql 3, a ba

[GENERAL] open source - content management system - that uses PostGreSQL

2007-02-18 Thread Andrew Kirkness
Hello, I am currently setting up a website and have PostGreSQL database I'm using for the backend. I'm researching an open source Content Management System that uses PostGreSQL. Do you have any recommendations? Alternatively, I noticed most open source Content Management Systems use MySQL. If I'

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Michael Glaesemann
On Feb 18, 2007, at 20:29 , Karsten Hilbert wrote: What I don't understand, however, is exactly *why* date_trunc is not immutable ? I believe it's because the result of date_trunc depends on the time zone setting for the session. test=# select date_trunc('day', current_timestamp);

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Karsten Hilbert
followup to self: On Sun, Feb 18, 2007 at 12:29:17PM +0100, Karsten Hilbert wrote: > So I figured it would make sense to add a functional index > on date_trunc('day', dob) to the patients table. Which > worked (appeared to, at least) with PG 7.4. > > One of our users is on PG 8.2 PostgreSQL 8.1

[GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Karsten Hilbert
Hi all, we (GNUmed) run a medical database on PostgreSQL. We are very pleased with it (PostgreSQL, that is ;-) in all aspects. The date-of-birth field in our table holding patients is of type "timestamp with time zone". One of our patient search queries uses the date-of-birth field to find matche

Re: [GENERAL] [ANNOUNCE] Advisory on possibly insecure security definer functions

2007-02-18 Thread Karsten Hilbert
On Sat, Feb 17, 2007 at 11:31:19AM -0700, Michael Fuhr wrote: > If you schema-qualify objects instead of setting search_path then > don't forget about operators. I knew I had missed something. > SELECT col > FROM schemaname.tablename > WHERE othercol operator(pg_catalog.=) schemaname.funcname(

Re: [GENERAL] Automated backups for PG running on Windows Server?

2007-02-18 Thread Magnus Hagander
Vacuum Joe wrote: > Quick question: I have installed PG 8.2.x on a customer's system and > we will be storing a lot of critical data on it. It needs to be > backed up maybe twice a day. It's very easy to back data up with the > pgadmin tool (great tool btw) but we need an automated solution that

[GENERAL] Automated backups for PG running on Windows Server?

2007-02-18 Thread Vacuum Joe
Quick question: I have installed PG 8.2.x on a customer's system and we will be storing a lot of critical data on it. It needs to be backed up maybe twice a day. It's very easy to back data up with the pgadmin tool (great tool btw) but we need an automated solution that we can configure. This

Re: [GENERAL] Encryption/Decryption in PGSQL

2007-02-18 Thread Magnus Hagander
RPK wrote: > Is there any built in function in PGSQL to Encrypt/Decrypt a text before > storing in field? If yes, which algorithms it supports and what is the > maximum key size? Take a look at contrib/pgcrypto. It supports a wide range of different algorithms and key sizes. There's a README file

[GENERAL] Encryption/Decryption in PGSQL

2007-02-18 Thread RPK
Is there any built in function in PGSQL to Encrypt/Decrypt a text before storing in field? If yes, which algorithms it supports and what is the maximum key size? -- View this message in context: http://www.nabble.com/Encryption-Decryption-in-PGSQL-tf3247467.html#a9027615 Sent from the PostgreSQL