Re: [GENERAL] Lost password

2008-12-16 Thread Allan Kamau
It is assumed you are running Unix (or Linux). The commands you've been provided with are standard Unix system commands that will help you find the files (pg_hba.conf) you are looking for, the output of these commands (locate or find) is the absolute path to your queried file (in your case

[GENERAL] Is this a security risk?

2008-12-16 Thread Adam Witney
I would like to provide a limited view of my database to some users, so i thought of creating a second database (I can control access by IP address through pg_hba.conf) with some views that queried the first database using dblink. The problem is that dblink requires non-superusers to

Re: [GENERAL] tup_returned/ tup_fetched

2008-12-16 Thread Angel
El Martes, 16 de Diciembre de 2008 04:02:09 Sebastian Böhm escribió: sorry I was not very precise. My question is what does it actually mean in the end for these two functions: pg_stat_get_db_tuples_returned(oid) bigint Number of tuples returned for database

Re: [GENERAL] Trigger/Rules Order of operations

2008-12-16 Thread Ivan Pavlov
I can't answer your question but I think you may have a serious database design issue at hand. Why not try to accomplish your goals in a simpler way? Regards, Ivan Pavlov On Dec 15, 12:49 pm, ket...@ketema.net (Ketema Harris) wrote: I am interested in finding out the pros, cons, pitfalls of

Re: [GENERAL] Logg errors during UPDATE

2008-12-16 Thread Ivan Pavlov
Neiter LOG ERRORS nor REJECT LIMIT are implemented in PostgreSQL, though I agree they may be useful. Both can be simulated with a custom stored procedure which loops over a cursor and updates row-by-row, trapping errors along the way. This will, of course, be slower. regards, Ivan Pavlov On

Re: [GENERAL] How restrict select on a view ?

2008-12-16 Thread Andreas
Merlin Moncure schrieb: what does this get you? Not as much as I first hoped. In hindsight it was a silly question. The point was that the view gets linked into an Access-Client. There are some Users who shouldn't bother to figure over the results as it does some performance statistics.

Re: [GENERAL] Trigger/Rules Order of operations

2008-12-16 Thread Ketema
On Dec 16, 10:31 am, Ivan Pavlov ivan.pav...@gmail.com wrote: I can't answer your question but I think you may have a serious database design issue at hand. Why not try to accomplish your goals in a simpler way? Regards, Ivan Pavlov On Dec 15, 12:49 pm, ket...@ketema.net (Ketema Harris)

Re: [GENERAL] View vs Constantly Updated Table

2008-12-16 Thread Ketema Harris
How often are you using the bank balance value? I have no data on this as of yet, but it obviously needs to be correct for when the user looks at it. The opposite argument, is how long does the computation take? The computation is simple, however the amount of data that goes into it

Re: [GENERAL] How restrict select on a view ?

2008-12-16 Thread Merlin Moncure
On Mon, Dec 15, 2008 at 9:38 PM, Klint Gore kgo...@une.edu.au wrote: Andreas wrote: I'd like to have a view only to be used by certain users. The tables are public. Can this only be done by restricting access to the tables? GRANT/REVOKE works on views revoke all on aview from public;

[GENERAL] Isolating a record column from a PL-Pgsql function call ?

2008-12-16 Thread Gauthier, Dave
Hi: I have a PL-Pgsql function that returns a record of a type that have 4 elements (columns). Let's say the first element/column is called id_num. Is there a way I can specify the id_num element of the record returned from iside a query? For example, select col1 from thetable where

Re: [GENERAL] how to load text file that has embeded nul character

2008-12-16 Thread Alvaro Herrera
Sun Dong wrote: When I tried to load it, I always get this error: invalid byte sequence for encoding UTF8: 0x00 how could I load this into postgresql database? I'm afraid you'll have to preprocess the file to convert the 0x00 into \000. Obviously, if you're inserting this file into a

[GENERAL] monitor effectiveness of fillfactor and vacuums

2008-12-16 Thread Jaime Casanova
Hi, currently i'm trying to $SUBJECT, my actual approach is to look at n_tup_upd and n_tup_hot_upd assuming the more near they are the better... is that a good assumption? what else can i see? -- Atentamente, Jaime Casanova Soporte y capacitación de PostgreSQL Asesoría y desarrollo de sistemas

Re: [GENERAL] Trigger/Rules Order of operations

2008-12-16 Thread Raymond O'Donnell
On 16/12/2008 16:26, Ketema wrote: automatically after certain input. In analyzing the task I saw two main paths. Use the trigger and rule system that Pg provides or construct external methods to control the logic and issue simple commands to insert data when appropriate. I chose to use the

Re: [GENERAL] what happens to indexes when TRUNCATEing

2008-12-16 Thread Alvaro Herrera
Willy-Bas Loos escribió: What happens to indexes on a table that is TRUNCATEd? They are truncated too. -- Alvaro Herrerahttp://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-general mailing list

