[SQL] join table problem

2010-08-04 Thread Jedrin
I have a specific problem with a join table and I've simplified it to these 3 tables so as not to have to post anything that hints towards the business nature of our database just in case .. At any rate, say I have 3 tables: table plant id:integer name string table seed_supplier id:

[SQL] Help Need some hindsight

2010-08-04 Thread Andreas
Hi, I need to display log events (again). The log is simply like this log ( log_id serial primary key, create_ts timestamp default localtimestamp, object_id, state_id, ... ) It records the state of objects and when and what happend to to change this state. I'd like to get a list that

[SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread John Hasler
How does PostgreSQL react to time being stepped at bootup? My Chrony NTP package might cause it to do so on rare occasions when the hardware clock is way off. This would only happen during bootup. -- John Hasler jhas...@newsguy.com Elmwood, WI USA -- Sent via pgsql-sql mailing list

[SQL] workaround for missing ROWNUM feature with the help of GUC variables

2010-08-04 Thread Marc Mamin
Hello, here my two pence on this recurring thema. (just a workaround) regards, Marc Mamin The PG parameter must be set to allow defining own configuration variables: #--- --- #

Re: [SQL] join table problem

2010-08-04 Thread Oliveiros d'Azevedo Cristina
Howdy! At any rate, say I have 3 tables: table plant id:integer name string table seed_supplier id: integer company_name: string table plant_seed_supplier plant_id seed_supplier_id plant_seed_supplier is a join table that supports a many to many relationship between the plant table

Re: [SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread Frank Bax
John Hasler wrote: How does PostgreSQL react to time being stepped at bootup? My Chrony NTP package might cause it to do so on rare occasions when the hardware clock is way off. This would only happen during bootup. My ntp client changes clock (by small amount) at any time: Jul 25 05:29:38

Re: [SQL] Help Need some hindsight

2010-08-04 Thread A. Kretschmer
In response to Andreas : Hi, I need to display log events (again). The log is simply like this log ( log_id serial primary key, create_ts timestamp default localtimestamp, object_id, state_id, ... ) It records the state of objects and when and what happend to to change this state.

Re: [SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread Kenneth Marshall
On Wed, Aug 04, 2010 at 07:20:31AM -0400, Frank Bax wrote: John Hasler wrote: How does PostgreSQL react to time being stepped at bootup? My Chrony NTP package might cause it to do so on rare occasions when the hardware clock is way off. This would only happen during bootup. My ntp client

[SQL] Some quick questions

2010-08-04 Thread Joshua Gooding
I am using Postgres 8.4 with 10 partition tables. We'll call them reports_00 through reports_09. I have a field that is a BIGINT which is a 13 digit number that is the epoch time, which is the constraint that the table is partitioned on. (Between time x and y). All of the partitions hold

Re: [SQL] Some quick questions

2010-08-04 Thread Kenneth Marshall
On Wed, Aug 04, 2010 at 10:22:12AM -0400, Joshua Gooding wrote: I am using Postgres 8.4 with 10 partition tables. We'll call them reports_00 through reports_09. I have a field that is a BIGINT which is a 13 digit number that is the epoch time, which is the constraint that the table is

[SQL] Domains, casts, and MS Access

2010-08-04 Thread Peter Koczan
Hi all, I'm working on porting an old MS Access form application from Sybase to postgres/ODBC as part of a larger database port project. One of the snags that's popped up is that there's some incompatibility between data types. Specifically, many fields are the Sybase type bit, which is

Re: [SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread John Hasler
I wrote: How does PostgreSQL react to time being stepped at bootup? My Chrony NTP package might cause it to do so on rare occasions when the hardware clock is way off. This would only happen during bootup. Ken writes: PostgreSQL does not use system time to track transactions so you should

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Richard Broersma
On Wed, Aug 4, 2010 at 10:31 AM, Peter Koczan pjkoc...@gmail.com wrote: One of the snags that's popped up is that there's some incompatibility between data types. Specifically, many fields are the Sybase type bit, which is basically a boolean, but it accepts and displays bareword 1 and 0

Re: [SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread Steve Wampler
John Hasler wrote: Frank writes: My ntp client changes clock (by small amount) at any time: Jul 25 05:29:38 bax ntpd[10269]: adjusting local clock by 0.098724s Jul 25 05:31:43 bax ntpd[10269]: adjusting local clock by 0.038991s Jul 25 06:13:38 bax ntpd[10269]: adjusting local clock by

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Peter Koczan
On Wed, Aug 4, 2010 at 12:47 PM, Richard Broersma richard.broer...@gmail.com wrote: On Wed, Aug 4, 2010 at 10:31 AM, Peter Koczan pjkoc...@gmail.com wrote: One of the snags that's popped up is that there's some incompatibility between data types. Specifically, many fields are the Sybase type

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Richard Broersma
On Wed, Aug 4, 2010 at 11:51 AM, Peter Koczan pjkoc...@gmail.com wrote: This is one of my first forays into ODBC, so I didn't know that was a possibility. Is there any place where these are documented? Searching for ODBC options yields info on connection options, but none on behavior that I

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Justin Graf
On 8/4/2010 1:56 PM, Richard Broersma wrote: On Wed, Aug 4, 2010 at 11:51 AM, Peter Koczanpjkoc...@gmail.com wrote: This is one of my first forays into ODBC, so I didn't know that was a possibility. Is there any place where these are documented? Searching for ODBC options yields info on

Re: [SQL] workaround for missing ROWNUM feature with the help of GUC variables

2010-08-04 Thread Andreas Joseph Krogh
On 08/04/2010 12:35 PM, Marc Mamin wrote: Hello, here my two pence on this recurring thema. (just a workaround) I don't understand what you mean by missing ROWNUM feature, PG got this with windows-functions in 8.4: http://www.postgresql.org/docs/8.4/interactive/functions-window.html

[SQL] Delete rules

2010-08-04 Thread Little, Douglas
Hi, We'd like to give our applications truncate capability, but that would also give them drop table permission, which we don't want them to have. So, we created a truncate function that uses the definers security context. The issue is that we now have 1000's of programs to change to use the

Re: [SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread Frank Bax
John Hasler wrote: Frank writes: My ntp client changes clock (by small amount) at any time: Jul 25 05:29:38 bax ntpd[10269]: adjusting local clock by 0.098724s Jul 25 05:31:43 bax ntpd[10269]: adjusting local clock by 0.038991s Jul 25 06:13:38 bax ntpd[10269]: adjusting local clock by

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Richard Broersma
On Wed, Aug 4, 2010 at 1:24 PM, Justin Graf jus...@magwerks.com wrote: My memory is fuzzy but there are some additional settings in Access that allows data type mapping... My experience is that PostgreSQL Integer types work the best for MS-Access bit datatype considering the fact that in

Re: [SQL] Delete rules

2010-08-04 Thread Richard Broersma
On Wed, Aug 4, 2010 at 1:25 PM, Little, Douglas douglas.lit...@orbitz.comwrote: But I don’t know how to access the entire sql statement for interrogation. Is there a way I can see what the statement is that’s executing and triggering the rule? I've found complex and simple rules pretty

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Peter Koczan
On Wed, Aug 4, 2010 at 4:40 PM, Richard Broersma richard.broer...@gmail.com wrote: On Wed, Aug 4, 2010 at 1:24 PM, Justin Graf jus...@magwerks.com wrote: My memory is fuzzy but there are some additional settings in Access that allows data type mapping... My experience is that PostgreSQL

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Richard Broersma
On Wed, Aug 4, 2010 at 3:41 PM, Peter Koczan pjkoc...@gmail.com wrote: Yep, that's the stumbling block we're running into. ODBC and these fields' assumptions of true/false are at odds. I'm trying a few other things with casts in the meantime to see if they'll work. Well there is a solution