Re: puzzling perl DBI vs psql problem

From: Susan Cassidy <susan(dot)cassidy(at)decisionsciencescorp(dot)com>
To: Dennis Jenkins <dennis(dot)jenkins(dot)75(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: puzzling perl DBI vs psql problem
Date: 2014-03-13 21:23:32
Message-ID: CAE3Q8oneNb+Cwa1Fi6n+OWFXmfNF629Y-OQzOEf+e73pSB=UiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The only one that comes out different is inet_server_addr, via the
program, it comes out:
::1
whereas via psql it comes out empty.

Yes, I am 100% sure I am using the same schema (which I never specify, so I
am using 'public') and the same user and database.

Susan

On Thu, Mar 13, 2014 at 1:53 PM, Dennis Jenkins <dennis(dot)jenkins(dot)75(at)gmail(dot)com
> wrote:

> 1)
> Run both "psql" and "perl" under "strace" and search the output for which
> sockets it connects to.
> eg, strace -o /tmp/psql.log psql -Upgsql -dmydatabase -c"select
> version();"
>
>
> 2)
> Add a query into your perl script to perform the following SQL and print
> the results:
>
> select current_database();
> select current_schema();
> select inet_server_addr();
> select current_user;
> (and others, see
> http://www.postgresql.org/docs/9.3/static/functions-info.html for more
> functions)
> Do the same from your "psql". Compare the output. Are you 110% sure that
> you are connecting to the same database, as the same user, and using the
> same schema?
>
>
>
>
> On Thu, Mar 13, 2014 at 3:44 PM, Susan Cassidy <
> susan(dot)cassidy(at)decisionsciencescorp(dot)com> wrote:
>
>> No, I don't have 2 instances running. I default the port on the psql
>> command line, and the perl program is using 5432, as normal.
>>
>> Now, I'm discovering that syslog is no longer logging anything. I
>> bounced it, but to no avail.
>>
>> Susan
>>
>>
>> On Thu, Mar 13, 2014 at 1:34 PM, Rodrigo Gonzalez <
>> rjgonzale(dot)lists(at)gmail(dot)com> wrote:
>>
>>> On Thu, 13 Mar 2014 13:28:38 -0700
>>> Susan Cassidy <susan(dot)cassidy(at)decisionsciencescorp(dot)com> wrote:
>>>
>>> > No, it is connecting to localhost, which is the same system I am
>>> > running psql on.
>>> >
>>> > Susan
>>> >
>>> Well, if one query is logged and the other one is not it means that it
>>> is running against different servers (as far as I understand
>>> logging)....
>>>
>>> Maybe psql is connecting using one socket and perl using another one?
>>> maybe you have 2 instances running?
>>>
>>
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2014-03-13 21:27:52 Re: puzzling perl DBI vs psql problem
Previous Message Rob Sargent 2014-03-13 20:55:28 Re: puzzling perl DBI vs psql problem