Re: [GENERAL] NOT NULL Issue

2007-09-14 Thread Tom Lane
"Gustav Lindenberg" <[EMAIL PROTECTED]> writes: > Why is '' not considered null is postgres (8.1.3) Because they're different. The SQL spec says that an empty string is different from NULL, and so does every database in the world except Oracle. Oracle, however, does not define the standard.

[GENERAL] %tsearch2-affix parse error dictionary spanish

2007-09-14 Thread Felipe de Jesús Molina Bravo
Hi I had installed postgresql-8.2.4. After some problems with tsearch2 installation i had the next problem: prueba=# select to_tsvector('espanol','melón'); ERROR: Affix parse error at 506 line If execute: prueba=# select lexize('sp','melón'); lexize -

Re: [GENERAL] Pgsql roles, SQL injection, and utility statements

2007-09-14 Thread Chris Browne
[EMAIL PROTECTED] (Chris Travers) writes: > Since the utility statements are not parameterized, the easiest way to > manage the roles in an application is to use stored procedures which > EXECUTE strings to create SQL queries. These EXECUTE statements > include user-supplied data, and since these

Re: [GENERAL] importing pgsql schema into visio (for diagramming)

2007-09-14 Thread Vivek Khera
On Sep 12, 2007, at 7:32 PM, Andrew Hammond wrote: Does anyone know where I could find a tool which allows importing schema information from a postgres database into visio? The boss guys want some pretty pictures... See SQLFairy. it can generate pretty pictures directly from the schemas

Re: [GENERAL] Inserting a timestamp in a "timestamp" column.

