[GENERAL] using trigger to change statusin one table from the modification in other table

2011-09-14 Thread Marcos Hercules Santos
Hello guys, i'm trying to use trigger in these two tables below, in order to do the following; To cancel the booking of an accommodation, since the customer do the host (status = Cancelled) in the book_rooms table. Changing the state of accommodation to occupied (Accommodation Table). CREATE

Re: [GENERAL] Problem with the 9.1 one-click installer Windows7 64bit

2011-09-14 Thread Thomas Kellerer
Craig Ringer, 14.09.2011 06:20: I forwarded your message to Dave Page in case the EDB folks needed to look into this. He commented that: Aside from the fact that icacls is hanging for reasons unknown, it appears to be doing what it is designed to do - it traverses up the path from the data

Re: [GENERAL] Query performance help with 'shadow table' approach.

2011-09-14 Thread Alban Hertroys
On 13 Sep 2011, at 23:44, Brian Fehrle wrote: These queries basically do a 'select max(primary_key_column) from table group by column1, column2. Because of the group by, we would result in a sequential scan of the entire table which proves to be costly. That seems to suggest a row where the

Re: [GENERAL] PostgreSQL benchmarked on XFS vs ZFS vs btrfs vs ext4

2011-09-14 Thread Toby Corkindale
On 14/09/11 12:56, Andy Colson wrote: On 09/13/2011 08:15 PM, Toby Corkindale wrote: Hi, Some months ago, I ran some (probably naive) benchmarks looking at how pgbench performed on an identical system with differing filesystems. (on Linux). [snip] Did you test unplugging the power cable in

[GENERAL] Stability of 9.1.0

2011-09-14 Thread pasman pasmański
Hi. I install postgresql 9.1.0 version Win32 from enterprisedb (WinXp+sp3). Every about 0,5 - 6 hours server stops. Whats going on ?? Below a example log file: 2011-09-14 08:49:37 CEST FATAL: the database system is starting up 2011-09-14 08:49:38 CEST LOG: checkpoint complete: wrote 2179

Re: [GENERAL] Stability of 9.1.0

2011-09-14 Thread pasman pasmański
I think that using any function in plperlu language stops the server. Perl version is 5.14 from activestate. 2011/9/14, pasman pasmański pasma...@gmail.com: Hi. I install postgresql 9.1.0 version Win32 from enterprisedb (WinXp+sp3). Every about 0,5 - 6 hours server stops. Whats going on ??

Re: [GENERAL] pg_dump with select command

2011-09-14 Thread Adarsh Sharma
Any update on below issue. Thanks Adarsh Sharma wrote: Dear all, Today I need some part ( subset ) of some tables to another database to a remote server. I need to take backup of tables after satisfying a select query. Is there any option to specify query in pg_dump command.I researched

Re: [GENERAL] pg_dump with select command

2011-09-14 Thread Raymond O'Donnell
On 14/09/2011 10:31, Adarsh Sharma wrote: Any update on below issue. Thanks Adarsh Sharma wrote: Dear all, Today I need some part ( subset ) of some tables to another database to a remote server. I need to take backup of tables after satisfying a select query. Is there any

Re: [GENERAL] pg_dump with select command

2011-09-14 Thread Scott Mead
On Wed, Sep 14, 2011 at 5:31 AM, Adarsh Sharma adarsh.sha...@orkash.comwrote: Any update on below issue. Someone already responded to you with the answer, don't top-post. Thanks Adarsh Sharma wrote: Dear all, Today I need some part ( subset ) of some tables to another database to a

[GENERAL] Bit datatype performance?

2011-09-14 Thread Antonio Vieiro
Hi all, One of my entities 'E' may be 'tagged' with an arbitrary set of 256 tags 'T'. A first approach could be to add a M:N relationship between 'E' and 'T'. A second way to do this could be to add a BIT(256) datatype to 'E', setting bits to '1' if the entity is tagged with each one of the 256

[GENERAL] using trigger to change status in one table from the modification in other table

