Re: [GENERAL] Best way to monitor, control, or rewrite data definition commands?

2009-05-12 Thread John DeSoi
On May 12, 2009, at 7:59 PM, Turner, Ian wrote: CREATE TABLE foo (fooid integer); Then I would also like to do CREATE TABLE foo_audit (fooid integer, ); along with the creation of some other triggers, rules, etc. Is there any way to be notified when a user executes data definition commands

Re: [GENERAL] Best way to monitor, control, or rewrite data definition commands?

2009-05-12 Thread Greg Smith
On Tue, 12 May 2009, Turner, Ian wrote: Is there any way to be notified when a user executes data definition commands such as CREATE TABLE? It doesn't appear possible to apply triggers or rules to the system tables, and the query rewrite engine only seems to apply to SELECT, INSERT, and UPDATE.

[GENERAL] Best way to monitor, control, or rewrite data definition commands?

2009-05-12 Thread Turner, Ian
Hello list, I am trying to implement automatic audit log tracking for newly created tables. When a user creates a table, I would like to create a second table for the audit log, along with the relevant rules. So for example, if a user does CREATE TABLE foo (fooid integer); Then I would also like

Re: [GENERAL] pg_dump/pg_restore schema and data separately and foreign key constraints

2009-05-12 Thread Adrian Klaver
On Tuesday 12 May 2009 2:35:10 pm Vasiliy Vasin wrote: > In the end, decided to make easier: make a complete dump except tables that > I don't want to backup, then just dump schema of these tables. So I have 2 > files: schema+data for all except table1 and table2, schema only for table1 > and table

Re: [GENERAL] pg_dump/pg_restore schema and data separately and foreign key constraints

2009-05-12 Thread Dragan Zubac
Vasiliy Vasin wrote: I have database on production server that backups every day. Database is not big ~ 10mb. But I added several tables that takes big capacity and I don't want to backup data from them. So, I backup my database in two files: schema and data: pg_dump -s -E utf-8 -f ${filename.

Re: [GENERAL] pg_dump/pg_restore schema and data separately and foreign key constraints

2009-05-12 Thread Vasiliy Vasin
In the end, decided to make easier: make a complete dump except tables that I don't want to backup, then just dump schema of these tables. So I have 2 files: schema+data for all except table1 and table2, schema only for table1 and table2. It's a strangely that pg_restore is still no option to che

Re: [GENERAL] pg_dump/pg_restore schema and data separately and foreign key constraints

2009-05-12 Thread Alan Hodgson
On Tuesday 12 May 2009, Vasiliy Vasin wrote: > I have database on production server that backups every day. Database is > not big ~ 10mb. But I added several tables that takes big capacity and I > don't want to backup data from them. > > So, I backup my database in two files: schema and data: > pg

Re: [GENERAL] pg_dump/pg_restore schema and data separately and foreign key constraints

2009-05-12 Thread Adrian Klaver
- "Vasiliy Vasin" wrote: > I have database on production server that backups every day. Database > is not big ~ 10mb. > But I added several tables that takes big capacity and I don't want to > backup data from them. > > So, I backup my database in two files: schema and data: > pg_dump -s -

[GENERAL] pg_dump/pg_restore schema and data separately and foreign key constraints

2009-05-12 Thread Vasiliy Vasin
I have database on production server that backups every day. Database is not big ~ 10mb. But I added several tables that takes big capacity and I don't want to backup data from them. So, I backup my database in two files: schema and data: pg_dump -s -E utf-8 -f ${filename.schema} -F custom -n pu

Re: [GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Alvaro Herrera
Alvaro Herrera wrote: > Markus Wollny wrote: > > magazine=# vacuum analyze pcaction.article; > > PANIC: corrupted item pointer: 5 > > server closed the connection unexpectedly > > This probably means the server terminated abnormally > > before or while processing the request. > >

Re: [GENERAL] regexp_matches problem

2009-05-12 Thread WP Perquin
When I make the following simplified example: SELECT regexp_matches('' ,'((title\s*=\s*\"([^"]*)")+)|((src\s*=\s*\"([^"]*)")+)','ig') My result are 2 rows: "{NULL,NULL,NULL,"src=\"\"","src=\"\"",}" "{"title=\"dit is een title tekst\"","title=\"dit is een title tekst\"","dit is e

Re: [GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Alvaro Herrera
Markus Wollny wrote: > magazine=# vacuum analyze pcaction.article; > PANIC: corrupted item pointer: 5 > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > The connection to the server was los

Re: [GENERAL] Difference between "in (...)" and "= any(...)" queries when using arrays

2009-05-12 Thread Francisco Figueiredo Jr.
On Tue, May 12, 2009 at 05:02, Richard Huxton wrote: > Francisco Figueiredo Jr. wrote: >> >> Hi all! >> >> I was playing with "in (...)"  and "= any (...)" queries and found a >> difference between them and I wonder: >> >> why this works: >> >> select * from table_of_integers where integer_column

Re: [GENERAL] Unable to access table named "user"

2009-05-12 Thread Adrian Klaver
On Tuesday 12 May 2009 3:16:34 am Sam Mason wrote: > On Tue, May 12, 2009 at 06:57:07PM +1000, Joe Kramer wrote: > > Don't help either. > > > > Jdbc statement: > > SELECT * from "public"."user" ; > > > > Exception: > > ERROR: relation "public.user" does not exist > > Are you sure the table exists o

Re: [GENERAL] Putting many related fields as an array

2009-05-12 Thread Andrew Gould
On Tue, May 12, 2009 at 7:06 AM, Ow Mun Heng wrote: > -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > On Tue, May 12, 2009 at 01:23:14PM +0800, Ow Mun Heng wrote: > >> | sum of count | sum_of_count_squared | qty | qty < 100 | qty < 500 | > >> > >> >

Re: [GENERAL] Postgres BackUp and Restore: ERROR: duplicate key violates unique constraint "pg_largeobject_loid_pn_index"

2009-05-12 Thread Sam Mason
On Tue, May 12, 2009 at 05:25:26PM +0530, CM J wrote: > The above results in following exception and the data is not getting > restored: > > ERROR: duplicate key violates unique constraint > "pg_largeobject_loid_pn_index" > > What else do i need to drop/delete to completely reinitial

Re: [GENERAL] Cannot login for short period of time

2009-05-12 Thread Thomas Markus
Hi, check your hardware (especially harddrive) for errors. regards Thomas Henry schrieb: > > Greets, > > Pg: 8.3.7 > > I'm trying to diagnose why I cannot login to Pg on occasion. The psql > command will just hang (so I cannot get in to see what it's doing) and > a telnet into 5432 will give t

Re: [GENERAL] Putting many related fields as an array

2009-05-12 Thread Sam Mason
On Tue, May 12, 2009 at 08:06:25PM +0800, Ow Mun Heng wrote: > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > On Tue, May 12, 2009 at 01:23:14PM +0800, Ow Mun Heng wrote: > >Not sure why this is better than using separate columns though. Maybe a > >new datatype and a custom aggr

Re: [GENERAL] Luhn algorithm (credit card verify / check) implementation - FIX

2009-05-12 Thread David Fetter
On Tue, May 12, 2009 at 02:54:29PM +0800, Craig Ringer wrote: > The Luhn algorithm implemention I posted earlier (upthread) is > internally consistent and will verify checksums it created, but it is > actually not a correct implementation of the Luhn algorithm. This looks like a great candidat

[GENERAL] Cannot login for short period of time

2009-05-12 Thread Henry
Greets, Pg: 8.3.7 I'm trying to diagnose why I cannot login to Pg on occasion. The psql command will just hang (so I cannot get in to see what it's doing) and a telnet into 5432 will give the usual: Connected to localhost (127.0.0.1). Escape character is '^]'. indicating the backend ac

Re: [GENERAL] Putting many related fields as an array

2009-05-12 Thread Ow Mun Heng
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- On Tue, May 12, 2009 at 01:23:14PM +0800, Ow Mun Heng wrote: >> | sum of count | sum_of_count_squared | qty | qty < 100 | qty < 500 | >> >> >> I'm thinking of lumping them into 1 column via an array instead

[GENERAL] Postgres BackUp and Restore: ERROR: duplicate key violates unique constraint "pg_largeobject_loid_pn_index"

2009-05-12 Thread CM J
Hi, I backup my database using the following command: pg_dump.exe -f Backup.sql -U -p MYDB Now,before restoring, i drop all my tables,indexes,foreign key constraints.Then, i restore using the cmd below: psql.exe -U -p -d MYDB -f Backup.sql The above results in following

[GENERAL] regexp_matches problem

2009-05-12 Thread WP Perquin
(postgresql 8.3.7, linux centos) I made the following regexp_matches SELECT regexp_matches( ( SELECT content FROM page WHERE idpage = 2 ) ,',']))*>' , 'ig' ) AS result The result looks like: {"\"",NULL,NULL,"\""} in phpPgAdmin. Which is not th

Re: [GENERAL] Selecting data from bytea field in 8.3

2009-05-12 Thread Albe Laurenz
Tomasz Rejman wrote: > Few days ago I have changed my postgreSQL to 8.3 version and I have problem > with bytea fields. Let me show you an example: > > CREATE TABLE testtable > ( > test bytea > ); > insert into testTable (test) VALUES > (E'\304\205\304\207\305\274\303\263\305\202wjfdsafdsa'); >

