[SQL] reply to setting

2004-08-06 Thread Kenneth Gonsalves
hi, any reason why the default reply-to on this list should not be set to the list? I keep replying to postings only to find later that the reply goes to the OP and not to the list. reply-all button results in needless duplication -- regards kg http://www.onlineindianhotels.net - fastest hotel

Re: [SQL] surrogate key or not?

2004-08-06 Thread Kenneth Gonsalves
On Saturday 07 August 2004 04:12 am, Josh Berkus wrote: > > > Meanwhile, every other aspect of the data can change (e.g. a person can > > change his name, sex, age, email, address, even date & place of birth). > > Not to mention data entry mistakes. So it's impossible to use any > > "real"/natural

Re: [SQL] Grouping by week

2004-08-06 Thread Tom Lane
Oliver Elphick <[EMAIL PROTECTED]> writes: > How about: >SELECT EXTRACT(WEEK FROM trans_date + '1 day'::INTERVAL) Note that if trans_date is actually a date, you are much better off just adding an integer to it: SELECT EXTRACT(WEEK FROM trans_date + 1) If you add an interval then the date

Re: [SQL] surrogate key or not?

2004-08-06 Thread Josh Berkus
David, > But, once a surrogate key is assigned to a row, doesn't it become a > "real" data? For example, I have a bunch of invoices/receipts and I > write down a unique number on each of them. Doesn't the unique number > become part of the information contained by the invoice/receipt itself > (at

Re: [SQL] Grouping by week

2004-08-06 Thread Oliver Elphick
On Fri, 2004-08-06 at 22:29, Caleb Simonyi-Gindele wrote: > I'm using > > SELECT EXTRACT(WEEK FROM trans_date), SUM(tran_amount) ... GROUP BY > trans_date > > and it is being used to group sales results by week. It works really well. > > What I'm wondering is if I can shift the week from a Mo

[SQL] Grouping by week

2004-08-06 Thread Caleb Simonyi-Gindele
I'm using SELECT EXTRACT(WEEK FROM trans_date), SUM(tran_amount) ... GROUP BY trans_date and it is being used to group sales results by week. It works really well. What I'm wondering is if I can shift the week from a Mon-Sun articulation(default with Postgre) to a Sun-Sat sequence. I need it

[SQL] New PHP + PostgreSQL group on Google Groups2

2004-08-06 Thread N. David
Hello. I have created a new group in the Google Groups beta site for PHP + PostgreSQL development. This group is for questions on advanced web development with PHP and PostgreSQL using Linux. Topics include functions, regular expressions, classes (OOP), speed, security, editor customization, SQL,

[SQL] Make a column case insensitive

2004-08-06 Thread Gordon Ross
Is it possible to make a column case insensitive, without having to pepper your SELECTs with lots of lower() function calls (and forgetting to do it at times !) (I'm on 7.4.3) Thanks, GTG Gordon Ross, Network Manager/Rheolwr Rhydwaith Countryside Council for Wales/Cyngor Cefn Gwlad Cymru ---

Re: [SQL] SQL syntax extentions - to put postgres ahead in the race

2004-08-06 Thread Tom Lane
I wrote: > There's nothing particularly stopping us from supporting > multiple-argument aggregates, except a lack of round tuits. BTW, you can actually fake this pretty well in 8.0, by making an aggregate that uses a rowtype input. For example: regression=# create type twostrings as (s1 text, s2

Re: [SQL] retrieve the tables names based on the owner

2004-08-06 Thread Achilleus Mantzios
O kyrios Antonis Antoniou egrapse stis Aug 6, 2004 : > Hi guys, Kalhmera Antoni! > > How can I retrieve (with a query) from a database, only the table names > based on the owner name? > SELECT schemaname||'.'||tablename from pg_tables where tableowner='postgres'; > > Many Thanks > Antoni

[SQL] retrieve the tables names based on the owner

2004-08-06 Thread Antonis Antoniou
Hi guys, How can I retrieve (with a query) from a database, only the table names based on the owner name? Many Thanks Antonis ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] SQL syntax extentions - to put postgres ahead in the race

2004-08-06 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Thu, 5 Aug 2004, Ram Nathaniel wrote: >> 2) aggregated concatenation: > Theoretically, you should be able to do this right now in PostgreSQL with > user defined aggregates (although you can't pass a second argument > currently for the separator). The