[GENERAL] what happens to indexes when TRUNCATEing

2008-12-16 Thread Willy-Bas Loos
What happens to indexes on a table that is TRUNCATEd? WBL -- Patriotism is the conviction that your country is superior to all others because you were born in it. -- George Bernard Shaw

Re: [GENERAL] Trigger/Rules Order of operations

2008-12-16 Thread Emanuel Calvo Franco
2008/12/15 Ketema Harris ket...@ketema.net: I am interested in finding out the pros, cons, pitfalls of using the following design: Manual insert into Table A. Table A has a BEFORE INSERT trigger that causes an insert to table B. Table B has an AFTER INSERT trigger that causes an insert back

[GENERAL] TIMESTAMP with a timezone offset

2008-12-16 Thread Madison Kelly
Hi all, I've got a database with a column I CAST as a TIMESTAMP. The data in the database is GMT. I want to say in my WHERE clause to offset the value I am giving by X number of hours and to display the column I've cast as a timestamp offset by the same X hours. I am sure this is

Re: [GENERAL] TIMESTAMP with a timezone offset

2008-12-16 Thread Raymond O'Donnell
On 16/12/2008 19:16, Madison Kelly wrote: I want to say in my WHERE clause to offset the value I am giving by X number of hours and to display the column I've cast as a timestamp offset by the same X hours. You could use AT TIME ZONE to shift it the required number of hours:

Re: [GENERAL] Isolating a record column from a PL-Pgsql function call ?

2008-12-16 Thread Andreas Kretschmer
Gauthier, Dave dave.gauth...@intel.com schrieb: Hi: I have a PL-Pgsql function that returns a record of a type that have 4 elements (columns). Let’s say the first element/column is called “id_num”. Is there a way I can specify the id_num element of the record returned from iside a

Re: [GENERAL] Isolating a record column from a PL-Pgsql function call ?

2008-12-16 Thread Gauthier, Dave
The example I gave was overly simplistic. I actually want to look at more than one of the columns in the returned record, so rewritting it to return an int won't address the need for the other columns. And no, it does not return a set/array of records. It returns just one record. If I run

Re: [GENERAL] TIMESTAMP with a timezone offset

2008-12-16 Thread Madison Kelly
Raymond O'Donnell wrote: On 16/12/2008 19:16, Madison Kelly wrote: I want to say in my WHERE clause to offset the value I am giving by X number of hours and to display the column I've cast as a timestamp offset by the same X hours. You could use AT TIME ZONE to shift it the required number

Re: [GENERAL] View vs Constantly Updated Table

2008-12-16 Thread marcin mank
It is generally better to save the balance. The general rule in accounting systems design is what can be printed, should be explicitly on disk. for an invoice: value before tax, tax percentage, value after tax, total before tax, total after tax, etc, should all be saved explicitly. An account

Re: [GENERAL] Isolating a record column from a PL-Pgsql function call ?

2008-12-16 Thread Andreas Kretschmer
Gauthier, Dave dave.gauth...@intel.com schrieb: Hi: I have a PL-Pgsql function that returns a record of a type that have 4 elements (columns). Let’s say the first element/column is called “id_num”. Is there a way I can specify the id_num element of the record returned from iside a

[GENERAL] Need help to dynamically access to colomns in function!

2008-12-16 Thread Иван Марков
Hello. I have table classif with columns: ... , group1, group2, group3, ... , group48, ... In function i do query and want run on every row and dynamically operate on columns from group1 to group20. I do something like this: OPEN curs FOR select * from classif; loop fetch curs into tmprec;

Re: [GENERAL] Isolating a record column from a PL-Pgsql function call ?

2008-12-16 Thread Gauthier, Dave
And it's a bit more complicated at that. Here's why I discovered that I can refer to the function as a relation in the from clause... select y.col1 from my_plpgsql_fn(789) y but I need to pass the function something from outside, sort of like... select x.col_a, y.col1 from mytable

Re: [GENERAL] Isolating a record column from a PL-Pgsql function call ?

2008-12-16 Thread Gauthier, Dave
Wooops... typo... should have been select x.col_a, y.col1 from mytable x, my_plpgsql_fn(x.val) y where x.col_b = 'foo'; -Original Message- From: Gauthier, Dave Sent: Tuesday, December 16, 2008 3:38 PM To: Gauthier, Dave; Andreas Kretschmer; pgsql-general@postgresql.org

Re: [GENERAL] Need help to dynamically access to colomns in function!

2008-12-16 Thread Ivan Pavlov
Please disregard my other message. I didn't get what you are trying to do at first. You can do this with dynamic SQL: Look at 38.5.4. Executing Dynamic Commands (http://www.postgresql.org/docs/current/static/plpgsql- statements.html). I guess something like EXECUTE 'SELECT tmprec.group' || i

Re: [GENERAL] Need help to dynamically access to colomns in function!