2011-09-14 Thread Marcos Hercules Santos
Hello guys, i'm trying to use trigger in these two tables below, in order to do the following; To cancel the booking of an accommodation, since the customer do the host (status = Cancelled) in the book_rooms table. Changing the state of accommodation to occupied (Accommodation Table). CREATE

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread David Johnston
On Sep 14, 2011, at 6:00, Antonio Vieiro anto...@antonioshome.net wrote: Hi all, One of my entities 'E' may be 'tagged' with an arbitrary set of 256 tags 'T'. A first approach could be to add a M:N relationship between 'E' and 'T'. A second way to do this could be to add a BIT(256)

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread Radosław Smogura
On Wed, 14 Sep 2011 12:00:35 +0200, Antonio Vieiro wrote: Hi all, One of my entities 'E' may be 'tagged' with an arbitrary set of 256 tags 'T'. A first approach could be to add a M:N relationship between 'E' and 'T'. A second way to do this could be to add a BIT(256) datatype to 'E',

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread pasman pasmański
Other option is use an array of int2 instead of bit(256). It can be indexed. 2011/9/14, Radosław Smogura rsmog...@softperience.eu: On Wed, 14 Sep 2011 12:00:35 +0200, Antonio Vieiro wrote: Hi all, One of my entities 'E' may be 'tagged' with an arbitrary set of 256 tags 'T'. A first

Re: [GENERAL] PostgreSQL benchmarked on XFS vs ZFS vs btrfs vs ext4

2011-09-14 Thread Ivan Voras
On 14/09/2011 09:30, Toby Corkindale wrote: On 14/09/11 12:56, Andy Colson wrote: On 09/13/2011 08:15 PM, Toby Corkindale wrote: Hi, Some months ago, I ran some (probably naive) benchmarks looking at how pgbench performed on an identical system with differing filesystems. (on Linux).

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread Antonio Vieiro
Hi again, Thanks for the tip. In fact I was thinking of creating an index on the bitmask, so I could use: ... where t.bits = :mymask directly, avoiding a full table scan. I assume this is possible (indexing bit and comparing bits), isn't it? Thanks, Antonio El 14/09/11 15:58, Radosław

[GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Rich Shepard
I run this SELECT statement on a table: select distinct(site_id) from chemistry order by site_id; and in the returned set I see: GW-21 GW-22 GW-22 + GW-24 I want to find that row returning 'GW-22 +' because I believe it should be 'GW-23'. However, my attempts to retrieve

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Steve Crawford
I suspect you have a multi-line entry and the '+' is just indicating that the field continues. Try ...where site_id ~ 'GW-22'... (this may take a while if the table is very large). Cheers, Steve On 09/14/2011 09:35 AM, Rich Shepard wrote: I run this SELECT statement on a table: select

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Darren Duncan
Your example suggests that the GW-22 is a substring of the field followed by trailing spaces so you'll want something that searches substrings, whereas = will always just test on matching the entire field. Try like by default, such as where site_id like 'GW-22 %'. I added the space between

Re: [GENERAL] PostgreSQL benchmarked on XFS vs ZFS vs btrfs vs ext4

2011-09-14 Thread Robert Treat
Can you go into some more detail on how you set up ZFS on these systems? Robert Treat conjecture: xzilla.net consulting: omniti.com On Tue, Sep 13, 2011 at 10:56 PM, Andy Colson a...@squeakycode.net wrote: On 09/13/2011 08:15 PM, Toby Corkindale wrote: Hi, Some months ago, I ran some

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Richard Broersma
On Wed, Sep 14, 2011 at 9:42 AM, Steve Crawford scrawf...@pinpointresearch.com wrote: I suspect you have a multi-line entry and the '+' is just indicating that the field continues. Try ...where site_id ~ 'GW-22'... (this may take a while if the table is very large). You might be able to get

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Darren Duncan
Darren Duncan wrote: Try like by default, such as where site_id like 'GW-22 %'. I added the space between the 22 and the wildcard % so that the field containing just 'GW-22' isn't also matched. Sorry, I should have said where site_id like 'GW-22%' and site_id != 'GW-22' (no explicit space)

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Rich Shepard
On Wed, 14 Sep 2011, Steve Crawford wrote: I suspect you have a multi-line entry and the '+' is just indicating that the field continues. Steve, et al.: It's not multi-line, but malformed. Try ...where site_id ~ 'GW-22'... (this may take a while if the table is very large). This

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Richard Broersma
On Wed, Sep 14, 2011 at 10:04 AM, Rich Shepard rshep...@appl-ecosys.com wrote:  This found the appropriate rows. Now, my question is DDL-related:  What is the appropriate syntax to change 'GW-22  +' to GW-22? Can I use 'like' or '~' in an ALTER TABLE RENAME column ... statement? I'm

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Rich Shepard
On Wed, 14 Sep 2011, Richard Broersma wrote: I'm confused. Richard, Apparently, I am also confused. Doing too many things simultaneoulsy. Do you want to UPDATE the affected records to GW-22. Or do you want to ALTER the table to add a column constraint to prevent malformed site_id's in

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread Radosław Smogura
Hi, I think it's not bad approach if performance is important. I don't know how b-tree index will work with bitset datatype, but I assume it should treat is as 256bit number (maybe someone more competive in internals will answer this). Please bear in mind, that this approach will work well

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread Eduardo Piombino
Hi, if you are thinking to access data in that manner, what's the point of bits (or tags)? The idea behind having a value and then using a bitmask is to be able to test the value against different bitmasks, each bitmask corresponding to a different tag or tag combination. The *where *statement

[GENERAL] Arrays

2011-09-14 Thread Bob Pawley
Hi Is there a method of counting the number of elements in an array?? Bob

Re: [GENERAL] Arrays

2011-09-14 Thread Fabrízio de Royes Mello
2011/9/14 Bob Pawley rjpaw...@shaw.ca Hi Is there a method of counting the number of elements in an array?? Yes... Use function array_upper [1]. See an example: postgres@bdteste=# SELECT array_upper(ARRAY['foo', 'bar'], 1); array_upper - 2 (1 row) [1]

Re: [GENERAL] Arrays

2011-09-14 Thread Merlin Moncure
On Wed, Sep 14, 2011 at 1:05 PM, Fabrízio de Royes Mello fabriziome...@gmail.com wrote: 2011/9/14 Bob Pawley rjpaw...@shaw.ca Hi Is there a method of counting the number of elements in an array?? Yes... Use function array_upper [1]. See an example: postgres@bdteste=# SELECT

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Merlin Moncure
On Wed, Sep 14, 2011 at 12:04 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Wed, 14 Sep 2011, Steve Crawford wrote: I suspect you have a multi-line entry and the '+' is just indicating that the field continues. Steve, et al.:  It's not multi-line, but malformed. It *is* mult-line.

Re: [GENERAL] Arrays

2011-09-14 Thread Steve Crawford
On 09/14/2011 11:01 AM, Bob Pawley wrote: Hi Is there a method of counting the number of elements in an array?? Bob Look at array_dims, array_upper and array_lower. But note that PostgreSQL allows multi-dimensional arrays. The array_dims function gives you all the dimensions. If you have a

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread Antonio Vieiro
Hi, Thanks for the tip. Maybe two UUIDs are a best approach. I'll see which is more performant. Kind regards, Antonio El 14/09/11 19:32, Radosław Smogura escribió: Hi, I think it's not bad approach if performance is important. I don't know how b-tree index will work with bitset datatype,

Re: [GENERAL] Query performance help with 'shadow table' approach.

2011-09-14 Thread Brian Fehrle
On 09/14/2011 01:10 AM, Alban Hertroys wrote: On 13 Sep 2011, at 23:44, Brian Fehrle wrote: These queries basically do a 'select max(primary_key_column) from table group by column1, column2. Because of the group by, we would result in a sequential scan of the entire table which proves to be

Re: [GENERAL] PostgreSQL 9.1, replica and unlogged tables

2011-09-14 Thread Marc Mamin
Writing to any table on the standby is strictly forbidden so you can forget having your own volatile copy. Hello, It should be possible to declare a -non postgres- SQL/MED table pointing e.g. to a csv on localhost, souldn't it ? best regards, Marc Mamin

Re: [GENERAL] Problem with the 9.1 one-click installer Windows7 64bit

2011-09-14 Thread Brar Piening
Thomas Kellerer wrote: So I killed the iacls.exe and the script proceeded, just to hang at the next call to icacls.exe when it tried to set the privileges on the directory for the postgres user despite the fact that that user already was the owner and had full control over it. So I killed

Re: [GENERAL] Identifying Reason for Column Name Returned by SELECT

2011-09-14 Thread Rich Shepard
On Wed, 14 Sep 2011, Merlin Moncure wrote: It *is* mult-line. psql uses a '+ to show line breaks: Merlin, Yep. I discovered this when I dumped the table as an ASCII text file and saw the '\n' after the site_id string on some rows. I've no idea how it got there. Thanks, Rich -- Sent via

Re: [GENERAL] PostgreSQL benchmarked on XFS vs ZFS vs btrfs vs ext4

2011-09-14 Thread Tomas Vondra
Dne 14.9.2011 03:15, Toby Corkindale napsal(a): Hi, Some months ago, I ran some (probably naive) benchmarks looking at how pgbench performed on an identical system with differing filesystems. (on Linux). Since then the kernel-level version of ZFS became usable, and there have been

[GENERAL] Noob help for charting on web site, need assistance

2011-09-14 Thread Greg Howard
I am new to the mailing list and to PostgreSQL. I am currently running PostgreSQL 9.0.4 on a Windows XP laptop. I am successfully logging sensor data to a database (temperature, humidity, voltage, etc…), I would like to display the data in a chart on a web site. Currently I am have

Re: [GENERAL] Query performance help with 'shadow table' approach.

2011-09-14 Thread Alban Hertroys
On 14 Sep 2011, at 20:45, Brian Fehrle wrote: That is only about 1/30th of your table. I don't think a seqscan makes sense here unless your data is distributed badly. Yeah the more I look at it, the more I think it's postgres _thinking_ that it's faster to do a seqential scan. I'll be

Re: [GENERAL] Noob help for charting on web site, need assistance

2011-09-14 Thread Steve Crawford
On 09/14/2011 02:56 PM, Greg Howard wrote: I am new to the mailing list and to PostgreSQL. I am currently running PostgreSQL 9.0.4 on a Windows XP laptop. I am successfully logging sensor data to a database (temperature, humidity, voltage, etc…), I would like to display the data in a chart on

Re: [GENERAL] Noob help for charting on web site, need assistance

2011-09-14 Thread Andy Colson
On 09/14/2011 04:56 PM, Greg Howard wrote: I am new to the mailing list and to PostgreSQL. I am currently running PostgreSQL 9.0.4 on a Windows XP laptop. I am successfully logging sensor data to a database (temperature, humidity, voltage, etc…), I would like to display the data in a chart on

[GENERAL] Cryptic Error Message Importing Table Dump

2011-09-14 Thread Rich Shepard
Now that I fixed the rows that had the inadvertent newlines in one column, I'm trying to read in the fixed table from the .sql file produced by pg_dump. I know there are duplicate rows now that I removed the newlines, and those are easily fixed (although the reported line numbers don't match

Re: [GENERAL] Noob help for charting on web site, need assistance

2011-09-14 Thread Joshua D. Drake
On 09/14/2011 02:56 PM, Greg Howard wrote: I am new to the mailing list and to PostgreSQL. I am currently running PostgreSQL 9.0.4 on a Windows XP laptop. I am successfully logging sensor data to a database (temperature, humidity, voltage, etc…), I would like to display the data in a chart

Re: [GENERAL] PostgreSQL benchmarked on XFS vs ZFS vs btrfs vs ext4

2011-09-14 Thread Toby Corkindale
On 15/09/11 02:46, Robert Treat wrote: Can you go into some more detail on how you set up ZFS on these systems? I'm afraid my knowledge of ZFS is rather weak compared to the other filesystems - all I really did was zpool create followed by zfs create, using all the defaults. The zpool was

Re: [GENERAL] pg_dump with select command

2011-09-14 Thread Adarsh Sharma
I am sorry Sir, but Still I am not able to solve the issue. I followed the below steps they are :- 1. Create table from the main tables by *create table as select* command. 2. Then I take the backup of that tables and restore on the remote machine. 3. After this I have to change the table

[GENERAL] how to use all the options of EXPLAIN?

2011-09-14 Thread AI Rumman
Could anyone please tell me how to use all the options of explain in Postgresql 9. http://www.postgresql.org/docs/9.0/static/sql-explain.html I can use EXPLAIN ANALYZE. FORMAT: explain (format yaml) select * from tab1; QUERY PLAN --- -