[SQL] How to right justify text in psql?

2013-05-17 Thread Brian Sherwood
I am running postgresql 9.2. I am assuming it would be a function of psql to right justify text, but I can't find any way to do this. Is there a way to right justify just one text column? Thanks Brian

Re: [SQL] help with xpath namespace

2011-09-26 Thread Brian Sherwood
Yep, that did it. Thanks! 2011/9/23 Filip Rembiałkowski plk.zu...@gmail.com: 2011/9/22 Brian Sherwood bds...@gmail.com select (xpath('/chassis-inventory/chassis/serial-number/text()',        data_xml,        ARRAY[ARRAY['junos', 'http://xml.juniper.net/junos/9.6R4/junos-chassis

[SQL] help with xpath namespace

2011-09-23 Thread Brian Sherwood
I am trying to use xpath to extract some information from a XML document. (if it matters, It's the router config for a Juniper router) I believe I am having problems with the namespace. I am trying to extract the serial-number, but I am not getting anything. Here is the script I have been

Re: [SQL] select xpath ...

2011-09-21 Thread Brian Sherwood
Boris, Can you send me your final solution? I am trying to do something similar and I think I am stuck at the namespace. Thanks On Mon, Sep 19, 2011 at 11:49 AM, boris boris@localhost.localdomain wrote: On 09/19/2011 10:49 AM, Rob Sargent wrote: Having a name space in the doc requires it's

[SQL] Sorting router interfaces

2010-11-01 Thread Brian Sherwood
I am trying to sort router interface names. The problem is that I am doing a text sort and need to do a numerical sort. I want the interfaces to be in numerical order:  GigabitEthernet1/0/1    | 1/0/1 | {1,0,1}  GigabitEthernet1/0/2    | 1/0/2 | {1,0,2}  GigabitEthernet1/0/3    | 1/0/3   

Re: [SQL] running scripts like oracle sqlplus

2010-06-21 Thread Brian Sherwood
Have you tried nextval currval? http://www.postgresql.org/docs/8.4/interactive/functions-sequence.html Something like this: begin insert into user ( user_id, customer_id, create_user, update_user ) values ( nextval(user_seq), nextval(customer_seq), currval(user_seq),

[SQL] loading a file into a field

2009-12-31 Thread Brian Sherwood
I am looking to play around with the postgres XML functions, but can't seem to find a way to load my data. I have a number of XML files: file1.xml, file2.xml, etc All files follow the same xml format (DTD?) I would like to create the following table: CREATE TABLE configs (