[SQL] CREATE VIEW form stored in database?

2006-01-31 Thread Mario Splivalo
When I create a view, I like to define it like this (just representing
the form here):

CREATE VIEW vw_my_view
AS
SELECT
t1.col1,
t2.col2
FROM
t1
JOIN t2
ON t1.col1 = t2.col3
WHERE
t2.col4 = 'bla'


But, when I extracit it from postgres, it's somehow stored like this:

CREATE VIEW vw_my_view
AS
SELECT  t1.col1, t2.col2
FROMt1
JOINt2 ON t1.col1 = t2.col3
WHERE   t2.col4 = 'bla'

The later is much more hard to read, and when I need to change the view,
i get rash and stuff :)

Is there a way to tell postgres NOT to format the 'source code' of my
views?

Mike
-- 
Mario Splivalo
Mob-Art
[EMAIL PROTECTED]

"I can do it quick, I can do it cheap, I can do it well. Pick any two."



---(end of broadcast)---
TIP 1: 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: [SQL] CREATE VIEW form stored in database?

2006-01-31 Thread Richard Huxton

Mario Splivalo wrote:

When I create a view, I like to define it like this (just representing
the form here):

[snip]

But, when I extracit it from postgres, it's somehow stored like this:

[snip]

The later is much more hard to read, and when I need to change the view,
i get rash and stuff :)

Is there a way to tell postgres NOT to format the 'source code' of my
views?


I don't think it stores the "source code", but rather the structure of 
the underlying query. So I'm afraid you lose the spacing.


I keep all my definitions in a set of files and read in updates with \i 
my_filename.sql from psql. That lets me keep all my spaces and comments.


--
  Richard Huxton
  Archonet Ltd

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [SQL] CREATE VIEW form stored in database?

2006-01-31 Thread Mario Splivalo
On Tue, 2006-01-31 at 12:30 +, Richard Huxton wrote:
> Mario Splivalo wrote:
> > When I create a view, I like to define it like this (just representing
> > the form here):
> [snip]
> > But, when I extracit it from postgres, it's somehow stored like this:
> [snip]
> > The later is much more hard to read, and when I need to change the view,
> > i get rash and stuff :)
> > 
> > Is there a way to tell postgres NOT to format the 'source code' of my
> > views?
> 
> I don't think it stores the "source code", but rather the structure of 
> the underlying query. So I'm afraid you lose the spacing.
> 
> I keep all my definitions in a set of files and read in updates with \i 
> my_filename.sql from psql. That lets me keep all my spaces and comments.
> 

Yes, I'm tied to the pgadmin3 for the moment, so there's nothing I could
do. It's a pain to develop a database such way. 

Mike
-- 
Mario Splivalo
Mob-Art
[EMAIL PROTECTED]

"I can do it quick, I can do it cheap, I can do it well. Pick any two."



---(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: [SQL] CREATE VIEW form stored in database?

2006-01-31 Thread George Weaver


- Original Message - 
From: "Mario Splivalo" <[EMAIL PROTECTED]>


Yes, I'm tied to the pgadmin3 for the moment, so there's nothing I could
do. It's a pain to develop a database such way.


Mario,

If you keep your definition in a script file, you can copy the script and 
paste it into pgAdmin's Execute Arbitrary SQL Queries window, and then 
execute the script from there.


Regards,
George




---(end of broadcast)---
TIP 6: explain analyze is your friend


[SQL] how is searchable email archive on

2006-01-31 Thread Jacob Costello
Can anyone tell me how the searchable email archive on the postgres site
is implemented.  Is postgres used as part of the back end ?

Has anyone tried using a postgres based solution for archiving email for
regulatory purposes ?

Jake Costello




---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [SQL] how is searchable email archive on

2006-01-31 Thread Alvaro Herrera
Jacob Costello wrote:

> Has anyone tried using a postgres based solution for archiving email for
> regulatory purposes ?

I don't know about regulatory purposes, but the Oryx software is
designed for that: http://www.oryx.com (or .net, don't remember)

-- 
Alvaro Herrerahttp://www.PlanetPostgreSQL.org
"Industry suffers from the managerial dogma that for the sake of stability
and continuity, the company should be independent of the competence of
individual employees."  (E. Dijkstra)

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [SQL] how is searchable email archive on

2006-01-31 Thread Achilleus Mantzios
O Alvaro Herrera έγραψε στις Jan 31, 2006 :

> Jacob Costello wrote:
> 
> > Has anyone tried using a postgres based solution for archiving email for
> > regulatory purposes ?
> 
> I don't know about regulatory purposes, but the Oryx software is
> designed for that: http://www.oryx.com (or .net, don't remember)

Yukatan data model + utility is also a very good and comprehensive
way to model RFC 2822 mail messages.

> 
> 

-- 
-Achilleus


---(end of broadcast)---
TIP 6: explain analyze is your friend