Re: [GENERAL] postgresql-9.5.3 compilation on Solaris SPARC

2016-05-22 Thread Venkata Balaji N
On Sun, May 22, 2016 at 1:59 AM, Tom Lane  wrote:

> Venkata Balaji N  writes:
> > On Sat, May 21, 2016 at 1:04 AM, Tom Lane  wrote:
> >> http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
> >> http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
> >>
> >> I see that the first of those mentions it's for SunOS 5.11 whereas your
> >> machine says it's 5.10 ... is it possible the functions were new in
> 5.11?
>
> > I am not 100% sure. By the error, what i understand is that for some
> reason
> > PostgreSQL version 9.5.x is expecting the SunOS version to be more recent
> > than 5.10.
>
> Well, it's not --- we have a buildfarm animal that's running 5.10, and
> it seems perfectly happy:
>
> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=castoroides&dt=2016-05-21%2014%3A00%3A47
>
> At this point I suspect that Asif Naeem was correct upthread in
> questioning your compile options --- particularly the -L switches.
> castoroides seems to just be using this:
>
> 'config_env' => {
>   'CFLAGS' => '-m64 -xarch=native -xdepend -xO4
> -xprefetch=auto,explicit',
>   'CC' => 'cc',
>   'LDFLAGS' => ''
> },
>

Thanks. Then, as i suspected, the problem must be around using appropriate
CFLAGS, which i am not sure at what to use. One thing i can say at this
point is that, if i just add "-m64" option in CFLAGS, i get an error
illegal option.
I will re-test the compilation and get back with the inputs.

Regards,
Venkata B N


[GENERAL] Fatal error "stack empty" on ROLLBACK

2016-05-22 Thread dandl
SPI call to execute "ROLLBACK" triggers FATAL ERROR "stack empty". What does
it mean? Nothing in the docs I can see.

In the particular case there were no update commands issued between BEGIN
and ROLLBACK. Is that what it means? Or am I missing something?

Regards
David M Bennett FACS

Andl - A New Database Language - andl.org




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


Re: [GENERAL] 9.5 CentOS 7 setting PGDATA for systemctl

2016-05-22 Thread Adrian Klaver

On 05/21/2016 10:27 PM, Tory M Blue wrote:

Evening, morning, or afternoon,

So I'm trying to go back to a stock rpm package (vs my full custom,
builds).  This is a learning curve, not only because it's all "whacked
pathing (in my eyes:)) but rhel7 is a #$%$# with all the things they
changed.


So where did you get the 'stock' RPM's from, CentOS or the Postgres repos?




Sooo

I've got servers built and I've got the correct data path initialized
and postgres can start the db "   /usr/pgsql-9.5/bin/pg_ctl -D
/pgsql/9.5/data -l logfile start"

But obviously systemctl start postgresql-9.5.server loses it's head
because it has no idea where my Data directory is and setting , PGDATA
 as a variable, doesn't seem to work.

So how do I kick CentOS 7 in the teeth and make it change it's
attitude regarding where I have put things?  /var/lib/pgsql (really?)
I don't want to do symlinks.

I've got it installed and running, but postgres can't be the only
place to start/stop the server. I need systemctl to handle these tasks
as well.

The init program is all kinds of weirdness.


This would be the init program included with the RPM?

Is it written for traditional init or systemd?




Any pointers, as I'm starting to lose sleep over this! :)

Thanks
Tory

PGDATA=`sed -n 's/Environment=PGDATA=//p' "${SERVICE_FILE}"`

and

# this parsing technique fails for PGDATA pathnames containing spaces,

# but there's not much I can do about it given systemctl's output format...

PGDATA=`systemctl show -p Environment "${SERVICE_NAME}.service" |

sed 's/^Environment=//' | tr ' ' '\n' |

sed -n 's/^PGDATA=//p' | tail -n 1`

if [ x"$PGDATA" = x ]; then

echo "failed to find PGDATA setting in ${SERVICE_NAME}.service"

exit 1

fi





--
Adrian Klaver
adrian.kla...@aklaver.com


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


Re: [GENERAL] 9.5 CentOS 7 setting PGDATA for systemctl

2016-05-22 Thread Tory M Blue



