Re: [GENERAL] Days in month query
Hi, Something like this? SELECT date_part('day', (date_part('year', '01/10/04' :: date) || '-' || date_part('month', '01/10/04' :: date) || '-01') ::date + '1 month'::interval - '1 day'::interval) AS days; Regards, Arthur On Wed, 30 Mar 2005 16:45:43 -0700, Mark Fox <[EMAIL PROTECTED]> wrote: > Greetings, > > Thanks Dan, but I searched for, and scoured, that page before asking > my question. It helped with some of the details, but not on the > general approach. I'll try to restate my problem in a better way: > > What I want is SELECT statement that references no tables but returns > the days in a given month. I'm now thinking that I might be able to > come up with something using an IN clause and using EXTRACT, but > haven't figured it out yet. > > Mark > > > On Wed, 30 Mar 2005 15:16:19 -0800, Dann Corbit <[EMAIL PROTECTED]> wrote: > > The online documentation has a search function. It would lead you to > > this: > > http://www.postgresql.org/docs/8.0/static/functions-datetime.html > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Mark Fox > > Sent: Wednesday, March 30, 2005 3:07 PM > > To: pgsql-general@postgresql.org > > Subject: [GENERAL] Days in month query > > > > Greetings, > > > > This is more of an SQL question, but since each database server seems > > to use it's own syntax for handling dates... > > > > Is there a way to query for the days in a month? For example, > > querying for the days in January of this year? Listing the days > > between two dates would be useful as well. > > > > I'm sure I saw a query like this somewhere, but I can't track it down. > > Just to be clear, there were no tables involved. Just a SELECT > > statement that returned all the days in a given month. > > > > Basically, I have a table of "events" and I'd like to generate a > > histogram of how many events occur on the days of a particular month. > > What I do now is create a temporary table, fill it with the > > appropriate days, and then do a cross join and summation to generate > > what I need. This works, but seems messy to me. > > > > Mark > > > > ---(end of broadcast)--- > > TIP 5: Have you checked our extensive FAQ? > > > >http://www.postgresql.org/docs/faq > > > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [GENERAL] Adventures in Quest for GUI RAD
Hi, The company I work for actually uses the Zeos lib/Postgres extensively to track the shipping and sales side for almost 3 years. We're still running on a 7.2/7.4 Postgres database, because I haven't been convinced yet to either update or upgrade to 8.x.x. I'm curious if others have successfully moved their (production) database successfully to Postgres 8.0. Regards, Arthur On 5/9/05, Philippe Lang <[EMAIL PROTECTED]> wrote: > Hi, > > I'm testing Delphi 2005 at the moment, with ZEOS Lib (libpq), and I have to > say it work fine, as Tony mentioned. I have a few questions: > > 1) I'm curious: are there a lot of big projects using ZEOS with PG or is that > technology still relatively new? I would like to use it a replacement for > ODBC, but I have no experience regarding its stability. > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [GENERAL] IMPORTANT NOTIFICATION
Hi, Phishing scam for sure. I thought it was hilarious in a way: "Why would the host of postgresql.org send himself a bill?". Kind of a silly paradox. Regards, Arthur On 6/8/05, Joshua D. Drake <[EMAIL PROTECTED]> wrote: > Matt Miller wrote: > >>you will have to confirm your account by the following link > > > > > > Is this bogus? > > > > Clicking on the link goes to 62.193.220.183 which is not postgresql.org > > Quite. It is a phising scam probably. > > > > > > > ---(end of broadcast)--- > > TIP 5: Have you checked our extensive FAQ? > > > >http://www.postgresql.org/docs/faq > > > -- > Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240 > PostgreSQL Replication, Consulting, Custom Programming, 24x7 support > Managed Services, Shared and Dedicated Hosting > Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/ > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [GENERAL] License question
Hi, If I'm not wrong, Postgres comes with a BSD license, which means that it (literally) doesn't matter what you do with the sources or how you link your applications to the Postgres libraries. Pervasive goes into details here: http://www.pervasivepostgres.com/postgresql/mysql.asp. Regards, Arthur On 10/4/05, Aaron Smith <[EMAIL PROTECTED]> wrote: > I did a quick search on the mailing list and didn't really find my > answer, so I am posting it to this list… > [cut] > Knowing all this, what do we need to purchase, what can we do and what > can't we do? It's hard getting a straight answer from anyone that is why > I am here. If we can't do it, we won't. If we can save our customers > some money while getting them really good options and software, we would > like to do that. But on the same token, we don't to do anything unfair > or illegal. > > > Thank you for your time. > > Aaron > > > > ---(end of broadcast)--- > TIP 9: In versions below 8.0, the planner will ignore your desire to >choose an index scan if your joining column's datatypes do not >match > ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [GENERAL] License question
Hi, >You can close source it, you can sell it, you can rename it. Add to that: As long as you leave the copyrights notices alone... Isn't that what the BSD license is particularly about? [but then, I might be wrong there] Regards, Arthur ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [GENERAL] Map of Postgresql Users (OT)
Hi, Pretty neat: I'm glad I'm not on that map! Regards, Arthur On 10/24/05, Claire McLister <[EMAIL PROTECTED]> wrote: > Hi, > > We've developed an automatic email mapping capability from Google Maps > API. > > To try it out, we mapped origins of emails to this group from October > 2, 2005 2 pm (EST) through October 14th, 9 am (EST). > > The result of this map is at: > http://www.zeesource.net/maps/map.do?group=456 > > Would like to hear what you think of it. > > Best wishes > > Claire > > -- > Claire McLister [EMAIL PROTECTED] > 1684 Nightingale Avenue Suite 201 > Sunnyvale, CA 94087 408-733-2737(fax) > > http://www.zeesource.net > > > ---(end of broadcast)--- > TIP 6: explain analyze is your friend > ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [GENERAL] Postgresql to Delphi
Hi: There are a couple of solutions to solve this problem and some of them will depend on how frequent you expect these changes to happen. I generally stay clear from server-specific notifications: In the larger projects I have seen and maintained, we used background processes to do this kind of stuff: shell scripts calling external applications on regular intervals. For smaller projects, I would just do this (in a timely fashion) internally in my 'user'/client application. As for Delphi: Tony is too much of a fan of this particular language :-) [no offense meant, since I've been working for years in Delphi too] Regards, Arthur On 3/20/07, Bob Pawley <[EMAIL PROTECTED]> wrote: I think that may be what I have been trying to do. Can you point me to some literature on how to do that? I'm just learning the basics of Delphi and the documenation I've seen so far hasn't been very specific. Bob - Original Message - From: "Tony Caduto" <[EMAIL PROTECTED]> To: "Bob Pawley" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, March 20, 2007 3:07 PM Subject: Re: [GENERAL] Postgresql to Delphi > Bob Pawley wrote: >> Listen/notify implies a dynamic table that is constantly on the change. >> Am I correct? >> >> The table I am talking about is completed through one interface then >> imported as a relatively static information base for the application in >> which I am seeking help. >> > Yes, > you would have to define a rule on the table and when the table changed it > would send a notification back to who ever is listening. > > Why don't you just run a query against the table, then loop through the > result set and then trigger your devices from inside the loop? > > myquery.sql.add('select * from mytable where bla = bla;'); > myquery.open; > While not myquery.eof do > begin > if myquery.fieldbyname('somefield').asstring = 'something' then > //signal your device. > myquery.next; > end; > > I guess that is the best I can come up without knowing more. > > Later, > > -- > Tony Caduto > AM Software Design > http://www.amsoftwaredesign.com > Home of PG Lightning Admin for Postgresql > Your best bet for Postgresql Administration > ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [GENERAL] Update a Value From TEdit
Hi: What's the point of declaring the TEdit locally? Use a string instead. Additionally, in Delphi [and any other OOP language) if you want to use objects, you instantiate them first, as in Edit1 := TEdit.Create(nil); Regards, Arthur On 4/13/07, Bob Pawley <[EMAIL PROTECTED]> wrote: I am attempting to update a table using a value that is displayed on a TEdit component. I am getting an access violation error. Can someone tell me what I am doing wrong?? procedure TLoopBuilderForm.NewLoopButtonClick(Sender: TObject); var Edit1 : TEdit ; begin PSQLQuery1.Close;{close the query} //assign new SQL expression Monitor PSQLQuery1.SQL.Clear; PSQLQuery1.SQL.Add ('Update P_ID.Loops'); PSQLQuery1.SQL.Add ('Set IDW_Loop_ID = + LoopNumberEdit'); PSQLQuery1.SQL.Add ('Where P_ID.Loops.Loop_Name = :Loop_Name'); PSQLQuery1.ParamByName('LoopNumberEdit').Value := Edit1.Text; PSQLQuery1.Execsql; end; Running Delphi 6 and PostgreSQL 8.2 on Win XP. Bob ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [GENERAL] import mysql database...
Hi, You may find something here: http://www.rot13.org/~dpavlin/sql.html. In addition, I always thought that Postgres came with a MySQL to Postgres converter, but I might be wrong. Bye, Arthur On Wed, 08 Sep 2004 11:07:46 -0400, Eric <[EMAIL PROTECTED]> wrote: > Hi, > > I have a running PHPBB mySQL dump that I would like to load/import in > postgreSQL... I didn't try yet but I wonder if it's straightforward and > just import the mySQL dump into postgreSQL ? > > (Of course, I want to migrate PHPBB running on a server with mySQL to > another server running with postgreSQL). Yes PHPBB has postgreSQL > support. > > Thanks. > > ---(end of broadcast)--- > TIP 5: Have you checked our extensive FAQ? > >http://www.postgresql.org/docs/faqs/FAQ.html > ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [GENERAL] Changed a column type from "integer" to varchar
Hi, If you're using 7.4 or below (I'm not sure if 7.5 is able to do this), you'll end up writing the data first to a temporary table, as in (for example): SELECT * INTO TEMPORARY MyTable FROM yourtable; DROP TABLE yourtable; CREATE TABLE yourtable ( /* with varchar stuff */ ) WITH OIDS; INSERT into yourtable ( your field list ) SELECT cast(anumber as varchar(20)), etc, from MyTable; Drop MyTable; Regards, Arthur On Tue, 14 Sep 2004 16:14:33 -0400, Ying Lu <[EMAIL PROTECTED]> wrote: > Hi, > > I have a question about alter a column's type in a postgreSQL table. > > For example, I have 10, 000 records in a table name "test", I'd like to > change column "machineID" type from integer to varchar. I am looking for > something like: > > alter table test alter column machineID ... ... varchar > > Thanks in advance, > > ---(end of broadcast)--- > TIP 5: Have you checked our extensive FAQ? > >http://www.postgresql.org/docs/faqs/FAQ.html > ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings