[QGIS-trac] Re: [Quantum GIS] #1327: PostGIS layer default value
handling is incorrect
Quantum GIS
qgis at qgis.org
Tue Sep 23 01:59:34 EDT 2008
#1327: PostGIS layer default value handling is incorrect
--------------------------------------------------------------+-------------
Reporter: smizuno | Owner: nobody
Type: bug | Status: new
Priority: critical: causes crash or data corruption | Milestone: Version 1.0.0
Component: Data Provider | Version: HEAD
Resolution: | Keywords:
Platform_version: | Platform: All
Must_fix: Yes | Status_info: 0
--------------------------------------------------------------+-------------
Comment (by jef):
Replying to [ticket:1327 smizuno]:
> Because the expression is now the text in the entry field, the result in
the
> database table is: {{{'This is a test'::character varying}}}
Not reproducable here. You'll see that expression for the value only
while the
added feature is not saved yet. After commit you'll find 'This is a test'
in the database.
> Another, better way, would be to send a SELECT query using the
expression for
> the default value to the database, then using the result in the
attribute
> entry field. This is necessary for text types and sequences, and
probably
> others.
This is what happens, when the expression is left untouched for some but
not
all features and therefore the column needs to be a parameter in the
insert
statement.
> 2. The default value for for the column used as the object id, when
defined
> as SERIAL does not use the sequence. Actually, this isn't done for any
column
> defined as SERIAL, even though the attribute entry fields display the
> "nextval(...)" expression.
Right.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1327#comment:1>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list