> On May 22, 2016, at 07:50, Adrian Klaver  wrote:
> 
>> On 05/21/2016 10:27 PM, Tory M Blue wrote:
>> Evening, morning, or afternoon,
>> 
>> So I'm trying to go back to a stock rpm package (vs my full custom,
>> builds).  This is a learning curve, not only because it's all "whacked
>> pathing (in my eyes:)) but rhel7 is a #$%$# with all the things they
>> changed.
> 
> So where did you get the 'stock' RPM's from, CentOS or the Postgres repos?

Postgres yum repos (I like this btw)

> 
>> 
>> Sooo
>> 
>> I've got servers built and I've got the correct data path initialized
>> and postgres can start the db "   /usr/pgsql-9.5/bin/pg_ctl -D
>> /pgsql/9.5/data -l logfile start"
>> 
>> But obviously systemctl start postgresql-9.5.server loses it's head
>> because it has no idea where my Data directory is and setting , PGDATA
>> as a variable, doesn't seem to work.
>> 
>> So how do I kick CentOS 7 in the teeth and make it change it's
>> attitude regarding where I have put things?  /var/lib/pgsql (really?)
>> I don't want to do symlinks.
>> 
>> I've got it installed and running, but postgres can't be the only
>> place to start/stop the server. I need systemctl to handle these tasks
>> as well.
>> 
>> The init program is all kinds of weirdness.
> 
> This would be the init program included with the RPM?
> 
> Is it written for traditional init or systemd?


Systemd , systemctl . 

Thanks 
Tory

> 
> 
>> 
>> Any pointers, as I'm starting to lose sleep over this! :)
>> 
>> Thanks
>> Tory
>> 
>> PGDATA=`sed -n 's/Environment=PGDATA=//p' "${SERVICE_FILE}"`
>> 
>> and
>> 
>> # this parsing technique fails for PGDATA pathnames containing spaces,
>> 
>> # but there's not much I can do about it given systemctl's output format...
>> 
>> PGDATA=`systemctl show -p Environment "${SERVICE_NAME}.service" |
>> 
>>sed 's/^Environment=//' | tr ' ' '\n' |
>> 
>>sed -n 's/^PGDATA=//p' | tail -n 1`
>> 
>> if [ x"$PGDATA" = x ]; then
>> 
>>echo "failed to find PGDATA setting in ${SERVICE_NAME}.service"
>> 
>>exit 1
>> 
>> fi
> 
> 
> -- 
> Adrian Klaver
> adrian.kla...@aklaver.com


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


Re: [GENERAL] 9.5 CentOS 7 setting PGDATA for systemctl

2016-05-22 Thread Adrian Klaver

On 05/22/2016 09:06 AM, Tory M Blue wrote:





On May 22, 2016, at 07:50, Adrian Klaver  wrote:





So where did you get the 'stock' RPM's from, CentOS or the Postgres repos?


Postgres yum repos (I like this btw)



I do not use CentOS myself, so I will point you at this:

http://people.planetpostgresql.org/devrim/index.php?/archives/80-Installing-and-configuring-PostgreSQL-9.3-and-9.4-on-RHEL-7.html






The init program is all kinds of weirdness.


This would be the init program included with the RPM?

Is it written for traditional init or systemd?



Systemd , systemctl .

Thanks
Tory









--
Adrian Klaver
adrian.kla...@aklaver.com


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


Re: [GENERAL] 9.5 CentOS 7 setting PGDATA for systemctl

2016-05-22 Thread Tory M Blue
On Sun, May 22, 2016 at 9:10 AM, Adrian Klaver
 wrote:
> On 05/22/2016 09:06 AM, Tory M Blue wrote:
>>
>>
>>
>>
>>> On May 22, 2016, at 07:50, Adrian Klaver 
>>> wrote:
>>>
>
>>>
>>> So where did you get the 'stock' RPM's from, CentOS or the Postgres
>>> repos?
>>
>>
>> Postgres yum repos (I like this btw)
>
>
>
> I do not use CentOS myself, so I will point you at this:
>
> http://people.planetpostgresql.org/devrim/index.php?/archives/80-Installing-and-configuring-PostgreSQL-9.3-and-9.4-on-RHEL-7.html
>
>

Thanks Adrian, had not seen that page, so I modified my image , moving
some files around, having them modified and it's working as I
expected.. w0w convoluted, but this works.

"As of RHEL 7, as done in the Fedora packages for two years, the unit
files are located under /lib/systemd/system/ directory. Please do not
edit these files directly. Instead, if you want to make any changes,
create a copy of them under /etc/systemd/system/ , and edit those
files. Run"

# Location of database directory

