Search code examples
postgresqlpostgresql-9.2hstore

PostgreSQL populate_record and hstore


I am running Postgres 9.2.4 with hstore extension (on Windows)

Given a Table:

CREATE Table tmpM  (
id bigserial NOT NULL, 
EventId bigint NOT NULL, 
LoginId bigint NOT NULL,
CONSTRAINT tmpM_key PRIMARY KEY (id));

I am trying to run this statement:

SELECT * from populate_record(null::tmpM, '"EventId"=>"123", "LoginId"=>"456"')

I am getting a result of 1 row, but all values are null. Any ideas as to what I am doing wrong?


Solution

  • Found the issue. Col names are quoted and hence not match the names in the table. Love Postgres, but case handling is ...ermmm...not so nice :-)