[SQL] view vs. tables used to define that view

2009-05-08 Thread Emi Lu
May I know is it possible to query dictionary table(s) in order to return relationship between a view and table(s) please? For example, create view v1 as (select ... from T1 left join T2 ... ) Result: view Name | Table Name v1| T1 v1| T2 Thanks a lot! Lu Yi

Re: [SQL] Distinct oddity

2009-05-08 Thread Tom Lane
Maximilian Tyrtania writes: > am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marl...@gmail.com: >> Yeah, that does seem odd. Could it be something like nulls in your >> data set? just guessing really. If you could make a small test case >> that shows it happening and allows others to

Re: [SQL] ascii-betical sort order?

2009-05-08 Thread Peter Koczan
On Fri, May 8, 2009 at 12:57 PM, Tom Lane wrote: > You're apparently using a non-C locale ... you need to re-initdb in > C locale. On Fri, May 8, 2009 at 12:58 PM, Kenneth Marshall wrote: > Try looking under Localization in the manual (Chapter 22). Excellent, just what I was looking for. I'll l

Re: [SQL] ascii-betical sort order?

2009-05-08 Thread Tom Lane
Peter Koczan writes: > Is there some way to do ascii-betical sort ordering in postgres (i.e. > capital letters come before lowercase)? It appears that text ordering > is dictionary-alphabetical. You're apparently using a non-C locale ... you need to re-initdb in C locale.

Re: [SQL] performance question

2009-05-08 Thread Tom Lane
"Oliveiros Cristina" writes: > Frankly, I cannot understand the reason for this, it seems the planner is > taking radically diferent plans on the two conditions (they are below). Yup, and you seem to be near the crossover point where it thinks they have equal cost. You need to be fixing the ina

[SQL] ascii-betical sort order?

2009-05-08 Thread Peter Koczan
Is there some way to do ascii-betical sort ordering in postgres (i.e. capital letters come before lowercase)? It appears that text ordering is dictionary-alphabetical. It's useful, but it's different from the DBMS I'm porting some applications from (SQL Server, in case you were curious). It may no

[SQL] performance question

2009-05-08 Thread Oliveiros Cristina
Hi, All Suppose you have a query like this SELECT * FROM t_sitesresumebydate a JOIN t_triple_association c ON "IDSiteResume" = "IDResume" WHERE "dtDate" BETWEEN '2009-2-1' AND '2009-2-3' AND "IDHitsAccount" = 378284 With this time interval it completes in less than a second. If I add one da

Re: [SQL] Distinct oddity

2009-05-08 Thread Rob Sargent
Is firmen a table or a view? From: Scott Marlowe To: Maximilian Tyrtania Cc: pgsql-sql@postgresql.org Sent: Friday, May 8, 2009 5:35:21 AM Subject: Re: [SQL] Distinct oddity On Fri, May 8, 2009 at 3:28 AM, Maximilian Tyrtania wrote: > am 07.05.2009 20:54 Uhr

Re: [SQL] RAISE NOTICE

2009-05-08 Thread Gerardo Herzig
Luigi N. Puleio wrote: > --- On Fri, 5/8/09, Gerardo Herzig wrote: > > From: Gerardo Herzig > Subject: Re: [SQL] RAISE NOTICE > To: "Luigi N. Puleio" > Cc: pgsql-sql@postgresql.org > Date: Friday, May 8, 2009, 11:34 AM > > Luigi N. Puleio wrote: >> Hello everyone... >> >> I have a PL/PgSQL fu

Re: [SQL] RAISE NOTICE

2009-05-08 Thread Luigi N. Puleio
The fact is I have in my postgresql.conf  this: client_min_messages = notice but if I call the function which has RAISE NOTICE it doesn't return a notice to the clienti...indeed I see it in the logfile on server status... that's why I was asking if there is a way...  maybe I could also have wr

Re: [SQL] RAISE NOTICE

2009-05-08 Thread Milen A. Radev
Luigi N. Puleio написа: > Sort ofthe message should come along a standalone application too when > with an ADO component I do a Post() which calls the function...just the > matter is I can't modify the application to manage a possibly > notification...only the postgresql's function... > That

Re: [SQL] RAISE NOTICE

2009-05-08 Thread Luigi N. Puleio
Sort ofthe message should come along a standalone application too when with an ADO component I do a Post() which calls the function...just the matter is I can't modify the application to manage a possibly notification...only the postgresql's function... That's why I'm asking about a possibil

Re: [SQL] Distinct oddity

2009-05-08 Thread Scott Marlowe
On Fri, May 8, 2009 at 3:28 AM, Maximilian Tyrtania wrote: > am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marl...@gmail.com: > >> On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania >> wrote: >>> Hi there, >>> >>> does this look right? >>> >>> FAKDB=# select count(distinct(f.land)) f

Re: [SQL] RAISE NOTICE

2009-05-08 Thread Gerardo Herzig
Luigi N. Puleio wrote: > Hello everyone... > > I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE > can't be shown on windows with a popup message like the EXCEPTION, indeed it > goes to log messages list.. > So, is there any way to show a popup message with a custom text

Re: [SQL] backup and restore

2009-05-08 Thread Gerardo Herzig
Jyoti Seth wrote: > Hello, > > I have two databases db1 and db2 with the same database structure on > different systems with no network connection. In the first system with the > db1 database user updates the master data. At the end of every day, the user > needs to take the backup of updated data

Re: [SQL] backup and restore

2009-05-08 Thread Craig Ringer
Craig Ringer wrote: ... something kinda rude, in retrospect. Sorry. Unpleasantness is going around in my immediate environment, and I'm apparently prickly and grumpy. -- Craig Ringer -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.p

Re: [SQL] backup and restore

2009-05-08 Thread Craig Ringer
Wow, I'm impressed. Let me quote part of the message you just replied to with a TOTALLY UNRELATED NEW THREAD: "First: Please don't reply to an existing message to create a new thread. Your mail client copies the replied-to message ID into the References: header, and well-implemented mail clients w

Re: [SQL] Distinct oddity

2009-05-08 Thread Maximilian Tyrtania
am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marl...@gmail.com: > On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania > wrote: >> Hi there, >> >> does this look right? >> >> FAKDB=# select count(distinct(f.land)) from firmen f where >> f.typlist='Redaktion'; >>  count >> --- >>

[SQL] RAISE NOTICE

2009-05-08 Thread Luigi N. Puleio
Hello everyone... I have a PL/PgSQL function where I use RAISE NOTICE but this kind of RAISE can't be shown on windows with a popup message like the EXCEPTION, indeed it goes to log messages list.. So, is there any way to show a popup message with a custom textmessage on it from a PL/PgSQL func

[SQL] backup and restore

2009-05-08 Thread Jyoti Seth
Hello, I have two databases db1 and db2 with the same database structure on different systems with no network connection. In the first system with the db1 database user updates the master data. At the end of every day, the user needs to take the backup of updated data of master tables on db1 and u