Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-27 Thread Tom Lane
Alvaro Herrera writes: > Maybe we should have another inter-backend signal: when a process gets > ENFILE, signal all other backends and they close a bunch of files each. I was wondering about that myself, but on balance I think it'd be a lot of work to achieve not much. What you would have is th

Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-27 Thread Greg Stark
On Fri, Aug 28, 2009 at 4:13 AM, Alvaro Herrera wrote: > Maybe we should have another inter-backend signal: when a process gets > ENFILE, signal all other backends and they close a bunch of files each. I wonder if this is a new problem due to the FSM and VM using up extra file handles? -- greg

Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-27 Thread Alvaro Herrera
Vick Khera wrote: > On Tue, Aug 25, 2009 at 4:55 PM, Tom Lane wrote: > > I've always thought that the fd.c layer is more about not having to > > configure the code explicitly for max-files-per-process limits.  Once > > you get into ENFILE conditions, even if Postgres manages to stay up, > > everyth

Re: [GENERAL] Is there a function for Converting a Decimal into BINARY ?

2009-08-27 Thread Harvey, Allan AC
> Eg: > I have a datatype in the DB which needs to be converted. > > DEC = 192 > BINARY = 1100 How about this gwmdb=> select 192::bit(16); bit -- 1100 (1 row) Hope that helps Allan The material contained in this email may be confidential, p

Re: [GENERAL] Is there a function for Converting a Decimal into BINARY ?

2009-08-27 Thread John R Pierce
Ow Mun Heng wrote: Hi Guys, Searching the net didn't give me much clues as to how to convert a Decimal number into BINARY. well, a decimal number is a fixed point number stored in a modified BCD format, which optionally can contain a decimal fractional component. you likely would want to

[GENERAL] Is there a function for Converting a Decimal into BINARY ?

2009-08-27 Thread Ow Mun Heng
Hi Guys, Searching the net didn't give me much clues as to how to convert a Decimal number into BINARY. Eg: I have a datatype in the DB which needs to be converted. DEC = 192 BINARY = 1100 DEC = 197 BINARY = 11000101 Which I then need to break down into pairs to do calculations on 11 : 0

Re: [GENERAL] Viable alternatives to SQL?