Environment=PGDATA=/pgsql/9.5/data


Thanks again!
Tory


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


[GENERAL] Postgresql-MongoDb foreigndata wrapper

2016-05-22 Thread aluka raju
Hello,

I want use my data source as  mongodb and connect through postgresql fdw.
Is their any restrictions that the data present in mongodb to be structured
or unstructured data?

Thanks
aluka

Sent with MailTrack



Re: [GENERAL] postgresql-9.5.3 compilation on Solaris SPARC

2016-05-22 Thread Venkata Balaji N
Hi Asif,

Sorry, i should have responded first. Thanks for inputs and my replies are
inline -


> Any help would be appreciated. Do i need to give any particular CFLAGS ?
>>
>>
>> Below is the *configure *command -
>>
>>
>> ./configure --prefix=/opt/postgres/9.5.3 CC=/opt/SUNWspro/bin/cc
>> 'CFLAGS=-xO3 -xarch=v9 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff
>> -xc99=none -xCC' --enable-cassert --without-readline --enable-thread-safety
>> LDFLAGS='-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9'
>>
>
> AFAIR I deprived use of -xarch=v9 and used -m64 instead. I wonder why are
> you using LDFLAGS='-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9', when you
> provide -xarch=v9 compiler should automatically pick the correct libraries
> and headers I think. There seems lot of cflags used, are you using them
> because of any recommendation or any issue faced ?.
>

I just gave LDFLAGS in-case compiler cannot pickup the libraries and the
locations i gave in LDFLAGS is for 64 Bit libraries. "-m64" in CFLAGS is
generating an error and CC="gcc -m64" is running successfully. So, no
issues there.

Regards,
Venkata B N

Fujitsu Australia


Re: [GENERAL] postgresql-9.5.3 compilation on Solaris SPARC

2016-05-22 Thread Venkata Balaji N
On Sun, May 22, 2016 at 6:38 PM, Venkata Balaji N  wrote:

>
> On Sun, May 22, 2016 at 1:59 AM, Tom Lane  wrote:
>
>> Venkata Balaji N  writes:
>> > On Sat, May 21, 2016 at 1:04 AM, Tom Lane  wrote:
>> >> http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
>> >> http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
>> >>
>> >> I see that the first of those mentions it's for SunOS 5.11 whereas your
>> >> machine says it's 5.10 ... is it possible the functions were new in
>> 5.11?
>>
>> > I am not 100% sure. By the error, what i understand is that for some
>> reason
>> > PostgreSQL version 9.5.x is expecting the SunOS version to be more
>> recent
>> > than 5.10.
>>
>> Well, it's not --- we have a buildfarm animal that's running 5.10, and
>> it seems perfectly happy:
>>
>> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=castoroides&dt=2016-05-21%2014%3A00%3A47
>>
>> At this point I suspect that Asif Naeem was correct upthread in
>> questioning your compile options --- particularly the -L switches.
>> castoroides seems to just be using this:
>>
>> 'config_env' => {
>>   'CFLAGS' => '-m64 -xarch=native -xdepend -xO4
>> -xprefetch=auto,explicit',
>>   'CC' => 'cc',
>>   'LDFLAGS' => ''
>> },
>>
>
> Thanks. Then, as i suspected, the problem must be around using appropriate
> CFLAGS, which i am not sure at what to use. One thing i can say at this
> point is that, if i just add "-m64" option in CFLAGS, i get an error
> illegal option.
> I will re-test the compilation and get back with the inputs.
>

All good now. I am able to get the PostgreSQL-9.5.3 64-Bit installation
done by removing the CFLAGS. Below is the configure command which i used -

./configure --prefix=/opt/postgres/9.5.3 CC="gcc -m64" --enable-cassert
--without-readline --enable-thread-safety

Thanks all for your inputs and sorry for the confusion.

Regards,
Venkata B N

Fujitsu Australia


Re: [GENERAL] Postgresql-MongoDb foreigndata wrapper

2016-05-22 Thread Sameer Kumar
On Mon, 23 May 2016, 1:03 p.m. aluka raju,  wrote:

> Hello,
>
> I want use my data source as  mongodb and connect through postgresql fdw.
> Is their any restrictions that the data present in mongodb to be structured
> or unstructured data?
>

For connecting to mongoDB you would need mongodb_fdw and not PostgreSQL
fdw. I don't think they have any restrictions with respect to the data
model.

BTW, why do you want to do that?