2007-09-14 Thread Erik Jones
I normally use (for php) something like date('Y-m-d H:i:s', time()) to get a string version that Postgres will accept. On Sep 14, 2007, at 3:23 PM, rihad wrote: Hi all, I have a column declared as "timestamp without time zone" that I vainly want to insert a raw timestamp into (i.e. in the

Re: [GENERAL] plpgsql trigger original query

2007-09-14 Thread Pavel Stehule
> Hi, > > I am looking for a way to get the original query that caused a trigger > to fire. I need to be able to get this query either inside the > trigger itself (and then send it to the function the trigger calls) or > get it in the end function. Is this doable? The reason i am asking is > that

[GENERAL] Inserting a timestamp in a "timestamp" column.

2007-09-14 Thread rihad
Hi all, I have a column declared as "timestamp without time zone" that I vainly want to insert a raw timestamp into (i.e. in the format returned by Perl's or PHP's time()). I know of SQL NOW(), but I want to insert a "cooked" timestamp from the outside most efficiently. How? Thanks. ---

Re: [GENERAL] tsearch2 and parsing host strings

2007-09-14 Thread Oleg Bartunov
On Tue, 11 Sep 2007, Laimonas Simutis wrote: A question related to tsearch2 functionality in postgres: When I run the following query: select to_tsvector('default', 'website.com') I get "'website.com':1". What I need to get back is 'website':1 instead. I can see that the parser correctly de

Re: [GENERAL] su: adduser: command not found mac osx

2007-09-14 Thread Erik Jones
Have you tried sudo? su won't do anything if you haven't explicitly enabled the root account. On Sep 12, 2007, at 1:53 AM, Jason Nerida wrote: I've done everything I can find related to this error including su - instead of su useradd instead of adduser but nothing is helping, is there any

Re: [GENERAL] constrains on two tables

2007-09-14 Thread Bill Moran
In response to finecur <[EMAIL PROTECTED]>: > On Sep 10, 9:55 pm, finecur <[EMAIL PROTECTED]> wrote: > > Hi > > > > Here is my table: > > > > Table School > > ( > > id integer, > > name text > > ); > > > > Table Department > > ( > > id integer, > > school_id integer reference schoo

[GENERAL] database still hanging

2007-09-14 Thread alonso
What would cause psql to hang indefinitely when the backend disappears? We have a script that uses psql to insert a record (TCP connection to DB on different machine). The command is basically psql -c "insert into..." A while back I had to restart the server and today discovered that some

Re: [GENERAL] NOT NULL Issue

2007-09-14 Thread Gregory Stark
"Gustav Lindenberg" <[EMAIL PROTECTED]> writes: > select * from security.users where length(us_username)=0; > Surely this a null. Surely not. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com ---(end of broadcast)--- TIP 5

[GENERAL] NOT NULL Issue

2007-09-14 Thread Gustav Lindenberg
Hi Why is '' not considered null is postgres (8.1.3) Currently I have to use the following workaround where I have zero length strings in char fields. select * from security.users where length(us_username)=0; Surely this a null. Apparently not in Postgres. Currently I have to use the followin

[GENERAL] plpgsql trigger original query

2007-09-14 Thread Dan99
Hi, I am looking for a way to get the original query that caused a trigger to fire. I need to be able to get this query either inside the trigger itself (and then send it to the function the trigger calls) or get it in the end function. Is this doable? The reason i am asking is that I would like

[GENERAL] constrains on two tables

2007-09-14 Thread finecur
Hi Here is my table: Table School ( id integer, name text ); Table Department ( id integer, school_id integer reference school(id), name text ); Table Course ( department_id integer references department(id), name text, course_number text ) I would like to make

Re: [GENERAL] Event-driven programming?

2007-09-14 Thread [EMAIL PROTECTED]
On Sep 12, 3:05 pm, [EMAIL PROTECTED] ("D. Dante Lorenso") wrote: > Pavel Stehule wrote: > > 2007/9/12, Jay Dickon Glanville <[EMAIL PROTECTED]>: > >> - I write a function (it doesn't matter what language it's in: > >> PL/pgSQL, PL/Java, etc) > >> - I register that function as a "post-commit" callb

Re: [GENERAL] constrains on two tables

2007-09-14 Thread finecur
On Sep 10, 9:55 pm, finecur <[EMAIL PROTECTED]> wrote: > Hi > > Here is my table: > > Table School > ( > id integer, > name text > ); > > Table Department > ( > id integer, > school_id integer reference school(id), > name text > ); > > Table Course > ( > department_id intege

[GENERAL] su: adduser: command not found mac osx

2007-09-14 Thread Jason Nerida
I've done everything I can find related to this error including su - instead of su useradd instead of adduser but nothing is helping, is there anyone out there using bash on mac os who knows how to fix this? Thanks, Jason ---(end of broadcast)--

[GENERAL] use COPY TO on normalized database

2007-09-14 Thread Acm
I am working with PostgreSQL 8.2.4. I need to use the SQL COPY (COPY table FROM file) statement to populate my database. I have created a normalized data model (up to 3NF). Is it possible to use COPY TO on a particular table (that is linked to other tables using foreign keys) whilst keeping the

Re: [GENERAL] arrays of foreign keys

2007-09-14 Thread Max
Hello, Thanks everyone for your input. Then, it sounds like I won't use an array of foreign keys. I was just curious about the array functionality. However, I didn't think about setting up a view above the intermediary table with an array_accum, now I have never heard of array_accum. I did some r

[GENERAL] GRANT on group does not give access to group members

2007-09-14 Thread wild_oscar
Dear all, I'm a bit confused about privilege management in PostgreSQL. I have a database "db1" , schema "schema1" and table "table1", created with a superuser. Now, following the documentation (and what I've learnt about user management), I created a group called admin and a user login, and gav

[GENERAL] tsearch2 and parsing host strings

2007-09-14 Thread Laimonas Simutis
A question related to tsearch2 functionality in postgres: When I run the following query: select to_tsvector('default', 'website.com') I get "'website.com':1". What I need to get back is 'website':1 instead. I can see that the parser correctly determines term website.com as a host token, which

Re: [GENERAL] GRANT on group does not give access to group members

2007-09-14 Thread wild_oscar
Well, after further searching and reviewing the code I believe the problem was the NOINHERIT in the login role creation. So the remaining question is: On another question, if I want to grant privileges to all tables I have to do them ONE BY ONE. Granting the privileges on the database or the sch

Re: [HACKERS] [GENERAL] AutoVacuum Behaviour Question

2007-09-14 Thread Bruce Momjian
Andrew Hammond wrote: > On 9/13/07, Bruce Momjian <[EMAIL PROTECTED]> wrote: > > > > Alvaro Herrera wrote: > > > Bruce Momjian wrote: > > > > > > > > Is this item closed? > > > > > > No, it isn't. Please add a TODO item about it: > > > * Prevent long-lived temp tables from causing frozen-Xid adva

Re: [GENERAL] Tablespaces on tertiary media

2007-09-14 Thread Mark Morgan Lloyd
Ron Johnson wrote: I know that at one point (v6?) there were hooks in the code for experimental Berkeley code to do this sort of thing but as far as I know there has never been anything publicly available. While tertiary media certainly was relevant 10 years ago, is it really necessary in 2007

[GENERAL] Pgsql roles, SQL injection, and utility statements

2007-09-14 Thread Chris Travers
Hi all; I have a bit of concern about writing applications which use Pgsql roles for security. Since the utility statements are not parameterized, the easiest way to manage the roles in an application is to use stored procedures which EXECUTE strings to create SQL queries. These EXECUTE st

Re: [GENERAL] Tablespaces on tertiary media

2007-09-14 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/14/07 04:06, Mark Morgan Lloyd wrote: > Where does PostgreSQL stand with storing /really/ large amounts of data > offline? Specifically, if a FUSE is used to move a tablespace to > something like a tape archiver can the planner be warned that acc

Re: [GENERAL] Inherited FK Indexing

2007-09-14 Thread Markus Schiltknecht
Hi, Ketema Harris wrote: as expected I can do select * from states and get everything out of the child table as well. What I can't do is create a FK to the states table and have it look in the child table as well. Is this on purpose? Is it possible to have FK that spans into child tables?

Re: [GENERAL] Inherited FK Indexing

2007-09-14 Thread Erik Jones
On Sep 14, 2007, at 10:35 AM, Ketema Harris wrote: I have the following table set up: CREATE TABLE states ( state_id integer NOT NULL DEFAULT nextval ('state_province_id_seq'::regclass), state character(2), full_name character varying, timezone character varying, CONSTRAINT "PK_stat

Re: [GENERAL] Inherited FK Indexing

2007-09-14 Thread Alan Hodgson
On Friday 14 September 2007, Ketema Harris <[EMAIL PROTECTED]> wrote: > as expected I can do select * from states and get everything out of > the child table as well. What I can't do is create a FK to the > states table and have it look in the child table as well. Is this on > purpose? Is it pos

Re: [GENERAL] Locking entire database

2007-09-14 Thread Scott Marlowe
On 9/14/07, Panagiotis Pediaditis <[EMAIL PROTECTED]> wrote: > A simpler example, > In the context of one transaction i do many queries of the form > INSERT INTO table value WHERE value NOT IN TABLE; > > If i have 2 processes running the same 100s of these at the same time i > end up

Re: [GENERAL] Inherited FK Indexing

2007-09-14 Thread Scott Marlowe
On 9/14/07, Ketema Harris <[EMAIL PROTECTED]> wrote: > I have the following table set up: > > CREATE TABLE states > ( >state_id integer NOT NULL DEFAULT nextval > ('state_province_id_seq'::regclass), >state character(2), >full_name character varying, >timezone character varying, >

Re: [GENERAL] Locking entire database

2007-09-14 Thread Panagiotis Pediaditis
A simpler example, In the context of one transaction i do many queries of the form INSERT INTO table value WHERE value NOT IN TABLE; If i have 2 processes running the same 100s of these at the same time i end up with duplicates. Even with isolation set to serializable any ideas? thn

[GENERAL] Inherited FK Indexing

2007-09-14 Thread Ketema Harris
I have the following table set up: CREATE TABLE states ( state_id integer NOT NULL DEFAULT nextval ('state_province_id_seq'::regclass), state character(2), full_name character varying, timezone character varying, CONSTRAINT "PK_state_id" PRIMARY KEY (state_id) ) CREATE TABLE canadian

Re: [GENERAL] Documentation fix regarding atan2

2007-09-14 Thread Bruce Momjian
Change made. Thanks. Your documentation changes can be viewed in five minutes using links on the developer's page, http://www.postgresql.org/developer/testing. --- Andrew Maclean wrote: > In Table 9.4 of the documentation

Re: [GENERAL] problems with large table

2007-09-14 Thread Mike Charnoky
Thanks, recreating the table solved my problems. Our team is working on implementing some performance tuning based on other recommendations from the list (FSM, etc). Mike Joshua D. Drake wrote: > At this point, you are in a world of hurt :). If you stop a vacuum you > have created a huge mess o

Re: [GENERAL] Locking entire database

2007-09-14 Thread Thomas Kellerer
Panagiotis Pediaditis, 14.09.2007 16:45: Well the problem is I am working on rdf query engine for persistent RDF data. The data is stored/structured in a specific way in the database. When i perform updates in parallel, because there are cross table dependencies, I end up with inconsistencies,

Re: [GENERAL] Locking entire database

2007-09-14 Thread Martijn van Oosterhout
On Fri, Sep 14, 2007 at 05:45:07PM +0300, Panagiotis Pediaditis wrote: > Well the problem is I am working on rdf query engine for persistent RDF > data. The data is stored/structured in a specific way in the database. > When i perform updates in parallel, because there are cross table > dependen

Re: [GENERAL] Locking entire database

2007-09-14 Thread Sibte Abbas
On 9/14/07, Panagiotis Pediaditis <[EMAIL PROTECTED]> wrote: > Hello, > > Is there some way of locking all database tables in a transaction > without knowing their names > or even better just locking the entire database? I know this is bad > tactics but there is a specific > case where i need it. C

Re: [GENERAL] Locking entire database

2007-09-14 Thread Panagiotis Pediaditis
Well the problem is I am working on rdf query engine for persistent RDF data. The data is stored/structured in a specific way in the database. When i perform updates in parallel, because there are cross table dependencies, I end up with inconsistencies, For example One transaction reads to see

Re: [GENERAL] How to recover database instance from a disaster

2007-09-14 Thread Rodrigo De León
On 9/14/07, Chansup Byun <[EMAIL PROTECTED]> wrote: > Is there any other way? See: http://www.postgresql.org/docs/8.2/static/backup.html ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an i

Re: [GENERAL] Locking entire database

2007-09-14 Thread Rodrigo De León
On 9/14/07, Panagiotis Pediaditis <[EMAIL PROTECTED]> wrote: > ... there is a specific case where i need it. Don't really know, but, explain what the case is, and maybe someone could help you. ---(end of broadcast)--- TIP 4: Have you searched our li

[GENERAL] Locking entire database

2007-09-14 Thread Panagiotis Pediaditis
Hello, Is there some way of locking all database tables in a transaction without knowing their names or even better just locking the entire database? I know this is bad tactics but there is a specific case where i need it. Can it be done? Thank you Panagiotis ---(end

[GENERAL] How to recover database instance from a disaster

2007-09-14 Thread Chansup Byun
Hi, I'm supporting Sun Grid Engine and it uses Postgres DB as a backend server for ARCo accounting and reporting module. One of my customers is asking how to recover data if Postgres DB server got crashed. SGE constantly generates accounting data and records them into Postgres DB. I think on

Re: [GENERAL] Tablespaces on tertiary media

2007-09-14 Thread Mark Morgan Lloyd
Gregory Stark wrote: Thanks. If the tables were in a tablespace that was stored on something that looked like a conventional filesystem would the server code be prepared to wait the minutes that it took the operating system and FUSE implementation to load the tables onto disc? Ah, I see what y

Re: [GENERAL] Issue with uninstalling postgres 8.1.9

2007-09-14 Thread Albe Laurenz
Phoenix Kiula wrote: > > We have a system that came with pg 8.1.9. When I try to uninstall > those RPMs, it works for all the rpms except for libs: > > > rpm -ev postgresql-libs-8.1.9-1.el5 > error: Failed dependencies: > libpq.so.4 is needed by (installed) apr-util-1.2.7-6.i386 > >

Re: [GENERAL] oracle rank() over partition by queries

2007-09-14 Thread SHARMILA JOTHIRAJAH
Thanks Markus Markus Schiltknecht <[EMAIL PROTECTED]> wrote: Hello Sharmi Joe, sharmi Joe wrote: > Is there a way to get the oracle's rank() over partition by queries in > postgresql? These are known as window functions. AFAIK Gavin Sherry is working on an implementation for Postgres. Regards

Re: [GENERAL] oracle rank() over partition by queries

2007-09-14 Thread Markus Schiltknecht
Hello Sharmi Joe, sharmi Joe wrote: Is there a way to get the oracle's rank() over partition by queries in postgresql? These are known as window functions. AFAIK Gavin Sherry is working on an implementation for Postgres. Regards Markus ---(end of broadcast)

Re: [GENERAL] Scalability Design Questions

2007-09-14 Thread Markus Schiltknecht
Hi, novnov wrote: OK, this has been very informative and I'd like to thank the three of you. Asynchronous replication to readonly slaves is something I will look into. I've never touched posgtres replication; and Scott mentioned that he was not familiar with PGCluster, so there must be some ot

Re: [GENERAL] Tablespaces on tertiary media

2007-09-14 Thread Gregory Stark
"Mark Morgan Lloyd" <[EMAIL PROTECTED]> writes: > Thanks. If the tables were in a tablespace that was stored on something that > looked like a conventional filesystem would the server code be prepared to > wait > the minutes that it took the operating system and FUSE implementation to load > the

Re: [GENERAL] Tablespaces on tertiary media

2007-09-14 Thread Mark Morgan Lloyd
Gregory Stark wrote: Where does PostgreSQL stand with storing /really/ large amounts of data offline? Specifically, if a FUSE is used to move a tablespace to something like a tape archiver can the planner be warned that access might take an extended period? No, Postgres can't deal with this. Y

Re: [GENERAL] Issue with uninstalling postgres 8.1.9

2007-09-14 Thread Phoenix Kiula
On 14/09/2007, Phoenix Kiula <[EMAIL PROTECTED]> wrote: > We have a system that came with pg 8.1.9. When I try to uninstall > those RPMs, it works for all the rpms except for libs: > > > > rpm -ev postgresql-libs-8.1.9-1.el5 > error: Failed dependencies: > libpq.so.4 is needed by (insta

[GENERAL] Issue with uninstalling postgres 8.1.9

2007-09-14 Thread Phoenix Kiula
We have a system that came with pg 8.1.9. When I try to uninstall those RPMs, it works for all the rpms except for libs: > rpm -ev postgresql-libs-8.1.9-1.el5 error: Failed dependencies: libpq.so.4 is needed by (installed) apr-util-1.2.7-6.i386 I am not sure what this is about and h

Re: [GENERAL] Tablespaces on tertiary media

2007-09-14 Thread Gregory Stark
"Mark Morgan Lloyd" <[EMAIL PROTECTED]> writes: > Where does PostgreSQL stand with storing /really/ large amounts of data > offline? Specifically, if a FUSE is used to move a tablespace to something > like > a tape archiver can the planner be warned that access might take an extended > period? N

[GENERAL] Tablespaces on tertiary media

2007-09-14 Thread Mark Morgan Lloyd
Where does PostgreSQL stand with storing /really/ large amounts of data offline? Specifically, if a FUSE is used to move a tablespace to something like a tape archiver can the planner be warned that access might take an extended period? I know that at one point (v6?) there were hooks in the co

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-14 Thread Stefan Schwarzer
SELECT f.year, f.id, c.name, (f.value / p.value) AS per_capita FROM fish_catch AS f JOIN pop_total AS p USING (year, id) INNER JOIN countries AS c ON f.id = c.id ORDER BY (year = 2005), value, name Seems to never end Why is redesigning tables so difficult?! :-)) And fur