Re: [GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Glyn Astill
--- On Tue, 12/5/09, Glyn Astill wrote: > I'm going to duck out of this now though, and I think > you should probably wait until someone a little more > knowlegable replies. > Also see here: http://archives.postgresql.org/pgsql-general/2006-07/msg01147.php -- Sent via pgsql-general m

Re: [GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Markus Wollny
Hi! > It appears to be failing on the pcaction.article table. Could > you get away without that? Perhaps, and it'd be a longshot, > you'd be able to dump the rest of the data with it gone? > > I'm going to duck out of this now though, and I think you > should probably wait until someone a lit

Re: [GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Glyn Astill
--- On Tue, 12/5/09, Markus Wollny wrote: > From: Markus Wollny > Subject: AW: [GENERAL] Could not open file "pg_clog/" > To: glynast...@yahoo.co.uk, pgsql-general@postgresql.org > Date: Tuesday, 12 May, 2009, 11:52 AM > Hi! > > > -Ursprüngliche Nachricht- > > Von: Glyn Astill [ma

Re: [GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Markus Wollny
Hi! > -Ursprüngliche Nachricht- > Von: Glyn Astill [mailto:glynast...@yahoo.co.uk] > Gesendet: Dienstag, 12. Mai 2009 12:33 > An: pgsql-general@postgresql.org; Markus Wollny > The first thing I would have done if I've been forced to do > that (if there was no other option?) would be a

Re: [GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Glyn Astill
--- On Tue, 12/5/09, Markus Wollny wrote: > From: Markus Wollny > Subject: [GENERAL] Could not open file "pg_clog/" > To: pgsql-general@postgresql.org > Date: Tuesday, 12 May, 2009, 11:04 AM > Hello! > > Recently one of my PostgreSQL servers has started throwing > error > messages like the

Re: [GENERAL] Unable to access table named "user"

2009-05-12 Thread Sam Mason
On Tue, May 12, 2009 at 06:57:07PM +1000, Joe Kramer wrote: > Don't help either. > > Jdbc statement: > SELECT * from "public"."user" ; > > Exception: > ERROR: relation "public.user" does not exist Are you sure the table exists or you're connecting to the correct database then? If you connect wi

Re: [GENERAL] Putting many related fields as an array

2009-05-12 Thread Sam Mason
On Tue, May 12, 2009 at 01:23:14PM +0800, Ow Mun Heng wrote: > | sum of count | sum_of_count_squared | qty | qty < 100 | qty < 500 | > > > I'm thinking of lumping them into 1 column via an array instead of into > 5 different columns. Not sure how to go about this, hence the email to > the list.

[GENERAL] Could not open file "pg_clog/...."

2009-05-12 Thread Markus Wollny
Hello! Recently one of my PostgreSQL servers has started throwing error messages like these: ERROR: could not access status of transaction 3489956864 DETAIL: Could not open file "pg_clog/0D00": Datei oder Verzeichnis nicht gefunden. (file not found) The machine in question doesn't show any sig

Re: [GENERAL] Unable to access table named "user"

2009-05-12 Thread Joe Kramer
Don't help either. Jdbc statement: SELECT * from "public"."user" ; Exception: ERROR: relation "public.user" does not exist On Tue, May 12, 2009 at 5:55 PM, Scott Marlowe wrote: > On Tue, May 12, 2009 at 1:26 AM, Joe Kramer wrote: >> Hi, >> >> I have table named user (lower case) in public sch

Re: [GENERAL] Difference between "in (...)" and "= any(...)" queries when using arrays

2009-05-12 Thread Richard Huxton
Francisco Figueiredo Jr. wrote: Hi all! I was playing with "in (...)" and "= any (...)" queries and found a difference between them and I wonder: why this works: select * from table_of_integers where integer_column = any (array[5,6]); This checks if integer_column matches any value in the s

[GENERAL] Selecting data from bytea field in 8.3

2009-05-12 Thread Tomasz Rejman
Hi there. Few days ago I have changed my postgreSQL to 8.3 version and I have problem with bytea fields. Let me show you an example: CREATE TABLE testtable ( test bytea ); insert into testTable (test) VALUES (E'\304\205\304\207\305\274\303\263\305\202wjfdsafdsa'); select encode(test, 'escape'

Re: [GENERAL] Unable to access table named "user"

2009-05-12 Thread Scott Marlowe
On Tue, May 12, 2009 at 1:26 AM, Joe Kramer wrote: > Hi, > > I have table named user (lower case) in public schema. > I can access it using Pgadmin as > SELECT * from "user"; SELECT * from "public.user"; SELECT * FROM public.user; Try "public"."user" -- Sent via pgsql-general mailing list (pgsq

[GENERAL] Unable to access table named "user"

2009-05-12 Thread Joe Kramer
Hi, I have table named user (lower case) in public schema. I can access it using Pgadmin as SELECT * from "user"; SELECT * from "public.user"; SELECT * FROM public.user; I can't find any way to access this table from Jdbc. Tried to access as public.user, user in single and double quotes, nothing

Re: [GENERAL] Compiler versions on different platforms

2009-05-12 Thread Peter Eisentraut
On Tuesday 12 May 2009 02:30:56 Vikram Patil wrote: > I was able to compile on all of the platforms but I want to know about > minimum and recommended version requirements for these systems. I am > concerned about performance of these binaries and looking to achieve > performance of these binary as