> Thanks
> aluka
>
> Sent with MailTrack
> 
>
-- 
--
Best Regards
Sameer Kumar | DB Solution Architect
*ASHNIK PTE. LTD.*

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069 533

T: +65 6438 3504 | M: +65 8110 0350 | www.ashnik.com


Re: [GENERAL] Postgresql-MongoDb foreigndata wrapper

2016-05-22 Thread Sameer Kumar
Cc pg-list

Pls avoiding reaching out to members via list. I may not know something
which someone else in the list may know.

On Mon, 23 May 2016, 1:22 p.m. aluka raju,  wrote:

> Hello,
>
> I have data storage in flat files (structured and unstructured) . I want
> to run sql queries on that , so i am looking in to postgresql to this on
> the data that i have. I want to prepare a software for running sql queries
> for the data in files,so i am trying to have separate postgresql engine and
> write an wrappper for connecting the data that are in files.
>

Do these files change?

>
> Do you have any idea how can we do ?
>

Have you considering uploading this data to PostgreSQL? It can store
relational and JSOn data both.



>
> Thanks,
> aluka
>
>
>
> Sent with MailTrack
> 
>
> On Mon, May 23, 2016 at 10:37 AM, Sameer Kumar 
> wrote:
>
>>
>>
>> On Mon, 23 May 2016, 1:03 p.m. aluka raju, 
>> wrote:
>>
>>> Hello,
>>>
>>> I want use my data source as  mongodb and connect through postgresql
>>> fdw. Is their any restrictions that the data present in mongodb to be
>>> structured or unstructured data?
>>>
>>
>> For connecting to mongoDB you would need mongodb_fdw and not PostgreSQL
>> fdw. I don't think they have any restrictions with respect to the data
>> model.
>>
>> BTW, why do you want to do that?
>>
>>
>>> Thanks
>>> aluka
>>>
>>> Sent with MailTrack
>>> 
>>>
>> --
>> --
>> Best Regards
>> Sameer Kumar | DB Solution Architect
>> *ASHNIK PTE. LTD.*
>>
>> 101 Cecil Street, #11-11 Tong Eng Building, Singapore 069 533
>>
>> T: +65 6438 3504 | M: +65 8110 0350 | www.ashnik.com
>>
>
> --
--
Best Regards
Sameer Kumar | DB Solution Architect
*ASHNIK PTE. LTD.*

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069 533

T: +65 6438 3504 | M: +65 8110 0350 | www.ashnik.com


[GENERAL] Postgresql-fdw

2016-05-22 Thread aluka raju
I have data storage in flat files (structured and unstructured) . I want to
run sql queries on that , so i am looking in to postgresql how to use fdw
on the data that i have. I want to prepare an api for running sql queries
for the data in files,so i am trying to have separate postgresql engine and
write an wrappper for connecting the data that are in files.

Help me out how can i proceed.

Thanks
aluka

Sent with MailTrack



Re: [GENERAL] Postgresql-fdw

2016-05-22 Thread Arthur Silva
You can build a multicorn fdw http://multicorn.org/

Regards

On May 23, 2016 7:54 AM, "aluka raju"  wrote:
>
> I have data storage in flat files (structured and unstructured) . I want
to run sql queries on that , so i am looking in to postgresql how to use
fdw on the data that i have. I want to prepare an api for running sql
queries for the data in files,so i am trying to have separate postgresql
engine and write an wrappper for connecting the data that are in files.
>
> Help me out how can i proceed.
>
> Thanks
> aluka
>
> Sent with MailTrack


Re: [GENERAL] Postgresql-fdw

2016-05-22 Thread John R Pierce

On 5/22/2016 10:52 PM, aluka raju wrote:
I have data storage in flat files (structured and unstructured) . I 
want to run sql queries on that , so i am looking in to postgresql how 
to use fdw on the data that i have. I want to prepare an api for 
running sql queries for the data in files,so i am trying to have 
separate postgresql engine and write an wrappper for connecting the 
data that are in files.


Help me out how can i proceed.



I'm not sure what you're expecting postgres to do for you here...  Flat 
unstructured files have to be read sequentially to do /anything/.  
even a simple 'select * from someflattable where id=115', it will have 
to read the whole file to find any and all records with id=115.


If you want to use postgres to query this data efficiently, you really 
should import this data into postgres tables, properly indexed for the 
sorts of queries you wish to do.





--
john r pierce, recycling bits in santa cruz