2009-08-27 Thread Merlin Moncure
On Thu, Aug 27, 2009 at 9:43 AM, Kelly Jones wrote: > Many sites let you search databases of information, but the search > queries are very limited. > > I'm creating a site that'll allow arbitrary SQL queries to my data (I > realize I'll need to handle injection attacks). > > Are there other viable

Re: [GENERAL] GUI to edit a table's content

2009-08-27 Thread Thomas Kellerer
Gauthier, Dave wrote on 27.08.2009 23:17: Are there any GUI apps out there that can be used to edit (insert, update, delete) table data? SOmething with enough smarts to sniff out constraint violations and report accordingly. Also, ability to eval constraints at commit time inside a transactio

[GENERAL] GUI to edit a table's content

2009-08-27 Thread Gauthier, Dave
Are there any GUI apps out there that can be used to edit (insert, update, delete) table data? SOmething with enough smarts to sniff out constraint violations and report accordingly. Also, ability to eval constraints at commit time inside a transaction (option to rollback of course). Thanks f

Re: [GENERAL] Postgres Kickstart/Anaconda auto-install

2009-08-27 Thread Devrim GÜNDÜZ
On Thu, 2009-08-27 at 16:28 -0400, Alan McKay wrote: > Any ideas out there? There is a ks file that I wrote for PostgreSQL Live CD's: https://projects.commandprompt.com/public/pgcore/browser/livecd/PG84-Fedora-x86.ks This may guide you. It is for Fedora-11, but you can easily move it to RHEL 5.

Re: [GENERAL] A safe way to upgrade table definitions by using ALTER's

2009-08-27 Thread Steve Atkins
On Aug 27, 2009, at 1:42 PM, Sergey Samokhin wrote: Hello. As I know upgrading database structure from one version to another is usually done by applying some sql-script with a set of ALTER's that do all the work. But how do programmers guarantee that ALTER's they have wrote will always be ap

Re: [GENERAL] Postgres Kickstart/Anaconda auto-install

2009-08-27 Thread Alan McKay
> And within the directory for that repo, I've created a comps.xml file And of course re-run "createrepo" ... -- “Don't eat anything you've ever seen advertised on TV” - Michael Pollan, author of "In Defense of Food" -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] query that worked in 8.1 not working in 8.4

2009-08-27 Thread Sean Foreman
Thanks Tom. That is what I suspected. I will install the branch tip on Monday and see if the problem goes away. Sean Tom Lane wrote: Sean Foreman writes: We recently upgraded postgres from 8.1 to 8.4. One of our queries stopped working and after some digging I've narrowed the problem dow

Re: [GENERAL] query that worked in 8.1 not working in 8.4

2009-08-27 Thread Sean Foreman
This is not an autocast issue. These are all integers. The query plan postgres is choosing to execute looks questionable. I have provided an example of a working query and non-working query. The change is subtle and takes advantage of the questionable query plan to get the results I need. The

[GENERAL] A safe way to upgrade table definitions by using ALTER's

2009-08-27 Thread Sergey Samokhin
Hello. As I know upgrading database structure from one version to another is usually done by applying some sql-script with a set of ALTER's that do all the work. But how do programmers guarantee that ALTER's they have wrote will always be applied by administrators to the corresponding version of

Re: [GENERAL] query that worked in 8.1 not working in 8.4

2009-08-27 Thread Tom Lane
Sean Foreman writes: > We recently upgraded postgres from 8.1 to 8.4. > One of our queries stopped working and after some digging I've narrowed > the problem down to this: > select > count(customer.customer_id) > from > acquire.customer customer > inner join entity_setup.merchant_set

Re: [GENERAL] query that worked in 8.1 not working in 8.4

2009-08-27 Thread Scott Marlowe
On Thu, Aug 27, 2009 at 2:13 PM, Sean Foreman wrote: > We recently upgraded postgres from 8.1 to 8.4. > > One of our queries stopped working and after some digging I've narrowed the > problem down to this: > > table structure of interest: > > merchant_set > merchant_set_id > > merchant > merchant_i

Re: [SQL] [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Rob Sargent
Alvaro Herrera wrote: Rob Sargent escribió: tablelog doesn't appear any more lively than the OPs audittrail2. Perhaps, but I have heard of people using it successfully recently, whereas Nathaniel reported that audittrail2 seems to have obvious bugs. Fair enough. -- Sent via p

[GENERAL] Postgres Kickstart/Anaconda auto-install

2009-08-27 Thread Alan McKay
Hey folks, I realise this is probably more a matter for a kickstart list, but then again, I have to think that someone else on this list has done this and can help. So I'll ask here and there. I'm dragging our company kicking and screaming into the realm of Kickstart/Anaconda, and trying to get

Re: [GENERAL] It looks like transaction, but it isn't transaction

2009-08-27 Thread Sergey Samokhin
Hello, Tom. On Thu, Aug 27, 2009 at 5:25 AM, Tom Lane wrote: > Yes, if it's submitted as a single Query message, that's what happens. > Thanks for the detailed explanation. -- Sergey Samokhin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscr

Re: [GENERAL] query that worked in 8.1 not working in 8.4

2009-08-27 Thread Sean Foreman
There is no error message. Posgres "likes" the query. In this case, the query returns a count of 1 instead of 3562. Scott Marlowe wrote: On Thu, Aug 27, 2009 at 2:13 PM, Sean Foreman wrote: We recently upgraded postgres from 8.1 to 8.4. So, is there an error message you get back? Or

Re: [GENERAL] query that worked in 8.1 not working in 8.4

2009-08-27 Thread Scott Marlowe
On Thu, Aug 27, 2009 at 2:13 PM, Sean Foreman wrote: > We recently upgraded postgres from 8.1 to 8.4. So, is there an error message you get back? Or just no data? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

[GENERAL] query that worked in 8.1 not working in 8.4

2009-08-27 Thread Sean Foreman
We recently upgraded postgres from 8.1 to 8.4. One of our queries stopped working and after some digging I've narrowed the problem down to this: table structure of interest: merchant_set merchant_set_id merchant merchant_id merchant_set_id customer customer_id merchant_set_id -- failure (c

Re: [GENERAL] Getting the column to a which a sequence belongs.

2009-08-27 Thread Thomas Kellerer
Sam Mason wrote on 27.08.2009 21:51: The information is all in the system catalogs; I've not had much opportunity to fiddle with them so far but the following may be a start to help get things out for you. SELECT c.relname, a.attname, t.relname FROM pg_class c, pg_depend d, pg_class t, pg_at

Re: [GENERAL] Getting the column to a which a sequence belongs.

2009-08-27 Thread Sam Mason
On Thu, Aug 27, 2009 at 09:18:57PM +0200, Thomas Kellerer wrote: > I'm trying to extend the Postgres support in my SQL tool. I'm trying to > recreate the SQL for a sequence, and I wonder if there is a way to find > out the column to which a sequence "belongs". The information is all in the syst

Re: [SQL] [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Alvaro Herrera
Rob Sargent escribió: > tablelog doesn't appear any more lively than the OPs audittrail2. Perhaps, but I have heard of people using it successfully recently, whereas Nathaniel reported that audittrail2 seems to have obvious bugs. -- Alvaro Herrerahttp://www.Comman

[GENERAL] Getting the column to a which a sequence belongs.

2009-08-27 Thread Thomas Kellerer
Hi, I'm trying to extend the Postgres support in my SQL tool. I'm trying to recreate the SQL for a sequence, and I wonder if there is a way to find out the column to which a sequence "belongs". I'm talking either about sequences that are created automatically by PG when using the serial datat

Re: [GENERAL] Select data for current week only

2009-08-27 Thread Thomas Kellerer
Sam Mason wrote on 27.08.2009 21:06: The OP leaves it somewhat open, but wouldn't date_trunc be better here? Otherwise you'll end up getting values for other years as well as the current one. Good point, I didn't think of that :) As an alternative, one could explicitely add the year into the

Re: [GENERAL] Select data for current week only

2009-08-27 Thread Sam Mason
On Thu, Aug 27, 2009 at 11:09:36AM -0700, BlackMage wrote: > The field I am using for sorting is a Date type with the format -mm-dd > hh:mm:ss . Values that look like that are normally stored in timestamp columns, not date column. You wouldn't get the time part if it was just a date. -- S

Re: [GENERAL] Select data for current week only

2009-08-27 Thread Sam Mason
On Thu, Aug 27, 2009 at 08:36:45PM +0200, Thomas Kellerer wrote: > BlackMage wrote on 27.08.2009 20:09: > >I only want to select events happening for the current week(Mon-Sun). > > SELECT * > FROM the_table > WHERE extract(week from the_date_column) = extract(date from current_date); The OP leave

Re: [GENERAL] Select data for current week only

2009-08-27 Thread Gerhard Heift
On Thu, Aug 27, 2009 at 11:09:36AM -0700, BlackMage wrote: > > Hey all, > > I've been trying to figure this problem out with just using sql but I'm not > sure how too. I have a table that holds events for each week but I only want > to select events happening for the current week(Mon-Sun). So can

Re: [GENERAL] Select data for current week only

2009-08-27 Thread Edwin Plauchu
you need to group dates per number week 2009/8/27 Edwin Plauchu > Postgresql has these functions > http://www.postgresql.org/docs/8.1/static/functions-formatting.html for > formatting data time > > > 2009/8/27 BlackMage > > >> Hey all, >> >> I've been trying to figure this problem out with just

Re: [GENERAL] Select data for current week only

2009-08-27 Thread Edwin Plauchu
Postgresql has these functions http://www.postgresql.org/docs/8.1/static/functions-formatting.html for formatting data time 2009/8/27 BlackMage > > Hey all, > > I've been trying to figure this problem out with just using sql but I'm not > sure how too. I have a table that holds events for each

Re: [GENERAL] Select data for current week only

2009-08-27 Thread Thomas Kellerer
BlackMage wrote on 27.08.2009 20:09: I've been trying to figure this problem out with just using sql but I'm not sure how too. I have a table that holds events for each week but I only want to select events happening for the current week(Mon-Sun). So can anyone help me out with this just using sq

Re: [SQL] [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Rob Sargent
tablelog doesn't appear any more lively than the OPs audittrail2. Alvaro Herrera wrote: Nathaniel Smith wrote: What do others use to accomplish this? Do most pg users just write triggers by hand? Or is there some nice auditing module that Google just isn't revealing to me? I think ta

[GENERAL] Select data for current week only

2009-08-27 Thread BlackMage
Hey all, I've been trying to figure this problem out with just using sql but I'm not sure how too. I have a table that holds events for each week but I only want to select events happening for the current week(Mon-Sun). So can anyone help me out with this just using sql? I've accomplished it sort

Re: [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Alvaro Herrera
Nathaniel Smith wrote: > What do others use to accomplish this? Do most pg users just write > triggers by hand? Or is there some nice auditing module that Google > just isn't revealing to me? I think tablelog (to be found in pgfoundry too) is the most commonly used audit module. -- Alvaro Herre

[GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Nathaniel Smith
Howdy, (cross-posted to the pg.sql and pg.general lists) I'm looking to set up an audit trail system--ie, logging every INSERT/UPDATE/DELETE on a given table and tracking how the data changes over time. I know I could do it by hand using triggers, but was hoping to save a little time using someth

Re: [GENERAL] Viable alternatives to SQL?

2009-08-27 Thread John R Pierce
Joshua Tolley wrote: I've never heard of the first two, as far as I can recall. T-SQL is quite common, however (http://en.wikipedia.org/wiki/Transact-SQL), but although I've never used it, I seriously doubt it will make things any more user friendly. TransactSQL, sometimes called TSQL, is MS

Re: [GENERAL] [Skytools-users] WAL Shipping + checkpoint

2009-08-27 Thread Martin Pihlak
>> There are actually no "real" data changes being made on your master >> for some reason. So every time archive_timeout is reached a log full >> of no changes is shipped to your slave and applied - and no checkpoint >> times are changed for reasons I mentioned above. >> >> > > thanks, but we have

Re: [GENERAL] Schema diff tool?

2009-08-27 Thread Sualeh Fatehi
Dave, The free and open-source SchemaCrawler for PostGresql tool will do what you need. SchemaCrawler outputs details of your schema (tables, views, procedures, and more) in a diff-able plain-text format (text, CSV, or XHTML). SchemaCrawler can also output data (including CLOBs and BLOBs) in the s

Re: [GENERAL] ETL software and training

2009-08-27 Thread Tguru
Check Talend for your training needs on an ETL tool. Go look at the training page: http://www.talend.com/services/training.php tv-8 wrote: > > I guess Talend (Open Studio) might be the right choice. But I do not have > direct experience with the training. > > see www.talend.com > >> >> Hi a

Re: [GENERAL] Viable alternatives to SQL?

2009-08-27 Thread Joshua Tolley
On Thu, Aug 27, 2009 at 06:43:51AM -0700, Kelly Jones wrote: > Are there other viable ways to query data? I read a little on > "Business System 12" (BS12), Tutorial D, and even something called > T-SQL (I think), but they all seem theoretical and not fully > implemented. > > I want a query languag

Re: [GENERAL] Viable alternatives to SQL?

2009-08-27 Thread Peter Hunsberger
On Thu, Aug 27, 2009 at 8:43 AM, Kelly Jones wrote: > Many sites let you search databases of information, but the search > queries are very limited. > > I'm creating a site that'll allow arbitrary SQL queries to my data (I > realize I'll need to handle injection attacks). > > Are there other viable

Re: [GENERAL] Viable alternatives to SQL?

2009-08-27 Thread Martin Gainty
Hibernate is a ORM technology which configures bean classes which will construct DB statements based on the method(create,replace,update,delete) from the bean class attributes(columns) to quote "Hibernate allows you to express queries in its own portable SQL extension (HQL), as well as in nativ

[GENERAL] Viable alternatives to SQL?

2009-08-27 Thread Kelly Jones
Many sites let you search databases of information, but the search queries are very limited. I'm creating a site that'll allow arbitrary SQL queries to my data (I realize I'll need to handle injection attacks). Are there other viable ways to query data? I read a little on "Business System 12" (BS

Re: [GENERAL] [Skytools-users] WAL Shipping + checkpoint

2009-08-27 Thread Sébastien Lardière
On 27/08/2009 00:18, Mark Kirkwood wrote: Sébastien Lardière wrote: On 26/08/2009 04:46, Mark Kirkwood wrote: Sébastien Lardière wrote: Hi All, I've a cluster ( Pg 8.3.7 ) with WAL Shipping, and a few hours ago, the master had to restart. I use walmgr from Skytools, which works very well.