2008-12-16 Thread Ivan Pavlov
If you need them one by one why fetch them into tmprec? Take a look at the docs for FETCH: http://www.postgresql.org/docs/8.3/static/sql-fetch.html especially the FETCH ABSOLUTE... regards, Ivan Pavlov On Dec 16, 3:37 pm, aesthete2...@gmail.com (Иван Марков) wrote: Hello. I have table classif

Re: [GENERAL] Lost password

2008-12-16 Thread TJ O'Donnell
It seems you haven't done anything you need to save, so why not save time and just reinstall postgres? TJ Hi  I started the installation of postrgres got distracted and then started again but forgot my password -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] Isolating a record column from a PL-Pgsql function call ?

2008-12-16 Thread Tom Lane
Gauthier, Dave dave.gauth...@intel.com writes: I have a PL-Pgsql function that returns a record of a type that have 4 elements (columns). Let's say the first element/column is called id_num. Is there a way I can specify the id_num element of the record returned from iside a query? For

Re: [GENERAL] TIMESTAMP with a timezone offset

2008-12-16 Thread Tom Lane
Madison Kelly li...@alteeve.com writes: I was reading that before posting, but have not been able to get it to work. After looking at it again I think it's because I've cast the column I restricted in the SELECT as a 'TIMESTAMP WITHOUT TIME ZONE'. So I ALTERed the column to be 'TIMESTAMP

[GENERAL] Maximum reasonable free space map

2008-12-16 Thread Phillip Berry
Hi Everyone, Just wondering what the maximum reasonable free space map setting should be? I'm receiving the following advice from vacuum: INFO: free space map contains 170803 pages in 117 relations DETAIL: A total of 185000 page slots are in use (including overhead). 733008 page slots are

Re: [GENERAL] Maximum reasonable free space map

2008-12-16 Thread Grzegorz Jaśkiewicz
On Wed, Dec 17, 2008 at 12:55 AM, Phillip Berry pbe...@stellaconcepts.com wrote: I thought 185K was pretty high, is going to 700K+ reasonable? I've got 16GB of ram and am running very high volume 100GB+ DBs. all depends on how often does the data change. I would go with whatever vacuum is

[GENERAL] PITR archive_status/%p.done files

2008-12-16 Thread salman
A couple of questions about these files: 1) When are these generated? Is this once an archive is generated, or once the full archive_command has run? 2) Is there any harm in removing these files by appending an rm command at the end of archive_command? -salman -- Sent via pgsql-general

Re: [GENERAL] Maximum reasonable free space map

2008-12-16 Thread Phillip Berry
The data in nearly every table is constantly changing due to a high volume of new data constantly coming in, processing on the existing data and heavy reporting being done all at once all day and night. So I guess my question is, is there a point where you start to see diminishing returns

Re: [GENERAL] Maximum reasonable free space map

2008-12-16 Thread Grzegorz Jaśkiewicz
On Wed, Dec 17, 2008 at 2:29 AM, Phillip Berry pbe...@stellaconcepts.com wrote: The data in nearly every table is constantly changing due to a high volume of new data constantly coming in, processing on the existing data and heavy reporting being done all at once all day and night. So I

Re: [GENERAL] Maximum reasonable free space map

2008-12-16 Thread Gregory Stark
Phillip Berry pbe...@stellaconcepts.com writes: So I guess my question is, is there a point where you start to see diminishing returns or even negative returns by setting the fsm too high? There is no benefit to having FSM larger than necessary, so I suppose that qualifies as diminishing

[GENERAL] Rows count in the cursor ?

2008-12-16 Thread Ivanmara
Hello. how can i get count of the rows in cursor ? this code always return 0, but table is not empty: open curs for select * from classif order by id; GET DIAGNOSTICS i = ROW_COUNT; -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Maximum reasonable free space map

2008-12-16 Thread Scott Marlowe
On Tue, Dec 16, 2008 at 5:55 PM, Phillip Berry pbe...@stellaconcepts.com wrote: Hi Everyone, Just wondering what the maximum reasonable free space map setting should be? I'm receiving the following advice from vacuum: INFO: free space map contains 170803 pages in 117 relations DETAIL:

Re: [GENERAL] Rows count in the cursor ?

2008-12-16 Thread Allan Kamau
Hi Ivanmara, There are two things about cursors you may need to remember ( I hope I do remember fairly well not to error in this response :-) ). 1) A cursor is similar to a pointer to a given record, which means it's vision is limited to the current record, and you move the cursor forward by

Re: [GENERAL] Need help to dynamically access to colomns in function!

2008-12-16 Thread Hoover, Jeffrey
Create a plpgsql function that reformats your row as an array. Example: I have a table named task_parameter with three columns: Table camera.task_parameter Column | Type | Modifiers

Re: [GENERAL] Is this a security risk?

2008-12-16 Thread Albe Laurenz
Adam Witney wrote: I would like to provide a limited view of my database to some users, so i thought of creating a second database (I can control access by IP address through pg_hba.conf) with some views that queried the first database using dblink. In my opinion dblink is not the right