Re: [GENERAL] Debian problem...

2007-09-12 Thread Tino Wildenhain
Hi, Tom Allison schrieb: On Sep 11, 2007, at 5:49 AM, Tom Allison wrote: I was able get my database working again. Never figured out why... My database data (sorry about the redundancy there) is sitting on a RAID1 array with LVM and ReiserFS. I've heard some dissention about the use of

[GENERAL] Table partitioning based on multiple criterias possible?

2007-09-12 Thread Ow Mun Heng
New to Pg and wondering the extent of PG's table partitioning capability. I have a huge table 18 million rows(growth rate ~8 million a week) which I like to implement partitioning. Initially the plan is to just partition it by date. eg: 1 partition per month. Now, I'm thinking if it's possible

[GENERAL] Question to schema public

2007-09-12 Thread Kai Behncke
Dear list, If I create on my system (Postgresql 8.2.4) a new database it gets automatically the schema public. I would like to know what this schema is for? On my system I have a couple of different users. The owner of the public-schema is postgres. Could it be Fatal to give all of my users

[GENERAL] Database/Table Design for Global Country Statistics

2007-09-12 Thread Stefan Schwarzer
Hi there, I learned in another posting that my table design - in a polite way - could be improved. So, before doing any additional design errors, I would like to get feedback, if possible. I am dealing with some 500 tables for worldwide national statistics (GDP, population, environment

Re: [GENERAL] Table partitioning based on multiple criterias possible?

2007-09-12 Thread Richard Huxton
Ow Mun Heng wrote: New to Pg and wondering the extent of PG's table partitioning capability. I have a huge table 18 million rows(growth rate ~8 million a week) which I like to implement partitioning. OK Initially the plan is to just partition it by date. eg: 1 partition per month. Fair

Re: [GENERAL] Question to schema public

2007-09-12 Thread Richard Huxton
Kai Behncke wrote: Dear list, If I create on my system (Postgresql 8.2.4) a new database it gets automatically the schema public. I would like to know what this schema is for? On my system I have a couple of different users. The owner of the public-schema is postgres. By default everyone

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

2007-09-12 Thread Richard Huxton
Stefan Schwarzer wrote: Hi there, I learned in another posting that my table design - in a polite way - could be improved. So, before doing any additional design errors, I would like to get feedback, if possible. I am dealing with some 500 tables for worldwide national statistics (GDP,

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

2007-09-12 Thread Tino Wildenhain
Stefan Schwarzer schrieb: Hi there, I learned in another posting that my table design - in a polite way - could be improved. So, before doing any additional design errors, I would like to get feedback, if possible. I am dealing with some 500 tables for worldwide national statistics (GDP,

Re: [GENERAL] Question to schema public

2007-09-12 Thread Albe Laurenz
Kai Behncke wrote: If I create on my system (Postgresql 8.2.4) a new database it gets automatically the schema public. I would like to know what this schema is for? It is kind of a default schema. If you keep the standard configuration, then every user can access objects in this schema

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

2007-09-12 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/12/07 03:28, Stefan Schwarzer wrote: [snip] The new design would be like this: id |year|value --- 1 | 1970| NULL 1 | 1971| 36 1 1 | 2005| 45

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

2007-09-12 Thread Stefan Schwarzer
Thanks for the feedback and the suggestions. A problem I have now when using the new design is the following: As a result from my PostGres query I get something like this: year|value |name --- 2001| 123 | Afghanistan

Re: [GENERAL] Table partitioning based on multiple criterias possible?

2007-09-12 Thread Ow Mun Heng
On Wed, 2007-09-12 at 09:42 +0100, Richard Huxton wrote: Ow Mun Heng wrote: New to Pg and wondering the extent of PG's table partitioning capability. I have a huge table 18 million rows(growth rate ~8 million a week) which I like to implement partitioning. OK Initially the plan

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

2007-09-12 Thread Richard Huxton
Stefan Schwarzer wrote: Thanks for the feedback and the suggestions. A problem I have now when using the new design is the following: As a result from my PostGres query I get something like this: year|value |name --- 2001| 123

Re: [GENERAL] Table partitioning based on multiple criterias possible?

2007-09-12 Thread Richard Huxton
Ow Mun Heng wrote: On Wed, 2007-09-12 at 09:42 +0100, Richard Huxton wrote: Well, I suppose you could partition over (month,product) but you probably don't want to. Sounds fiddly to manage. Yeah.. well current schema w/ everything in 1 table and the way things are ordered, normalised design

[GENERAL] pgpool II question

2007-09-12 Thread sharmi Joe
Hi, Im a newbie to postgres. Can you explain what pgpool is ? Thanks

Re: [GENERAL] Partial index with regexp not working

2007-09-12 Thread Phoenix Kiula
On 11/09/2007, Phoenix Kiula [EMAIL PROTECTED] wrote: The suggestion in this thread that a regex index will come into play only when the WHERE condition specifically mentions it was indeed the key for me. Ok, I've hit a snag about this index. I think it's to do with how my regex is

Re: [GENERAL] Sthange things happen: SkyTools pgbouncer is NOT a balancer

2007-09-12 Thread Asko Oja
Hi One of PgBouncer original design goals is to create small and robust connection pooler. If we start adding more and more fancy features like load balancing then we can easily end up in the same place from which we wanted to get away (pgPool). We do our load balancing on ip level when the

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

2007-09-12 Thread Stefan Schwarzer
Many, many thanks for that and the other advices from everybody. You're great! As I am neither expert in PHP, nor in Postgres, MySQL, Javascript, HTML etc. etc., all I do in the forums is asking questions; and not adding value by helping others (due to my limited knowledge). All I can do

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

2007-09-12 Thread Richard Huxton
Stefan Schwarzer wrote: Many, many thanks for that and the other advices from everybody. You're great! As I am neither expert in PHP, nor in Postgres, MySQL, Javascript, HTML etc. etc., all I do in the forums is asking questions; and not adding value by helping others (due to my limited

Re: [GENERAL] Partial index with regexp not working

2007-09-12 Thread Richard Huxton
Phoenix Kiula wrote: Ok, I've hit a snag about this index. I think it's to do with how my regex is structured. Basically this column can have either IP addresses, or alphanumeric user IDs. If it is not an IP address, it is a registered user ID. What is the best way of ascertaining that a column

Re: [GENERAL] Scalability Design Questions

2007-09-12 Thread Asko Oja
Hello We plProxy to split our database into partitions. See Kristo's blog's about that at http://kaiv.wordpress.com/. For replication we use Londiste in SkyTools package. SkyTools contains several more scripts that are useful when buildin large and complex systems running on large number of

[GENERAL] Timestamp from an OID?

2007-09-12 Thread Dennis Muhlestein
I've been passively collecting data for a few months. I realized, after a while, that I never added a timestamp column to the table the data is being stored in. I've since added that. Is there a way to find out when the previous rows were inserted? There is a serial integer for the primary

Re: [GENERAL] Timestamp from an OID?

2007-09-12 Thread A. Kretschmer
am Wed, dem 12.09.2007, um 7:32:45 -0600 mailte Dennis Muhlestein folgendes: I've been passively collecting data for a few months. I realized, after a while, that I never added a timestamp column to the table the data is being stored in. I've since added that. Is there a way to find

Re: [GENERAL] Timestamp from an OID?

2007-09-12 Thread Michael Glaesemann
On Sep 12, 2007, at 8:32 , Dennis Muhlestein wrote: Is there a way to find out when the previous rows were inserted? There is a serial integer for the primary key on the table. Nope. Michael Glaesemann grzm seespotcode net ---(end of

Re: [GENERAL] Timestamp from an OID?

2007-09-12 Thread A. Kretschmer
am Wed, dem 12.09.2007, um 15:41:44 +0200 mailte A. Kretschmer folgendes: am Wed, dem 12.09.2007, um 7:32:45 -0600 mailte Dennis Muhlestein folgendes: I've been passively collecting data for a few months. I realized, after a while, that I never added a timestamp column to the table the

Re: [GENERAL] avg() of array values

2007-09-12 Thread Alban Hertroys
Martijn van Oosterhout wrote: avg(*) is not valid, same for sum(*) Doh! Thanks. -- Alban Hertroys [EMAIL PROTECTED] magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbus 416 7500 AK Enschede // Integrate Your World //

Re: [GENERAL] Timestamp from an OID?

2007-09-12 Thread Dennis Muhlestein
A. Kretschmer wrote: am Wed, dem 12.09.2007, um 15:41:44 +0200 mailte A. Kretschmer folgendes: am Wed, dem 12.09.2007, um 7:32:45 -0600 mailte Dennis Muhlestein folgendes: I've been passively collecting data for a few months. I realized, after a while, that I never added a timestamp column

[GENERAL] update problem in partitioned tables

2007-09-12 Thread Josh Harrison
Hi I have the master-child tables as follows Master table create table foo(a numeric(10,0)); first child table foo1 as create table foo1 (check(a=0 and a10)) inherits(foo) second child table foo2 as create table foo1 (check(a=10) inherits(foo) Now I create this function to redirect the inserts

Re: [GENERAL] update problem in partitioned tables

2007-09-12 Thread Tom Lane
Josh Harrison [EMAIL PROTECTED] writes: Now I create this function to redirect the inserts and updates on the master table. Uh ... there never will be any updates in the master table, since it hasn't got any entries. What you'd need is an insert trigger on the master and update triggers on

[GENERAL] problems with large table

2007-09-12 Thread Mike Charnoky
Hi, I'm using PostgreSQL 8.1.8 and am having trouble with a table which contains a large amount of data. Data is constantly being inserted into the table, roughly a million inserts per hour at peak. The table currently has about 100 million entries which take up 14G of space (24G with indices).

Re: [GENERAL] problems with large table

2007-09-12 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Charnoky wrote: Hi, At this point, I'm at a loss. I've searched the archives for similar problems, but none of the suggestions have worked. Is the data in this table corrupted? Why are both vacuum and reindex failing to complete? Is

[GENERAL] Event-driven programming?

2007-09-12 Thread Jay Dickon Glanville
Hello all. Is it possible for PostgreSQL to notify me of a successful transaction commit? Here's an example of what I'm thinking of: - 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 callback function - when a

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Martijn van Oosterhout
On Wed, Sep 12, 2007 at 12:36:22PM -0400, Jay Dickon Glanville wrote: Hello all. Is it possible for PostgreSQL to notify me of a successful transaction commit? There is the LISTEN/NOTIFY mechanism. It's not automatic but I think it does most of what oyu want. Have a nice day, -- Martijn van

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Richard Broersma Jr
--- Jay Dickon Glanville [EMAIL PROTECTED] wrote: Is it possible for PostgreSQL to notify me of a successful transaction commit? I've haven't used it yet, but will LISTEN and NOTIFY work for you? http://www.postgresql.org/docs/8.2/static/sql-listen.html

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Pavel Stehule
2007/9/12, Jay Dickon Glanville [EMAIL PROTECTED]: Hello all. Is it possible for PostgreSQL to notify me of a successful transaction commit? Here's an example of what I'm thinking of: - I write a function (it doesn't matter what language it's in: PL/pgSQL, PL/Java, etc) - I register that

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Erik Jones
On Sep 12, 2007, at 11:51 AM, Richard Broersma Jr wrote: --- Jay Dickon Glanville [EMAIL PROTECTED] wrote: Is it possible for PostgreSQL to notify me of a successful transaction commit? I've haven't used it yet, but will LISTEN and NOTIFY work for you?

Re: [GENERAL] problems with large table

2007-09-12 Thread Alvaro Herrera
Joshua D. Drake wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At this point, I'm at a loss. I've searched the archives for similar problems, but none of the suggestions have worked. Is the data in this table corrupted? Why are both vacuum and reindex failing to complete? Is

Re: [GENERAL] update problem in partitioned tables

2007-09-12 Thread Josh Harrison
Thanks. Check this website that talk abt the approach that I had mentioned http://blogs.ittoolbox.com//oracle/guide/archives/comparing-partitioned-tables-in-oracle-and-enterprisedbpostgresql-13261 I also tried your method (triggers on the child table) and it gives the same error too. Josh On

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Jay Dickon Glanville
On 9/12/07, Martijn van Oosterhout [EMAIL PROTECTED] wrote: On Wed, Sep 12, 2007 at 12:36:22PM -0400, Jay Dickon Glanville wrote: Hello all. Is it possible for PostgreSQL to notify me of a successful transaction commit? There is the LISTEN/NOTIFY mechanism. It's not automatic but I

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Jeff Davis
On Wed, 2007-09-12 at 13:10 -0400, Jay Dickon Glanville wrote: On 9/12/07, Martijn van Oosterhout [EMAIL PROTECTED] wrote: On Wed, Sep 12, 2007 at 12:36:22PM -0400, Jay Dickon Glanville wrote: Hello all. Is it possible for PostgreSQL to notify me of a successful transaction commit?

Re: [GENERAL] problems with large table

2007-09-12 Thread Tom Lane
Joshua D. Drake [EMAIL PROTECTED] writes: At this point, you are in a world of hurt :). If you stop a vacuum you have created a huge mess of dead rows in that table. Only if it was a vacuum full, which he didn't mention having tried. I'm kinda wondering whether the vacuum and reindex did

Re: [GENERAL] Debian problem...

2007-09-12 Thread Andrej Ricnik-Bay
On 9/12/07, Tino Wildenhain [EMAIL PROTECTED] wrote: Alternatively you could use XFS but I'm not sure if it performs better on failing hardware. I guess not. Actually I've seen anecdotal evidence that XFS with its aggressive write-caching has caused data-loss in the event of power-failures.

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Richard Huxton
Jay Dickon Glanville wrote: What I'd like to be able to do with this event is to notify any applications of this change, so they can update their cached view of the database. So, is this possible? Or am I wishing for the sky? ;-) You're wishing for these, I think:

[GENERAL] ON UPDATE trigger question

2007-09-12 Thread Josh Trutwin
If I create an ON UPDATE trigger run on each row after update, does the trigger fire only on rows affected by the update or for all rows? For example: CREATE TRIGGER my_update_trigger AFTER UPDATE ON my_table FOR EACH ROW EXECUTE PROCEDURE my_update_proc; UPDATE my_table SET my_val =

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread D. Dante Lorenso
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 callback function - when a client commits a transaction, the function gets called, and the

[GENERAL] pgpool and foreign key on partitioned tables

2007-09-12 Thread sharmi Joe
Hi, Does pgpool II support foreign key constraints on partitions? If so, how? Thanks

[GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
Hi, I am not sure if this qualifies as a bug report or a feature request, but I don't see any way to tell Postgresql that the members of a record cannot be NULL. This causes all kinds of problems when this record is used to declare the return type of a function. Suppose I had the following

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Rodrigo De León
On 9/12/07, Cultural Sublimation [EMAIL PROTECTED] wrote: Thanks for the help! Not really following you, but try these: CREATE OR REPLACE FUNCTION GET_MOVIES () RETURNS SETOF MOVIES LANGUAGE SQL STABLE AS $$ SELECT MOVIE_ID, MOVIE_NAME FROM MOVIES; $$; -- OR -- CREATE OR REPLACE FUNCTION

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Uwe C. Schroeder
Why do you create an extra type for that? Just have your method return movies i.e. CREATE FUNCTION get_movies () RETURNS SETOF movies ... ... HTH Uwe On Wednesday 12 September 2007, Cultural Sublimation wrote: Hi, I am not sure if this qualifies as a bug report or a feature request, but

Re: [GENERAL] problems with large table

2007-09-12 Thread Mike Charnoky
I have never heard that stopping a vacuum is problematic... I have had to do this many times in the past without any adverse affects. Is there some sort of documentation which elaborates on this issue? For the record, I did a VACUUM ANALYZE, not FULL. Now that I think about it, I probably

Re: [GENERAL] problems with large table

2007-09-12 Thread Alvaro Herrera
Mike Charnoky wrote: Alvaro: The cluster suggestion probably won't help in my case since data in the table should already be naturally ordered by date. It's not helpful only for reordering, but also for getting rid of dead tuples. -- Alvaro Herrera

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
Why do you create an extra type for that? Just have your method return movies Hi, Thanks for the answer. The simple example obfuscates the fact that in reality the table has a few extra columns that are omitted from get_movies_t. Therefore, I cannot return movies. However, your answer did

Re: [GENERAL] problems with large table

2007-09-12 Thread Phoenix Kiula
On 13/09/2007, Alvaro Herrera [EMAIL PROTECTED] wrote: Mike Charnoky wrote: Alvaro: The cluster suggestion probably won't help in my case since data in the table should already be naturally ordered by date. It's not helpful only for reordering, but also for getting rid of dead tuples.

Re: [GENERAL] problems with large table

2007-09-12 Thread Alvaro Herrera
Phoenix Kiula escribió: On 13/09/2007, Alvaro Herrera [EMAIL PROTECTED] wrote: Mike Charnoky wrote: Alvaro: The cluster suggestion probably won't help in my case since data in the table should already be naturally ordered by date. It's not helpful only for reordering, but also for

Re: [GENERAL] problems with large table

2007-09-12 Thread Tom Lane
Phoenix Kiula [EMAIL PROTECTED] writes: Apart from creating a new table, indexing it, then renaming it to original table -- is there an alternative to CLUSTER that doesn't impose a painful ACCESS EXCLUSIVE lock on the table? We are on Postgres 8.2.3 and have a heavy duty table that starts

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
Hi again, However, your answer did give me an idea: instead of declaring get_movies_t as a record, I declare it as dummy table, and return that (see code at the end). This works, though it is *very* ugly. Any other ideas? My apologies, but it turns out that this solution doesn't work after

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Uwe C. Schroeder
I haven't tried it with a view yet - so this may or may not work. But try giving it a shot by declaring a view create view vmovies as select movie_id,movie_text from movies and let your function return setof vmovies Maybe that works - I think it should. Uwe On Wednesday 12 September 2007,

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Osvaldo Rosario Kussama
Cultural Sublimation escreveu: Hi, I am not sure if this qualifies as a bug report or a feature request, but I don't see any way to tell Postgresql that the members of a record cannot be NULL. This causes all kinds of problems when this record is used to declare the return type of a function.

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
CREATE FUNCTION get_movies () RETURNS SETOF get_movies_t LANGUAGE sql STABLE AS $$ SELECT movie_id, movie_name FROM movies WHERE movie_id NOT NULL AND movie_name NOT NULL; $$ Hey, Thanks for the suggestion. Unfortunately, it still doesn't work. Here is what Postgresql is telling the

Re: [GENERAL] an other provokative question??

2007-09-12 Thread Ron Mayer
Greg Sabino Mullane wrote: ...in favor of renaming the database Horizontica. ...should definitely be HorizonticaSQL Surely that should be capitalized HorizonticASQL, no. ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
I haven't tried it with a view yet - so this may or may not work. But try giving it a shot by declaring a view create view vmovies as select movie_id,movie_text from movies and let your function return setof vmovies Maybe that works - I think it should. Hey, Thanks for the help.

Re: [GENERAL] an other provokative question??

2007-09-12 Thread Scott Marlowe
On 9/12/07, Ron Mayer [EMAIL PROTECTED] wrote: Greg Sabino Mullane wrote: ...in favor of renaming the database Horizontica. ...should definitely be HorizonticaSQL Surely that should be capitalized HorizonticASQL, no. I can just see it now. I've been using Horizont and followed by

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Richard Broersma Jr
--- Cultural Sublimation [EMAIL PROTECTED] wrote: CREATE FUNCTION get_movies () RETURNS SETOF get_movies_t LANGUAGE sql STABLE AS $$ SELECT movie_id, movie_name FROM movies WHERE movie_id NOT NULL AND movie_name NOT NULL; $$ SELECT movie_id, movie_name FROM get_movies (); =

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Chris Browne
[EMAIL PROTECTED] (Jay Dickon Glanville) writes: On 9/12/07, Martijn van Oosterhout [EMAIL PROTECTED] wrote: On Wed, Sep 12, 2007 at 12:36:22PM -0400, Jay Dickon Glanville wrote: Hello all. Is it possible for PostgreSQL to notify me of a successful transaction commit? There is the

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
I don't know if this will work, but here is another idea: SELECT movie_id, movie_name FROM get_movies() AS ( int4 NOT NULL, text NOT NULL ); Hi, Nope. That's not even valid syntax... But thanks for effort, anyway! Cheers, C.S.

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Richard Broersma Jr
--- Cultural Sublimation [EMAIL PROTECTED] wrote: I don't know if this will work, but here is another idea: SELECT movie_id, movie_name FROM get_movies() AS ( int4 NOT NULL, text NOT NULL ); Hi, Nope. That's not even valid syntax... It isn't valid SQL spec syntax but it is

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Tom Lane
Cultural Sublimation [EMAIL PROTECTED] writes: This bug seems to obvious to have been generally missed. It's not a bug: there is no mechanism enforcing that the result of a function can't be NULL. For functions returning scalars you can get the effect by declaring the result as being of a

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Alvaro Herrera
Richard Broersma Jr wrote: --- Cultural Sublimation [EMAIL PROTECTED] wrote: I don't know if this will work, but here is another idea: SELECT movie_id, movie_name FROM get_movies() AS ( int4 NOT NULL, text NOT NULL ); Hi, Nope. That's not even valid syntax...

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Martijn van Oosterhout
On Wed, Sep 12, 2007 at 02:22:46PM -0700, Cultural Sublimation wrote: SELECT movie_id, movie_name FROM get_movies (); = returns a SETOF of (int4 NULL, text NULL) I presume you mean that the server is saying the column can be NULL, not that it is actually NULL, since: One note: I know this

Re: [GENERAL] ON UPDATE trigger question

2007-09-12 Thread Jorge Godoy
On Wednesday 12 September 2007 15:56:13 Josh Trutwin wrote: If I create an ON UPDATE trigger run on each row after update, does the trigger fire only on rows affected by the update or for all rows? For example: CREATE TRIGGER my_update_trigger AFTER UPDATE ON my_table FOR EACH ROW

Re: [GENERAL] Partial index with regexp not working

2007-09-12 Thread Jorge Godoy
On Wednesday 12 September 2007 09:34:55 Richard Huxton wrote: To be honest, I'd probably just have a separate column uid_type, set it when creating the user and then just have a partial index WHERE uid_type='IP' Or have a separate column with the user ID and have (anonymous) when you have

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
Hi Tom, In any case, it appears to me that your gripe has little to do with whether there's actually any enforcement of the not-null condition, and much to do with whether some unspecified client-side software thinks the query result column is guaranteed not null. Most likely you're going

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
Hi, I presume you mean that the server is saying the column can be NULL, not that it is actually NULL, since: Yeah, that is the correct semantics: it can be NULL. It does make a world of difference on the client side, because an int4 never NULL is a different type from int4 possibly NULL.

Re: [GENERAL] an other provokative question??

2007-09-12 Thread Andrej Ricnik-Bay
On 9/9/07, Scott Marlowe [EMAIL PROTECTED] wrote: Hey! Some of us just figured out how to pronounce PostgreSQL properly. Postgreh SeeQuell?? /me ducks -- Please don't top post, and don't use HTML e-Mail :} Make your quotes concise. http://www.american.edu/econ/notes/htmlmail.htm

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Alvaro Herrera
Cultural Sublimation wrote: Hi, I presume you mean that the server is saying the column can be NULL, not that it is actually NULL, since: Yeah, that is the correct semantics: it can be NULL. It does make a world of difference on the client side, because an int4 never NULL is a

Re: [GENERAL] an other provokative question??

2007-09-12 Thread volunteer
howto check column than row?? create table horizontal (id integer, first varchar(8), last varchar(8)); insert into horizontal values ('1', 'Jack', 'Ja'); insert into horizontal values ('2', 'Jill', 'Ji'); insert into horizontal values ('3', 'Mary', 'Ma'); select * from horizontal where true;

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Cultural Sublimation
Interesting. What language are you using? OCaml. The type-safety comes from the PG'OCaml bindings, which basically check if the types in the database are consistent with the types in the program. It's very neat technology, but unfortunately sometimes it seems too advanced for its own good,

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

2007-09-12 Thread Andrew Hammond
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... Andrew

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

2007-09-12 Thread David Fetter
On Wed, Sep 12, 2007 at 04:32:22PM -0700, 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... I'm pretty sure VisioPro has a way to attach to databases via

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

2007-09-12 Thread Steve Atkins
On Sep 12, 2007, at 4: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... Visio has that built-in for a long time - point it at the database via

Re: [GENERAL] problems with large table

2007-09-12 Thread Phoenix Kiula
On 13/09/2007, Tom Lane [EMAIL PROTECTED] wrote: Phoenix Kiula [EMAIL PROTECTED] writes: Apart from creating a new table, indexing it, then renaming it to original table -- is there an alternative to CLUSTER that doesn't impose a painful ACCESS EXCLUSIVE lock on the table? We are on

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

2007-09-12 Thread Bruno Lavoie
Helllo, you can also look at Case Studio, this software have a nice reverse engineering functionnality! Good luck Bruno Lavoie Andrew Hammond a écrit : Does anyone know where I could find a tool which allows importing schema information from a postgres database into visio? The boss guys

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Tom Lane
Cultural Sublimation [EMAIL PROTECTED] writes: Interesting. What language are you using? OCaml. The type-safety comes from the PG'OCaml bindings, which basically check if the types in the database are consistent with the types in the program. Unfortunately for you, they are not different

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

2007-09-12 Thread Josh Trutwin
On Wed, 12 Sep 2007 23:32:24 -0400 Bruno Lavoie [EMAIL PROTECTED] wrote: Helllo, you can also look at Case Studio, this software have a nice reverse engineering functionnality! Good luck Bruno Lavoie Andrew Hammond a écrit : Does anyone know where I could find a tool which allows

Re: [GENERAL] Database reverse engineering

2007-09-12 Thread Ow Mun Heng
On Mon, 2007-09-10 at 13:00 -0600, RC Gobeille wrote: Or this one: http://schemaspy.sourceforge.net/ Can't seem to get it to connect to PG using the example. java -jar schemaSpy_3.1.1.jar -t pgsql -u operator -p operator -o test_db -host localhost -db test_db Using database properties:

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

2007-09-12 Thread Norberto Meijome
On Wed, 12 Sep 2007 23:32:24 -0400 Bruno Lavoie [EMAIL PROTECTED] wrote: you can also look at Case Studio, this software have a nice reverse engineering functionnality! hear hear - great little tool _ {Beto|Norberto|Numard} Meijome A tyrant...is always stirring up