pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fwd: Re: fun with postgresql
4+ messages / 3 participants
[nested] [flat]

* Fwd: Re: fun with postgresql
@ 2000-01-28 16:38 Ruben Fagundo <rfagundo@npv.com>
  2000-01-28 18:01 ` Re: [ADMIN] Fwd: Re: fun with postgresql Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
  2000-01-28 19:22 ` Re: [ADMIN] Fwd: Re: fun with postgresql J Carlos Morales Duarte. <jcmd@acer.com.mx>
  0 siblings, 2 replies; 4+ messages in thread

From: Ruben Fagundo @ 2000-01-28 16:38 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Art Spaziano <spaziano@usa.net>; dlsilvia@mediaone.net

Does anyone have any idea why this happened ?

I'm having trouble with postgresql.  My script tries to do this:

my $sql = "insert into people (firstName, lastName, Email)
values ($V{'firstname'}, $V{'lastname'}, $V{'MAILTO'})";

but it gets the error:  DBD::Pg::st execute failed: ERROR: Attribute don not
found .  'don' is the firstName value that I'm trying to insert.  Even in
psql I get similar weirdness:

postgres=> select firstName, lastName, Email from people \g
ERROR:  attribute 'firstname' not found
postgres=> select firstName from people \g
ERROR:  attribute 'firstname' not found
postgres=> select Email from people \g
ERROR:  attribute 'email' not found

But 'select * from people' works.

What am I missing?  Is there a case-sensitivity issue?  I'm using the case
for the field names that I see with a '\d people'

There are some strange things happening.  In the past, I also updated a table, but didn't see the changes until the postgres was restarted.  It seems like some things were coming from a cache that had not gotten refreshed.  Anyone see any of these weird things before ?


Ruben
==================================
Ruben Fagundo
T:617/244-6136
F:603/452-3220




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [ADMIN] Fwd: Re: fun with postgresql
  2000-01-28 16:38 Fwd: Re: fun with postgresql Ruben Fagundo <rfagundo@npv.com>
@ 2000-01-28 18:01 ` Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
  1 sibling, 0 replies; 4+ messages in thread

From: Ross J. Reedstrom @ 2000-01-28 18:01 UTC (permalink / raw)
  To: Ruben Fagundo <rfagundo@npv.com>; +Cc: pgsql-admin

On Fri, Jan 28, 2000 at 11:38:49AM -0500, Ruben Fagundo wrote:
> Does anyone have any idea why this happened ?
> 
> I'm having trouble with postgresql.  My script tries to do this:
> 
> my $sql = "insert into people (firstName, lastName, Email)
> values ($V{'firstname'}, $V{'lastname'}, $V{'MAILTO'})";
> 
> but it gets the error:  DBD::Pg::st execute failed: ERROR: Attribute don not
> found .  'don' is the firstName value that I'm trying to insert.  Even in
> psql I get similar weirdness:
> 
> postgres=> select firstName, lastName, Email from people \g
> ERROR:  attribute 'firstname' not found
> postgres=> select firstName from people \g
> ERROR:  attribute 'firstname' not found
> postgres=> select Email from people \g
> ERROR:  attribute 'email' not found


To make this work, try:

select "firstName", "lastName", "Email" from people ;

> 
> But 'select * from people' works.
> 
> What am I missing?  Is there a case-sensitivity issue?  I'm using the case
> for the field names that I see with a '\d people'


Right, it's the SQL quoting rules. A bare name is taken to mean an
identifier (table name or field name), which is then downcased before
lookup. Quoting with double quotes (") indicates an identifier that is
used directly, without downcasing (or validation against reserved words:
you can make very odd tablenames that way). All string values need to be
quoted with single quotes (')

idas=> select test;
ERROR:  attribute 'test' not found
idas=> select 'test';
?column?
--------
test    
(1 row)

idas=> 

I don't know perl, but you need to get the single quotes around all the 
values.

Hope this helps,

Ross

P.S. This question probably belongs on the interfaces list, not admin.
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [ADMIN] Fwd: Re: fun with postgresql
  2000-01-28 16:38 Fwd: Re: fun with postgresql Ruben Fagundo <rfagundo@npv.com>
@ 2000-01-28 19:22 ` J Carlos Morales Duarte. <jcmd@acer.com.mx>
  2000-01-28 18:41   ` Re: [ADMIN] Fwd: Re: fun with postgresql Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
  1 sibling, 1 reply; 4+ messages in thread

From: J Carlos Morales Duarte. @ 2000-01-28 19:22 UTC (permalink / raw)
  To: Ruben Fagundo <rfagundo@npv.com>; +Cc: pgsql-admin@postgreSQL.org, Art Spaziano <spaziano@usa.net>; dlsilvia@mediaone.net



mmmmmmmmmm

On Fri, 28 Jan 2000, Ruben Fagundo wrote:

> Does anyone have any idea why this happened ?
> 
> I'm having trouble with postgresql.  My script tries to do this:
> 
> my $sql = "insert into people (firstName, lastName, Email)
> values ($V{'firstname'}, $V{'lastname'}, $V{'MAILTO'})";
> 
i like more...

my $sql = "insert into people (firstName, lastName, Email)
 values ('$V{firstname}','$V{lastname}','$V'MAILTO}')";

did you tried???





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [ADMIN] Fwd: Re: fun with postgresql
  2000-01-28 16:38 Fwd: Re: fun with postgresql Ruben Fagundo <rfagundo@npv.com>
  2000-01-28 19:22 ` Re: [ADMIN] Fwd: Re: fun with postgresql J Carlos Morales Duarte. <jcmd@acer.com.mx>
@ 2000-01-28 18:41   ` Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
  0 siblings, 0 replies; 4+ messages in thread

From: Ross J. Reedstrom @ 2000-01-28 18:41 UTC (permalink / raw)
  To: J Carlos Morales Duarte. <jcmd@acer.com.mx>; +Cc: Ruben Fagundo <rfagundo@npv.com>; pgsql-admin

On Fri, Jan 28, 2000 at 01:22:38PM -0600, J Carlos Morales Duarte. wrote:
> 
> 
> mmmmmmmmmm
> 
> On Fri, 28 Jan 2000, Ruben Fagundo wrote:
> 
> > Does anyone have any idea why this happened ?
> > 
> > I'm having trouble with postgresql.  My script tries to do this:
> > 
> > my $sql = "insert into people (firstName, lastName, Email)
> > values ($V{'firstname'}, $V{'lastname'}, $V{'MAILTO'})";
> > 
> i like more...
> 
> my $sql = "insert into people (firstName, lastName, Email)
>  values ('$V{firstname}','$V{lastname}','$V'MAILTO}')";

I think he means (deleted wrong character by MAILTO):
  
  values ('$V{firstname}','$V{lastname}','$V{MAILTO}')";

but as I said, I don't know perl ;-)

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-01-28 19:22 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-01-28 16:38 Fwd: Re: fun with postgresql Ruben Fagundo <rfagundo@npv.com>
2000-01-28 18:01 ` Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
2000-01-28 19:22 ` J Carlos Morales Duarte. <jcmd@acer.com.mx>
2000-01-28 18:41   ` Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox