Re: [HACKERS] pg_views definition format

2009-05-14 Thread Kevin Field
On May 13, 5:37 pm, gsm...@gregsmith.com (Greg Smith) wrote: > On Wed, 13 May 2009, Kevin Field wrote: > > Or would the only way to do this be to actually create a view and then > > call pg_get_viewdef() and then delete the view? > > Just make it a temporary view and then it drops when the session

Re: [HACKERS] pg_views definition format

2009-05-13 Thread Greg Smith
On Wed, 13 May 2009, Kevin Field wrote: Or would the only way to do this be to actually create a view and then call pg_get_viewdef() and then delete the view? Just make it a temporary view and then it drops when the session ends. Here's a working shell example that transforms a view into the

Re: [HACKERS] pg_views definition format

2009-05-13 Thread Kevin Field
On May 13, 12:52 pm, t...@sss.pgh.pa.us (Tom Lane) wrote: > Kev writes: > > ... I was surprised > > to find that some of my views of the form: > > select.from b left join a on a.id=b.id > > ...were being translated to this: > > SELECT..FROM (B LEFT JOIN a ON ((a.id = b.id))) > > ..

Re: [HACKERS] pg_views definition format

2009-05-13 Thread Kevin Field
On May 13, 12:41 pm, kevin.gritt...@wicourts.gov ("Kevin Grittner") wrote: > Kevin Field wrote: > > One other thing I'm just curious about, "!=" gets replaced with > > "<>"...how come? (Feels more VB-ish than C-ish, so I was surprised > > that that would be the official/preferred reconstruct)

Re: [HACKERS] pg_views definition format

2009-05-13 Thread Tom Lane
Kev writes: > ... I was surprised > to find that some of my views of the form: > select.from b left join a on a.id=b.id > ...were being translated to this: > SELECT..FROM (B LEFT JOIN a ON ((a.id = b.id))) > ...before being stored in the table pg_views is derived from. My > su

Re: [HACKERS] pg_views definition format

2009-05-13 Thread Andrew Dunstan
Kevin Field wrote: One other thing I'm just curious about, "!=" gets replaced with "<>"...how come? (Feels more VB-ish than C-ish, so I was surprised that that would be the official/preferred reconstruct) <> is the official SQL standard notation for "not equals", AFAIK. != is not.

Re: [HACKERS] pg_views definition format

2009-05-13 Thread Kevin Grittner
Kevin Field wrote: > One other thing I'm just curious about, "!=" gets replaced with > "<>"...how come? (Feels more VB-ish than C-ish, so I was surprised > that that would be the official/preferred reconstruct) "<>" is the SQL standard operator. "!=" is a PostgreSQL extension, for the co

Re: [HACKERS] pg_views definition format

2009-05-13 Thread Kevin Field
On May 13, 11:31 am, Kev wrote: > Hi, > > I have a script that automatically generates the SQL to create some > views. I'd like it to check whether its generated SQL matches the SQL > returned by "select definition from pg_views where...". I've guessed > most of the rules just by looking at the

[HACKERS] pg_views definition format

2009-05-13 Thread Kev
Hi, I have a script that automatically generates the SQL to create some views. I'd like it to check whether its generated SQL matches the SQL returned by "select definition from pg_views where...". I've guessed most of the rules just by looking at the output, but I was surprised to find that som