logo
IRC Archive / Freenode / #postgresql / 2010 / May / 01 / 5
grant_
im pretty new to load balancing and replication
xzilla
yeah. we do immediate send of the xlogs to the pitr slave, but our recovery program has a parameter to delay application for x minutes. this way we have the files in case of failover, but gain safety from stupid/malicious sql. ie. someone updates without where clause, we have 10 minutes to stop replication before it gets applied to slave)
non of the failover stuff is built in... ie. the streaming replication systems wont take over automatically... you have to promote one of the as a new primary, and the coordinate that change amongst all other nodes
it's kind of a pain
and needs much better documentation
gotta go, bbiab
grant_
ok
im off to bed anyway
xzilla
https://labs.omniti.com/pgtreats/trunk/omnipitr/
grant_
thanks for the info.. hopefully i can pick your brain another day =p)
xzilla
those are the scripts we use, or at least the most recent collection
we need to push more changes back into the public repo
but its a start
grant_
ahh ok
i was actually looking into standalone hot standby
thanks
ads
*HRHR* http://forums.somethingawful.com/showthread.php?threadid=2790475&userid=0&perpage=40&pagenumber=35#post375014798
They actually believe it - i made a good joke ;-)
toader
Hi, i have serveral processes to insert data into the same table simutaniously. So, as only insertion operation, they won't cause currency problem, eg.,lock. How to express it formally? Is it name "lock free" ? or any other suggestion? thanks
or exempt from lock??
hi
PChot
any pgphpadmin here? i have problem with import feature
a mean pgphpadmin developer
davidfetter
hrm?
PChot
i'm trying to import simle csv file with format 000006+2553.2,MIRA
davidfetter
what's wrong with psql?
PChot
and i'm getting error
ERROR: column "000006+2553.2" of relation "rename1" does not exist
LINE 1: INSERT INTO "public"."rename1" ("000006+2553.2", "MIRA") VAL...
selenamarie
PChot: use single quotes, not doublequotes for the values
oh wait
PChot
i have plain text file without quotes
selenamarie
i'm not familiar enough with pgphpadmin to tell you why it is doing that. :D but it is interpreting your csv values as fieldnames
insert statements are of the fomr:
INSERT INTO public.rename1 (field1, field2) VALUES('000006+2553.2', 'MIRA') ...
you're missing field1 & field2.. see?
PChot
i know, that's why i'm looking for pgphpadmin developers
here is example of my file
http://bum.pastebin.com/4s8g7bmb
nothing fancy
selenamarie
PChot: i imagine there's a section in the documentation about importing csv.. have you looked?
ads
toader: insert needs no lock
selenamarie
hi ads!
ads
hi selenamarie
davidfetter
hi selenamarie
hei ads
ads
hi david
selenamarie
hi davidfetter see you in ottawa soon.
davidfetter
indeed :)
(Action) trying to recall which continent he saw selenamarie in person on last
PChot
i cannot find any docs about csv at pgphpadmin
selenamarie
PChot: alright, i'll have a look :)
davidfetter
??ppa
pg_docbot_adz
For information about 'ppa' see:
http://phppgadmin.sourceforge.net/
selenamarie
wow the online docs are not good :)
davidfetter
not as such
PChot
who can help me? which nicks?
davidfetter
PChot, your best bet is to try with psql, which just about everybody here knows about
??psql
pg_docbot_adz
For information about 'psql' see:
selenamarie
i'm looking at the interface.. hold your horses :)
guest
LOL
Chepra
just prepend a line with the proper fieldnames?
PChot
i know psql, the problem is interface of pgphpadmin
davidfetter
is there some reason you're not using psql?
selenamarie
PChot: Chepra is correct
PChot: phpPgAdmin expects the first line of your csv file to be field names
and they must match the fieldnames of your table
PChot
ok, thx, a thought i worsk like copy comand
selenamarie
nope, it is doing INSERTs
PChot
ok, i handle with that
i'll try something else
absddaemon
Anyone know if there is a way to log login attempts to the data base, both failed and successes.
guest
please tell me, is there any packet type like "ping" to keep connection alive?
equals to mysql_ping()
davidfetter
(Action) trying to get schemaspy working, and suspects a driver path issue
Chepra
fix it ;)
davidfetter
well, it appears not to be finding the driver :(
anybody got a clue as to how i might track this down?
merlin83
davidfetter: -cp <path to jdbc driver> on the command line?
davidfetter
merlin83, tried several versions of that :(
(Action) swipes Possible's frites
Possible
hehehe
(Action) hides the beer
davidfetter
too late
Possible
darn
davidfetter
*hic*
there's just better beer where you live
Possible
that's what you get when you gulpdown those double-fermentated beers ;)
davidfetter
heh
Possible
fermented even
davidfetter
oh java expert, i'm having jva issues
Possible
not sure if I can help...but what java issues ?
davidfetter
http://pgsql.privatepaste.com/6c7b94de8c <-- lots of versions of the command line here give that error
any way to make it more verbose?
Possible
so that's the error ?
davidfetter
most of that paste is the error
Possible
gawd
davidfetter
it's not doing the thing it's supposed to do
and it's whinging about the way i invoked it, which as far as i can tell, is exactly how i'm supposed to
Possible
well it doesn't list the -h and -port switches ..
merlin83
davidfetter: you tried using -dp to force it to use the driver you specify? their svn code for the location of the pg driver is quite comical.. http://schemaspy.svn.sourceforge.net/viewvc/schemaspy/trunk/src/net/sourceforge/schemaspy/dbTypes/pgsql.properties?revision=512&view=markup
Possible
hmm..it doesn't list -db either...but the example does..
davidfetter
java -jar schemaSpy_4.1.1.jar -t pgsql -h localhost -port 5432 -db neil -u neil -o neilwtf -dp /usr/share/java/postgresql-jdbc-8.4.701.jar <-- same error
Possible
davidfetter: loose the -h localhost -port 5432 bit
it's not psql
davidfetter
um, what?
it's -t pgsql, afaik
Possible
yes
but no -h or -port
in other words...don't use psql switches ;)
Possible
awsome...
davidfetter
aha!
Possible
schemaspy doesn't list the switch..but does use it in the example..
davidfetter
java -jar schemaSpy_4.1.1.jar -t pgsql -host localhost:5432 -db neil -u neil -o neilwtf -dp /usr/share/java/postgresql-jdbc-8.4.701.jar
Possible
anyway..use -host
davidfetter
kinda works
well, runs, anyhow. doesn't actually produce output :(
Possible
nothing in neilwtf ?
davidfetter
it creates subdirectories, but they're empty
oh. have to specify the schemas :P
Possible
duh :P
merlin83
davidfetter: if anything.. apps built on java usually require extremely verbose (aka excessively long) configurations... they don't trust assumptions or general use-cases .. e.g. maven/ant/xml configs ;p
davidfetter
this is not the least of the reasons i avoid java whenever i can
Possible
merlin83: well a better documentation on the schemaSpy arguments would help too
it's incomplete
cybernd
(Action) likes java
mkad
Hi
how to download from database three values but not outputing them as | value | value | value ?
Possible
download ?
mkad
I want to use that in script, maybe its possible to output query in other format
I mean I use psql to query some data
Possible
what format do you want ?
mkad
the IP/download/upload for QoS script
value value value
with spaces
or something easier to parse
Possible
select col1||' '||col2||' '||col3 FROM table
davidfetter
you could try setting the record separator in psql
Possible
I was just looking for that option
\f
mkad
hm..
Possible
inside psql
mkad
before select?
Possible
yes
\f string
\o output file
select
\o
\f
mkad
hmm
Possible
see \? for all the options
mkad
ah.. I am using psql from script
which is going to output result
Possible
same difference
feed the sql in a file
mkad
hmm does not work
Possible
what are you doing ?
mkad
Field separator is "|".
\f: extra argument "select" ignored
davidfetter
psql -F '|' ...
mkad
ah..
Possible
you can put the commands in a sql file and feed it to psql..
including the slashcommands
davidfetter
there are all kinds of abstruse, but at least well documented, command line switches for psql
mkad
davidfetter, does not filter out that |
Possible
mkad: you just set it...not removed it
-F ' '
mkad
yes -F ' ' also does not work
Possible
mkad: psql --help for all options
davidfetter
or man psql
mkad
hmm
it works but only with -A
thanks:)
also is it possible to check somehow within psql if string is a local IP address ?
I am quering some IP addresses and I would like to filter out none internet adresses
davidfetter
try the WHERE clause :)
mkad
I already use where
davidfetter
you can put multiple conditions in it :)
Possible
what are non-internet addresses ?
you mean non-public IP's
mkad
yes
davidfetter
(Action) routes 127.0.0.1
mkad
I would like a SQL function that checks it is non local network IP
Possible
the IP's are stored in a inet datatype column ?
mkad
yes non-public
I think its string columnm
not sure though
Possible
ouch
davidfetter
turn the column into a more appropriate data type :)
??ip
pg_docbot_adz
For information about 'ip' see:
davidfetter
??ip4r