Geoffrey lists at serioustechnology.com
Thu Dec 13 08:29:28 PST 2007
Josh Harrison wrote:
> On Dec 13, 2007 9:58 AM, Geoffrey <lists at serioustechnology.com> wrote:
> 
>> Josh Harrison wrote:
>>>>> On Wed, Dec 12, 2007 at 02:22:58PM -0500, Geoffrey wrote:
>>>>>> I was afraid that would be the answer, thanks.
>>>>> This is an easy script to write, though.  You can get every table name
>>>> out
>>>>> of postgres quite easily.
>>> How do you write this script? I have a database with 100 tables and i
>> have
>>> to replicate them all. And if tey dont have a PK then you have to
>> generate a
>>> slony serial key...right!!!!
>>> josh
>>
>> All of my tables have PK, so that's not a problem for me.  All I had to
>> do was produce a common separated list of the tables and then import
>> that into the slon_tools.conf file:
>>
>> echo '\d' |psql -t -p 5443 swr|
>>        awk -F'|' '/ table /{gsub(" ", "", $2);printf "%s,\n", $2}'
> 
> 
> 
> Thanks...I tried this
> echo '\d' |psql -t -p 5432 bench_replication|awk -F'|' '/ table /{gsub(" ",
> "", $2);printf "%s,\n", $2}'
> 
> and I get this error
> awk: syntax error near line 1
> awk: illegal statement near line 1
> 
> Can you help

Hmm, works fine for me, what does this produce:

echo '\d' |psql -t -p 5432 bench_replication

-- 
Until later, Geoffrey

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
  - Benjamin Franklin


More information about the Slony1-general mailing list