[GENERAL] DTrace and PostgreSQL

2007-04-12 Thread Karen Hill
I've got Solaris 10 11/06 on my PC. I removed the static keyword in src/backend/access/transam/xact.c. for the AbortTransaction and CommitTransaction functions declarations and compiled 8.2.3. Everything works nicely. I was wondering if DTrace could tell me how many inserts are being done in a

[GENERAL] How do I use returning in a view?

2007-02-17 Thread Karen Hill
CREATE RULE ins_productionlog AS ON INSERT TO vwProductionlog DO INSTEAD ( INSERT INTO PRODUCTIONLOG (machine_name,product_serial_id,production_time,product_number,id) VALUES (new.machine_name, new.product_serial_id, new.production_time,new.product_number, DEFAULT) RETURNING

[GENERAL] Npgsql and 57014 query_canceled error message

2007-02-06 Thread Karen Hill
I'm doing some testing on a larger dataset, and I've started getting a 57014 error message when I catch an NpgsqlException. I thought it might be timing out on me, so in the connection string I've set the time out settings to the maximum of 1024 seconds before timeout. Has anyone else

Re: [GENERAL] PostgreSQL 9.0

2007-01-30 Thread Karen Hill
On Jan 29, 11:06 pm, [EMAIL PROTECTED] (Dawid Kuroczko) wrote: * updatable views [ or am I missing something? ] -- it seems to me they were close to be completed, but I don't remember if they were completed and committed or not. PostgreSQL has updatable views via the rules system. I use

[GENERAL] Can a function be parameter in PL/PGSQL function?

2007-01-30 Thread Karen Hill
Is it possible to have a pl/pgsql function take another pl/pgsql function as one of the parameters? regards, karen ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your

[GENERAL] PostgreSQL 9.0

2007-01-29 Thread Karen Hill
I was just looking at all the upcoming features scheduled to make it into 8.3, and with all those goodies, wouldn't it make sense for this to be a 9.0 release instead of an 8.3? It looks like postgresql is rapidly catching up to oracle if 8.3 branch gets every feature scheduled for it. About

[GENERAL] PostgreSQL 9.0

2007-01-29 Thread Karen Hill
I was just looking at all the upcoming features scheduled to make it into 8.3, and with all those goodies, wouldn't it make sense for this to be a 9.0 release instead of an 8.3? It looks like postgresql is rapidly catching up to oracle if 8.3 branch gets every feature scheduled for it. About

[GENERAL] Can you specify the pg_xlog location from a config file?

2007-01-26 Thread Karen Hill
Windows doesn't support symlinks. Is it possible instead for there to be a config file that lets one set where the pg_xlog directory will sit? ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Rollback using WAL files?

2007-01-26 Thread Karen Hill
On Jan 26, 9:45 am, [EMAIL PROTECTED] (Tom Lane) wrote: Florian Weimer [EMAIL PROTECTED] writes: In theory, this should be possible (especially if you haven't switched off full page writes).Not really --- the WAL records are not designed to carry full information about the preceding

Re: [GENERAL] Spam from EnterpriseDB?

2007-01-19 Thread Karen Hill
Alan Hodgson wrote: On Thursday 18 January 2007 15:54, Steve Atkins [EMAIL PROTECTED] wrote: Anyone else get spam from EnterpriseDB today, talking about Postgresql Support Services? yep. You really would think that even the marketing weenies might know better by now. I do think that

Re: [GENERAL] OS X Tiger, and PostgreSQL 8.2 don't mix?

2006-12-28 Thread Karen Hill
Chris Mair wrote: I have OS X tiger with all the updates: uname -r 8.8.0 Here is what I get when I try to initdb on a freshly compiled 8.2: selecting default max_connections ... 10 selecting default shared_buffers/max_fsm_pages ... 400kB/2 creating configuration files ...

Re: [GENERAL] OS X Tiger, and PostgreSQL 8.2 don't mix?

2006-12-28 Thread Karen Hill
Tom Lane wrote: Karen Hill [EMAIL PROTECTED] writes: I still get the error when I initdb. OS X and PostgreSQL has worked before for me, compiled from the source. Works for me. What do you get from sysctl -a | grep sysv ? sysctl -a | grep sysv kern.sysv.shmmax: 4194304 kern.sysv.shmmin

[GENERAL] OS X Tiger, and PostgreSQL 8.2 don't mix?

2006-12-27 Thread Karen Hill
I have OS X tiger with all the updates: uname -r 8.8.0 Here is what I get when I try to initdb on a freshly compiled 8.2: selecting default max_connections ... 10 selecting default shared_buffers/max_fsm_pages ... 400kB/2 creating configuration files ... ok creating template1 database in

[GENERAL] PostgreSQL, LGPL and GPL.

2006-10-20 Thread Karen Hill
I was looking through the various contrib packages and pgfoundry projects. I noticed that many of them are GPL like PostGIS or LGPL like Npgsql. I have questions. If you make create a PostgreSQL database that uses PostGIS and you distribute that database, than your database (tables, stored

Re: [GENERAL] division by zero error in a request

2006-10-18 Thread Karen Hill
Bernard Grosperrin wrote: I wants to make a view giving me some statistics. I am not sure to understand why something like this SELECT location_id, (sold_parts_amount_dly + sold_labor_amount_dly) / (sold_parts_amount_dly + sold_labor_amount_dly) from sales give me a division by zero

Re: [GENERAL] more anti-postgresql FUD

2006-10-17 Thread Karen Hill
Merlin Moncure wrote: SELECT * FROM TABLE ORDER BY pk LIMIT 10 OFFSET N; using offset to walk a table is extremely poor form because of: * poor performance * single user mentality * flat file mentality databases are lousy at this becuase they inheritly do not support abolute

Re: [GENERAL] Find out the number of rows returned by refcursor?

2006-10-12 Thread Karen Hill
Karen Hill wrote: Tom Lane wrote: Karen Hill [EMAIL PROTECTED] writes: -- Is there a way to know the total number of rows the cursor is capable of traversing without using --count? If you want an accurate count, the only way is to traverse the cursor. Consider using MOVE FORWARD ALL

Re: [GENERAL] Find out the number of rows returned by refcursor?

2006-10-11 Thread Karen Hill
Karen Hill wrote: What is the best way to find out the total number of rows returned by an refcursor? This would allow the client user to know the total amount of rows as they are using FETCH FORWARD/BACKWARD. For example let's say that an refcursor has 300 rows. The user fetches 20

Re: [GENERAL] Find out the number of rows returned by refcursor?

2006-10-11 Thread Karen Hill
Tom Lane wrote: Karen Hill [EMAIL PROTECTED] writes: -- Is there a way to know the total number of rows the cursor is capable of traversing without using --count? If you want an accurate count, the only way is to traverse the cursor. Consider using MOVE FORWARD ALL and noting the rowcount

[GENERAL] Find out the number of rows returned by refcursor?

2006-10-10 Thread Karen Hill
What is the best way to find out the total number of rows returned by an refcursor? This would allow the client user to know the total amount of rows as they are using FETCH FORWARD/BACKWARD. For example let's say that an refcursor has 300 rows. The user fetches 20 at a time. I would like the

[GENERAL] refcursor error 55000

2006-10-08 Thread Karen Hill
I get an error message 55000 when I try to traverse backwards in an refcursor. Works fine going forward. The hint says I need to use scroll. What is the syntax for using scroll in a stored procedure that returns an refcursor? Or do refcursors only support traversing forward?

[GENERAL] cyclical redundancy checksum algorithm(s)?

2006-09-27 Thread Karen Hill
I just finished reading one of Ralph Kimball's books. In it he mentions something called a cyclical redundancy checksum (crc) function. A crc function is a hash function that generates a checksum. I am wondering a few things. A crc function would be extremely useful and time saving in

Re: [GENERAL] cyclical redundancy checksum algorithm(s)?

2006-09-27 Thread Karen Hill
Gene Wirchenko wrote: I just finished reading one of Ralph Kimball's books. In it he mentions something called a cyclical redundancy checksum (crc) function. A crc function is a hash function that generates a checksum. I am wondering a few things. A crc function would be extremely

Re: [GENERAL] cyclical redundancy checksum algorithm(s)?

2006-09-27 Thread Karen Hill
Tom Lane wrote: Karen Hill [EMAIL PROTECTED] writes: Ralph Kimball states that this is a way to check for changes. You just have an extra column for the crc checksum. When you go to update data, generate a crc checksum and compare it to the one in the crc column. If they are same, your

[GENERAL] [OT] PHP vs Postgresql argument on Slashdot's front page.

2006-09-15 Thread Karen Hill
Looks like the PHP vs Postgresql argument is on slashdot.org's front page. Just giving everyone a heads up so they can go and defend postgresql. ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Stored Procedure performance / elegance question

2006-09-08 Thread Karen Hill
x-no-archive:yes Hello. I have a stored procedure which returns a setof record. The function takes a few arguments, and if a couple of specific input values are null, it is required that the stored procedure perform different actions. I know that the planner does not store the plan when

Re: [GENERAL] Stored Procedure performance / elegance question

2006-09-08 Thread Karen Hill
Merlin Moncure wrote: On 8 Sep 2006 11:57:54 -0700, Karen Hill [EMAIL PROTECTED] wrote: I know that the planner does not store the plan when EXECUTE is used in a function, but the function looks better when the sql is created dynamically. my general rule is use static when you can

Re: [GENERAL] Insert Only Postgresql

2006-09-08 Thread Karen Hill
Don't forget that one can create a DO NOTHING rules for DELETE and UPDATE in addition to the INSERT only privilege. This will prevent even the owner of the table from doing any accidental updating or deleting. Brandon Aiken wrote: Sure. Any RDBMS can do that. Just create a user account

Re: [GENERAL] strange sum behaviour

2006-08-29 Thread Karen Hill
Andrew Baerg wrote: Hi, I am getting strange results from the sum function as follows: corp=# select amount from acc_trans where trans_id=19721 and chart_id=10019; amount - 4.88 117.1 -121.98 (3 rows) corp=# select sum(amount) from acc_trans where trans_id=19721 and

Re: [GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-25 Thread Karen Hill
Alvaro Herrera wrote: Karen Hill wrote: It would be really great if PostgreSQL supported SQL:2003 Window functions. I know that oracle and sql server have them already, so it would make postgres competitive in that area. I know there is a feature freeze for 8.2, is it doable for 8.3

[GENERAL] SQL:2003 Window Functions for postgresql 8.3?

2006-08-24 Thread Karen Hill
I know that in pgsql.hackers they are discussing what to market the upcoming 8.2 release as. They mention updatable views, but realistically, PostgreSQL has had them via rules forever. I consider myself a database novice , and even I've created updatable views using rules quite easily. It

[GENERAL] money type depreciated?

2006-08-01 Thread Karen Hill
I read in the documentation that the money type is depreciated. It says to use the to_char function and NUMERIC/decimal instead. Why was the money type depreciated when it was so useful? How would be the best way to use to_char and numeric to replace that type since I don't want to be using a

[GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread Karen Hill
How many tables and rows can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what kind of hardware and OS works best? What is an effective way to predict

[GENERAL] PostgreSQL theoretical maximums.

2006-07-27 Thread Karen Hill
How many tables can PostgreSQL theoretically and then practically handle? What is the largest database size possible? What was the biggest database you've ever had on PostgreSQL? What were the challenges and what kind of hardware and OS works best? What is an effective way to predict database

[GENERAL] CREATE DATABASE question.

2006-07-26 Thread Karen Hill
I have an sql file that doesn' t work properly when I do: psql mysql.sql . I cannot get it to connect to the database. Here what I'd like it to do: CREATE DATABASE testdb; \c testdb; CREATE TABLE tableTest(var varchar); But I get an error on the second line about an invalid character. Is it

Re: [GENERAL] Is there a way to run tables in RAM?

2006-07-13 Thread Karen Hill
Roy Souther wrote: I would like to know if there is anyway to move a section of some tables into RAM to work on them. I have large table, about 700MB or so and growing. I also have a bizarre collection of queries that run hundreds of queries on a small section of this table. These queries

[GENERAL] US Telephone Number Type

2006-07-10 Thread Karen Hill
Hello, How would one go about creating a US telephone type in the format of (555)-555- ? I am at a loss on how it could be accomplished in the most correct way possible while not going into the various different country styles e.g. +01 (555) 555-. Is the difficulty of creating a

Re: [GENERAL] US Telephone Number Type

2006-07-10 Thread Karen Hill
Tom Lane wrote: It doesn't seem particularly hard to make a type that stores just the digits (applying whatever amount of error-checking seems appropriate on the non-digit stuff it's throwing away) and on output regurgitates a standardized format. Minimum support would just be an input

[GENERAL] A function which returns all rolname from pg_roles.

2006-07-10 Thread Karen Hill
How do I make this function work? I am trying to get all the rolnames from pg_roles. CREATE OR REPLACE FUNCTION test() SETOF name AS $$ DECLARE rrol name; BEGIN SELECT rolname INTO rrol FROM pg_roles; RETURN setof rrol; END; $$ LANGUAGE plpgsql; regards, ---(end of

Re: [GENERAL] How do I revoke CREATE TABLE and other privileges?

2006-07-06 Thread Karen Hill
Michael Fuhr wrote: On Wed, Jul 05, 2006 at 02:27:19PM -0700, Karen Hill wrote: I would like for one role to be able to login, and execute a couple of functions and nothing else. I've tried to revoke access to CREATE on the database, schema, and tablespace but when I tested it, the user

[GENERAL] Best way to deal with quote_literal issue?

2006-07-06 Thread Karen Hill
Hello. I have client software that I wrote which uses parameters in function calls to postgresql. I use quote_literal in postgresql functions. That means I get data that is quoted when it finally ends up in the tables which I don't want. I know that you shouldn't trust data sent from the

[GENERAL] How do I revoke CREATE TABLE and other privileges?

2006-07-05 Thread Karen Hill
I would like for one role to be able to login, and execute a couple of functions and nothing else. I've tried to revoke access to CREATE on the database, schema, and tablespace but when I tested it, the user was still allowed to create tables. regards, ---(end of

[GENERAL] Is it possible to disable insert/update/delete triggers for one transaction and not another?

2006-06-28 Thread Karen Hill
I have an insert/update/delete trigger on all my tables which add data to a log table. I would like to be able to disable them when the tables are called from one stored proceedure I have. Yet I would still like those triggers to fire on any other operation that is happening concurrently. Is

[GENERAL] INSERT RULE doesn't allow OLD, so how does one work with serial datatypes?

2006-05-13 Thread Karen Hill
I'm having a bit of mystery in solving a postgresql puzzle. I have a table that when it gets inserted or updated or deleted it is logged into a log table. The log table contains who (current_user) did the insert/update/delete the CURRENT_TIMESTAMP. Everything works great except the INSERT

[GENERAL] top predicate

2006-05-11 Thread Karen Hill
It seems PostgreSQL doesn't have a TOP Predicate. Why is that? Here is an example: SELECT TOP 10 products from sales; ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] top predicate

2006-05-11 Thread Karen Hill
Tom Lane wrote: Karen Hill [EMAIL PROTECTED] writes: It seems PostgreSQL doesn't have a TOP Predicate. Why is that? It's not in the SQL standard. If we were to implement something like what I think you're asking for (your example is way underspecified), it'd probably look like SQL2003's

Re: [GENERAL] top predicate

2006-05-11 Thread Karen Hill
Jan de Visser wrote: On Thursday 11 May 2006 16:34, Karen Hill wrote: It seems PostgreSQL doesn't have a TOP Predicate. Why is that? Here is an example: SELECT TOP 10 products from sales; Just for my understanding: This would return the 10 products with the most matching sales rows

[GENERAL] Preventing SQL Injection in PL/pgSQL in psql

2006-05-09 Thread Karen Hill
Is my understanding correct that the following is vulnerable to SQL injection in psql: CREATE OR REPLACE FUNCTION fx ( my_var bchar) RETURNS void AS $$ BEGIN INSERT INTO fx VALUES ( my_var ) ; END; $$ LANGUAGE 'plpgsql' VOLATILE Where this is NOT subject to SQL injection: CREATE OR REPLACE

[GENERAL] What is your favorite front end for user interaction to postgresql databases?

2006-05-08 Thread Karen Hill
What is your favorite front end for end users to interact with your postgresql db? Is it java, .net, web apache + php, MS-Access, ruby on rails? Why is it your favorite? Which would you recommend for end users on multiple OSes? Also, what do you think of having the database management system

[GENERAL] Is an updateable/insertable recordset via ADO possible using MS-Access?

2006-05-05 Thread Karen Hill
Hello. I have an MS - Access front end which connects to PostgreSQL 8.1.3. Almost everything is working great, I especially love how I can use rules in PostgreSQL to be able to update and insert into views, which is awesome. Now my only issue, and I'm not sure this is even possible but here it

Re: [GENERAL] insert into a view?

2006-05-03 Thread Karen Hill
Tom Lane wrote: I hope it said rules, because you can't put a trigger on a view. regression=# create table t(f1 int, f2 text); CREATE TABLE regression=# create view v as select * from t; CREATE VIEW regression=# insert into v values(22, 'foo'); ERROR: cannot insert into a view HINT:

[GENERAL] insert into a view?

2006-05-01 Thread Karen Hill
Tried it but didn't work. It gave me a hint though to try triggers. Can anyone show me how to do an insert into a view using triggers? Thanks. :-) ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ?

Re: [GENERAL] Transactions, PostgreSQL and MS Access front end.

2006-04-24 Thread Karen Hill
Cool. I knew ADO could do transactions on Access's JET database engine, but didn't know they could do so on another RDBMS like PostgreSQL. So basically I can use the BeginTrans and CommitTrans to do the work of PostgreSQL's BEGIN; and COMMIT; On a adjacent topic, how does PostgreSQL know that

[GENERAL] Transactions, PostgreSQL and MS Access front end.

2006-04-23 Thread Karen Hill
From Access I'd like to run pass the following from MS Access to PostgreSQL 8.1 using VBA: BEGIN; UPDATE accounts SET balance = balance + 100.00 WHERE acctnum = 12345; UPDATE accounts SET balance = balance - 100.00 WHERE acctnum = 7534; COMMIT; It won't let me. Any ideas solutions?

Re: [GENERAL] Transactions, PostgreSQL and MS Access front end.

2006-04-23 Thread Karen Hill
Bruce Momjian wrote: Karen Hill wrote: From Access I'd like to run pass the following from MS Access to PostgreSQL 8.1 using VBA: BEGIN; UPDATE accounts SET balance = balance + 100.00 WHERE acctnum = 12345; UPDATE accounts SET balance = balance - 100.00 WHERE acctnum = 7534; COMMIT