[SQL] xml2 support

2011-03-23 Thread Rob Sargent
I'm confused by the deprecation notice on xml2 seen here 
.


What if anything was removed in the making of 8.4? Was the newer 
standard API implemented? Do I still need namespaces?


I'm running PostgreSQL 9.0.3 built locally with --with-libxml.  Which 
version, w.r.t. to the deprecation, might I be using.


rjs



Re: [SQL] xml2 support

2011-03-23 Thread Serdar Gül
if you want to export the data in xml type
i suggest you to use the EMS SQL Manager for PostgreSQL
because
you can export the whole table or an executed query in many different file
types including xml

2011/3/23 Rob Sargent 

>  I'm confused by the deprecation notice on xml2 seen 
> here
> .
>
> What if anything was removed in the making of 8.4? Was the newer standard
> API implemented? Do I still need namespaces?
>
> I'm running PostgreSQL 9.0.3 built locally with --with-libxml.  Which
> version, w.r.t. to the deprecation, might I be using.
>
> rjs
>
>


Re: [SQL] xml2 support

2011-03-23 Thread Rob Sargent



On 03/23/2011 11:10 AM, Serdar Gül wrote:

if you want to export the data in xml type
i suggest you to use the EMS SQL Manager for PostgreSQL
because
you can export the whole table or an executed query in many different
file types including xml

2011/3/23 Rob Sargent mailto:robjsarg...@gmail.com>>

I'm confused by the deprecation notice on xml2 seen here
.

What if anything was removed in the making of 8.4? Was the newer
standard API implemented? Do I still need namespaces?

I'm running PostgreSQL 9.0.3 built locally with --with-libxml.
Which version, w.r.t. to the deprecation, might I be using.

rjs



I'm just trying to get up to speed on using the xml facilities within psql.

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] xml2 support

2011-03-23 Thread Serdar Gül
sorry
i misunderstood you
i am new in postgresql
so i advice the first thing i thought
so sorry

2011/3/23 Rob Sargent 

>
>
> On 03/23/2011 11:10 AM, Serdar Gül wrote:
>
>> if you want to export the data in xml type
>> i suggest you to use the EMS SQL Manager for PostgreSQL
>> because
>> you can export the whole table or an executed query in many different
>> file types including xml
>>
>> 2011/3/23 Rob Sargent > robjsarg...@gmail.com>>
>>
>>
>>I'm confused by the deprecation notice on xml2 seen here
>>.
>>
>>
>>What if anything was removed in the making of 8.4? Was the newer
>>standard API implemented? Do I still need namespaces?
>>
>>I'm running PostgreSQL 9.0.3 built locally with --with-libxml.
>>Which version, w.r.t. to the deprecation, might I be using.
>>
>>rjs
>>
>>
>>  I'm just trying to get up to speed on using the xml facilities within
> psql.
>


[SQL] Obscure behavior of ORDER BY

2011-03-23 Thread Tambet Matiisen

Hi everyone!

I recently noticed obscure behavior of ORDER BY. Consider this example:

select email from
(
select '@'::text as email
union all
select '.'::text as email
) a
order by email;

The result is:
 email
---
 .
 @
(2 rows)

This is all normal - I expect, that dot is smaller than ampersand. But 
if I add anything after dot, the order is reversed:


select email from
(
select '@'::text as email
union all
select '.m'::text as email
) a
order by email

The result is:
 email
---
 @
 .m
(2 rows)

Why is this happening? As dot is smaller than ampersand, anything after 
dot shouldn't matter.


I'm using PostgreSQL 8.4.7 on 32-bit Debian.

Thanks in advance,
  Tambet

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] xml2 support

2011-03-23 Thread Rob Sargent
I'm confused by the deprecation notice on xml2 seen here 
.


What if anything was removed in the making of 8.4? Was the newer 
standard API implemented? Do I still need namespaces?


I'm running PostgreSQL 9.0.3 built locally with --with-libxml.  Which 
version, w.r.t. to the deprecation, might I be using.


Re: [SQL] Obscure behavior of ORDER BY

2011-03-23 Thread Pavel Stehule
Hello

this behave depends on your language rules. So this behave can be ok.

pavel=# select * from (values('.'),('@'),('.xxx'),(' ')) x order by 1;
 column1
─
 .
 @
 .xxx
  
(4 rows)

you can se  so string with space on start is on end and this is
correct, because spaces and white chars are ignored.

Regards

Pavel Stehule.

2011/3/21 Tambet Matiisen :
> Hi everyone!
>
> I recently noticed obscure behavior of ORDER BY. Consider this example:
>
> select email from
> (
> select '@'::text as email
> union all
> select '.'::text as email
> ) a
> order by email;
>
> The result is:
>  email
> ---
>  .
>  @
> (2 rows)
>
> This is all normal - I expect, that dot is smaller than ampersand. But if I
> add anything after dot, the order is reversed:
>
> select email from
> (
> select '@'::text as email
> union all
> select '.m'::text as email
> ) a
> order by email
>
> The result is:
>  email
> ---
>  @
>  .m
> (2 rows)
>
> Why is this happening? As dot is smaller than ampersand, anything after dot
> shouldn't matter.
>
> I'm using PostgreSQL 8.4.7 on 32-bit Debian.
>
> Thanks in advance,
>  Tambet
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] pg_attributte, data types

2011-03-23 Thread Viktor Bojović
while listing data types i have noticed that some types have underscore
prefix but i don't know why is that. so im asking if somene can tell me.
These are type examples:

_char
_float4
_int2
_oid
_regtype
_text
_varchar


select distinct typname
from
(
SELECT attname AS name,
attnum ,
typname,
atttypmod - 4 as length,
attnotnull AS notnull,
atthasdef AS def,
c.oid AS tbloid,
d.adsrc AS defval,
ds.description,
attndims AS dimnum,
attstattarget,
attislocal,
attinhcount

FROM pg_attribute a
INNER JOIN pg_class c ON a.attrelid = c.oid
INNER JOIN pg_type t ON a.atttypid = t.oid
LEFT OUTER JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = a.attnum
LEFT OUTER JOIN pg_description ds ON ds.objoid = c.oid AND ds.objsubid =
a.attnum
INNER JOIN pg_namespace n ON t.typnamespace = n.oid
WHERE attnum > 0 AND
attisdropped <> 't'
ORDER BY a.attnum
) as foo


-- 
---
Viktor Bojović
---
Wherever I go, Murphy goes with me


Re: [SQL] pg_attributte, data types

2011-03-23 Thread Tom Lane
=?UTF-8?Q?Viktor_Bojovi=C4=87?=  writes:
> while listing data types i have noticed that some types have underscore
> prefix but i don't know why is that. so im asking if somene can tell me.
> These are type examples:

> _char
> _float4
> _int2
> _oid
> _regtype
> _text
> _varchar

Those are array types.  The normal convention is that foo[] is named
"_foo" under the surface.

regards, tom lane

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] xml2 support

2011-03-23 Thread Isaac T. Dover
I believe that 8.3 introduced the SQL/XML standard. "With-libxml" is the 
contribution that enables this, so it's most likely what you're using. Some 
commercial vendors have also adopted this standard.

http://en.wikipedia.org/wiki/SQL/XML

Thanks,
Isaac

Rob Sargent  wrote:

>I'm confused by the deprecation notice on xml2 seen here 
>.
>
>What if anything was removed in the making of 8.4? Was the newer 
>standard API implemented? Do I still need namespaces?
>
>I'm running PostgreSQL 9.0.3 built locally with --with-libxml.  Which 
>version, w.r.t. to the deprecation, might I be using.

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql